)]}'
{"swift/common/middleware/mpu.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"2d779515c9c917c2ef0b0c8962c5684b0ebc487e","unresolved":true,"context_lines":[{"line_number":148,"context_line":"    STATES \u003d (CREATED_STATE, COMPLETING_STATE)"},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"    def __init__(self, name, timestamp, content_type\u003dMPU_SESSION_CONTENT_TYPE,"},{"line_number":151,"context_line":"                 state\u003dCREATED_STATE, headers\u003dNone):"},{"line_number":152,"context_line":"        self.name \u003d name"},{"line_number":153,"context_line":"        self.timestamp \u003d timestamp"},{"line_number":154,"context_line":"        self.content_type \u003d content_type"}],"source_content_type":"text/x-python","patch_set":6,"id":"2be0d06d_995073c0","line":151,"updated":"2024-10-17 21:18:54.000000000","message":"Sizeable increase in params -- but the general expectation is that callers would be using `from_user_headers`/`from_backend_headers`, yeah? Should we drag those up (maybe even *above* `__init__`) to make them more obvious? At the very least, we\u0027ll probably want a comment or docstring about the preferred API.","commit_id":"aeee0e3540542b56f191644eb6284217e7522de5"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"17639650a287f58f004b0360c84c116f62252272","unresolved":true,"context_lines":[{"line_number":148,"context_line":"    STATES \u003d (CREATED_STATE, COMPLETING_STATE)"},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"    def __init__(self, name, timestamp, content_type\u003dMPU_SESSION_CONTENT_TYPE,"},{"line_number":151,"context_line":"                 state\u003dCREATED_STATE, headers\u003dNone):"},{"line_number":152,"context_line":"        self.name \u003d name"},{"line_number":153,"context_line":"        self.timestamp \u003d timestamp"},{"line_number":154,"context_line":"        self.content_type \u003d content_type"}],"source_content_type":"text/x-python","patch_set":6,"id":"cb71dc0c_7b019835","line":151,"in_reply_to":"2be0d06d_995073c0","updated":"2024-10-18 14:50:01.000000000","message":"I\u0027ll pull up the class methods, but the constructor is also used in a lter patch set by the MpuAuditor\n\nsorry - I pulled these changes forwards into a separate patch to make the later auditor patches simpler, but I realise some context is lost in doing so","commit_id":"aeee0e3540542b56f191644eb6284217e7522de5"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"2d779515c9c917c2ef0b0c8962c5684b0ebc487e","unresolved":true,"context_lines":[{"line_number":172,"context_line":"    def is_completed(self):"},{"line_number":173,"context_line":"        return self.content_type \u003d\u003d MPU_SESSION_COMPLETED_CONTENT_TYPE"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"    def set_completed(self):"},{"line_number":176,"context_line":"        self.content_type \u003d MPU_SESSION_COMPLETED_CONTENT_TYPE"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":6,"id":"3c9b407b_c4258e5f","line":175,"updated":"2024-10-17 21:18:54.000000000","message":"These are sounding more and more like `state`s -- `is_active` seems like `created`, and `is_completed`/`completing` must at least be _related_ -- do we have a FSM diagram or something?\n\nI don\u0027t see anything using this yet, though, is that right?","commit_id":"aeee0e3540542b56f191644eb6284217e7522de5"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"17639650a287f58f004b0360c84c116f62252272","unresolved":true,"context_lines":[{"line_number":172,"context_line":"    def is_completed(self):"},{"line_number":173,"context_line":"        return self.content_type \u003d\u003d MPU_SESSION_COMPLETED_CONTENT_TYPE"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"    def set_completed(self):"},{"line_number":176,"context_line":"        self.content_type \u003d MPU_SESSION_COMPLETED_CONTENT_TYPE"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":6,"id":"6b8b718b_7e797d4a","line":175,"in_reply_to":"3c9b407b_c4258e5f","updated":"2024-10-18 14:50:01.000000000","message":"state is going away, so here I am adding new properties that will be used and once they are used a later patch rips out the state metadata stuff. There will be a content-type for completing.\n\nSorry, I realise the ordering isn\u0027t great.\n\nSome kind of state machine/doc would be good: I\u0027ll make a start in this patch but it\u0027ll make more sense in a later patch set once the behavior has settled down.","commit_id":"aeee0e3540542b56f191644eb6284217e7522de5"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"2107de6293b9ea6726bdbaeb90c4d6fe7c35c5a3","unresolved":true,"context_lines":[{"line_number":172,"context_line":"    def is_completed(self):"},{"line_number":173,"context_line":"        return self.content_type \u003d\u003d MPU_SESSION_COMPLETED_CONTENT_TYPE"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"    def set_completed(self):"},{"line_number":176,"context_line":"        self.content_type \u003d MPU_SESSION_COMPLETED_CONTENT_TYPE"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":6,"id":"e2e7eb0a_05e9fd02","line":175,"in_reply_to":"4e3b31a3_d8495ed5","updated":"2024-10-18 15:43:07.000000000","message":"I added a kind of state machine here https://review.opendev.org/c/openstack/swift/+/931517/9/swift/common/middleware/mpu.py\n\nit\u0027s weird though because concurrent requests means that almost anything could happen","commit_id":"aeee0e3540542b56f191644eb6284217e7522de5"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"cfd11313c31a232ada19f653d6ed325ceb54219d","unresolved":true,"context_lines":[{"line_number":172,"context_line":"    def is_completed(self):"},{"line_number":173,"context_line":"        return self.content_type \u003d\u003d MPU_SESSION_COMPLETED_CONTENT_TYPE"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"    def set_completed(self):"},{"line_number":176,"context_line":"        self.content_type \u003d MPU_SESSION_COMPLETED_CONTENT_TYPE"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":6,"id":"4e3b31a3_d8495ed5","line":175,"in_reply_to":"6b8b718b_7e797d4a","updated":"2024-10-18 14:52:19.000000000","message":"see https://review.opendev.org/c/openstack/swift/+/931517/8/swift/common/middleware/mpu.py","commit_id":"aeee0e3540542b56f191644eb6284217e7522de5"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"2d779515c9c917c2ef0b0c8962c5684b0ebc487e","unresolved":true,"context_lines":[{"line_number":192,"context_line":"            self.STATE_KEY: self.state,"},{"line_number":193,"context_line":"            \u0027Content-Type\u0027: self.content_type,"},{"line_number":194,"context_line":"            \u0027Content-Length\u0027: \u00270\u0027})"},{"line_number":195,"context_line":"        headers.update(self.headers)"},{"line_number":196,"context_line":"        return headers"},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"    def get_post_headers(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"5480eb7e_6f47843c","line":195,"updated":"2024-10-17 21:18:54.000000000","message":"Oh... so... we drop the user meta on POST? Which is fine, I suppose, because we should only POST following a complete/abort op, so we shouldn\u0027t need to reference it later, right?\n\nWhat happens if there\u0027s a crash or something as SLO is validating the segments, and the client needs to retry? Have we already done our POST to indicate that we\u0027re completing?","commit_id":"aeee0e3540542b56f191644eb6284217e7522de5"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"17639650a287f58f004b0360c84c116f62252272","unresolved":true,"context_lines":[{"line_number":192,"context_line":"            self.STATE_KEY: self.state,"},{"line_number":193,"context_line":"            \u0027Content-Type\u0027: self.content_type,"},{"line_number":194,"context_line":"            \u0027Content-Length\u0027: \u00270\u0027})"},{"line_number":195,"context_line":"        headers.update(self.headers)"},{"line_number":196,"context_line":"        return headers"},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"    def get_post_headers(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"be829c47_2ade7d50","line":195,"in_reply_to":"5480eb7e_6f47843c","updated":"2024-10-18 14:50:01.000000000","message":"The user metadata is stored as sysmeta with the *session* and copied to user-meta on the manifest when it is PUT during completeUpload. Subsequent client POSTs to the user-namespace obj will update the manifest metadata (implemented in following patch https://review.opendev.org/c/openstack/swift/+/932633?usp\u003demail)\n\nWe POST to the session to change the content-type to completing at the start of the completeUpload operations. We POST to the session to change the content-type to completed at the end of the completeUpload operations. If there is any failure before the end of completeUpload the session is left with content-type ~ completing. That does not prevent a client retrying the completeUpload, or aborting, but it does cause the auditor to check if the user-namespace object did in fact get symlinked to the manifest, and if so the auditor cleans up the session as if it were completed.","commit_id":"aeee0e3540542b56f191644eb6284217e7522de5"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"2d779515c9c917c2ef0b0c8962c5684b0ebc487e","unresolved":true,"context_lines":[{"line_number":196,"context_line":"        return headers"},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"    def get_post_headers(self):"},{"line_number":199,"context_line":"        return HeaderKeyDict("},{"line_number":200,"context_line":"            {self.TIMESTAMP_KEY: self.timestamp.internal,"},{"line_number":201,"context_line":"             self.STATE_KEY: self.state,"},{"line_number":202,"context_line":"             \u0027Content-Type\u0027: self.content_type})"}],"source_content_type":"text/x-python","patch_set":6,"id":"e7727867_0ca9bd1b","line":199,"range":{"start_line":199,"start_character":15,"end_line":199,"end_character":28},"updated":"2024-10-17 21:18:54.000000000","message":"This just for case-insensitivity, I\u0027m guessing?","commit_id":"aeee0e3540542b56f191644eb6284217e7522de5"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"17639650a287f58f004b0360c84c116f62252272","unresolved":true,"context_lines":[{"line_number":196,"context_line":"        return headers"},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"    def get_post_headers(self):"},{"line_number":199,"context_line":"        return HeaderKeyDict("},{"line_number":200,"context_line":"            {self.TIMESTAMP_KEY: self.timestamp.internal,"},{"line_number":201,"context_line":"             self.STATE_KEY: self.state,"},{"line_number":202,"context_line":"             \u0027Content-Type\u0027: self.content_type})"}],"source_content_type":"text/x-python","patch_set":6,"id":"025bc667_136027d1","line":199,"range":{"start_line":199,"start_character":15,"end_line":199,"end_character":28},"in_reply_to":"e7727867_0ca9bd1b","updated":"2024-10-18 14:50:01.000000000","message":"yes, possibly to allow me to be lazy w.r.t. remembering which case is canonical 😊","commit_id":"aeee0e3540542b56f191644eb6284217e7522de5"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"2d779515c9c917c2ef0b0c8962c5684b0ebc487e","unresolved":true,"context_lines":[{"line_number":234,"context_line":"                backend_headers[get_mpu_sysmeta_key(k)] \u003d v"},{"line_number":235,"context_line":"            if k.lower() \u003d\u003d \u0027content-type\u0027:"},{"line_number":236,"context_line":"                backend_headers[cls.USER_CONTENT_TYPE_KEY] \u003d v"},{"line_number":237,"context_line":"        return MPUSession(name, timestamp, headers\u003dbackend_headers)"},{"line_number":238,"context_line":""},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"class BaseMPUHandler(object):"}],"source_content_type":"text/x-python","patch_set":6,"id":"5e4f13d4_0d709360","line":237,"range":{"start_line":237,"start_character":15,"end_line":237,"end_character":25},"updated":"2024-10-17 21:18:54.000000000","message":"Not `cls`?","commit_id":"aeee0e3540542b56f191644eb6284217e7522de5"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"17639650a287f58f004b0360c84c116f62252272","unresolved":true,"context_lines":[{"line_number":234,"context_line":"                backend_headers[get_mpu_sysmeta_key(k)] \u003d v"},{"line_number":235,"context_line":"            if k.lower() \u003d\u003d \u0027content-type\u0027:"},{"line_number":236,"context_line":"                backend_headers[cls.USER_CONTENT_TYPE_KEY] \u003d v"},{"line_number":237,"context_line":"        return MPUSession(name, timestamp, headers\u003dbackend_headers)"},{"line_number":238,"context_line":""},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"class BaseMPUHandler(object):"}],"source_content_type":"text/x-python","patch_set":6,"id":"f5bb039e_eb4a9aa4","line":237,"range":{"start_line":237,"start_character":15,"end_line":237,"end_character":25},"in_reply_to":"5e4f13d4_0d709360","updated":"2024-10-18 14:50:01.000000000","message":"good catch","commit_id":"aeee0e3540542b56f191644eb6284217e7522de5"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"6d3f52da559c3be2780f49b5311782ca142d9c6d","unresolved":true,"context_lines":[{"line_number":267,"context_line":"             \u0027Content-Type\u0027: self.content_type})"},{"line_number":268,"context_line":""},{"line_number":269,"context_line":"    def get_user_metadata(self):"},{"line_number":270,"context_line":"        # TODO: add x-delete-at"},{"line_number":271,"context_line":"        user_metadata \u003d {}"},{"line_number":272,"context_line":"        for key, val in self.headers.items():"},{"line_number":273,"context_line":"            stripped_key \u003d strip_mpu_sysmeta_prefix(key)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f7c2354_e94ba505","line":270,"updated":"2024-10-18 15:42:59.000000000","message":"There are other headers we may want to track: https://github.com/openstack/swift/blob/master/etc/object-server.conf-sample#L163","commit_id":"564b57835f81a5726a5ecda92abad1d3a14917ff"}]}
