)]}'
{"swift/common/middleware/versioned_writes.py":[{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"1e9938fdea951172ab557d3056c336ff0e550054","unresolved":false,"context_lines":[{"line_number":522,"context_line":"                      container_name, object_name, prev_obj_name):"},{"line_number":523,"context_line":"        get_path \u003d \"/%s/%s/%s/%s\" % ("},{"line_number":524,"context_line":"            api_version, account_name, versions_cont, prev_obj_name)"},{"line_number":525,"context_line":"        prev_ver_id \u003d prev_obj_name.split(\u0027/\u0027)[-1]"},{"line_number":526,"context_line":"        ver_id_header \u003d get_sys_meta_prefix(\u0027object\u0027) + \u0027version-id\u0027"},{"line_number":527,"context_line":""},{"line_number":528,"context_line":"        get_resp \u003d self._get_source_object(req, get_path)"}],"source_content_type":"text/x-python","patch_set":2,"id":"ffe62b97_23da624b","line":525,"updated":"2017-03-28 06:17:11.000000000","message":"NIT: You could use rsplit(\u0027/\u0027, 1)[-1] to only have to split once in the case of an object with more then 1 forward slash, but I\u0027m fine with just a .split(\u0027/\u0027)[-1] as an object name is never long enough and have enough forward slashes to make a difference.","commit_id":"818e375ace7c9140f255b0acb3492bd9f3eabf51"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"1e9938fdea951172ab557d3056c336ff0e550054","unresolved":false,"context_lines":[{"line_number":535,"context_line":""},{"line_number":536,"context_line":"        put_path_info \u003d \"/%s/%s/%s/%s\" % ("},{"line_number":537,"context_line":"            api_version, account_name, container_name, object_name)"},{"line_number":538,"context_line":"        get_resp.headers[ver_id_header] \u003d prev_ver_id"},{"line_number":539,"context_line":"        put_resp \u003d self._put_versioned_obj("},{"line_number":540,"context_line":"            req, put_path_info, get_resp)"},{"line_number":541,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"ffe62b97_03dbde4e","line":538,"updated":"2017-03-28 06:17:11.000000000","message":"You could simplify this, and only do the string modification when it needs to happen (doing the work here) which will also save us creating a variable name that will only ever be used once:\n\n  prev_ver_id \u003d prev_obj_name.split(\u0027/\u0027)[-1]\n  get_resp.headers[ver_id_header] \u003d prev_obj_name.split(\u0027/\u0027)[-1]","commit_id":"818e375ace7c9140f255b0acb3492bd9f3eabf51"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"ccc5d0a8f63437d5199c3d855e772216ede54e4b","unresolved":false,"context_lines":[{"line_number":453,"context_line":""},{"line_number":454,"context_line":"        # store version id as sysmeta"},{"line_number":455,"context_line":"        ver_id_header \u003d get_sys_meta_prefix(\u0027object\u0027) + \u0027version-id\u0027"},{"line_number":456,"context_line":"        get_resp.headers[ver_id_header] \u003d vers_obj_name.rsplit(\u0027/\u0027, 1)[-1]"},{"line_number":457,"context_line":""},{"line_number":458,"context_line":"        put_path_info \u003d \"/%s/%s/%s/%s\" % ("},{"line_number":459,"context_line":"            api_version, account_name, versions_cont, vers_obj_name)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f044301_983d22c6","line":456,"range":{"start_line":456,"start_character":42,"end_line":456,"end_character":74},"updated":"2017-05-10 15:11:47.000000000","message":"perhaps, this is just a Timestamp(ts_sourcce).internal?\n\nhttps://github.com/openstack/swift/blob/master/swift/common/middleware/versioned_writes.py#L413-L416","commit_id":"fec5bbbd8c055c28e33d972ef8e23b96f5c76f9c"},{"author":{"_account_id":23861,"name":"Karen Chan","email":"karen@karen-chan.com","username":"karenc"},"change_message_id":"fbb2b7750803b8dec00fa5c9336962e66b3f5cb2","unresolved":false,"context_lines":[{"line_number":453,"context_line":""},{"line_number":454,"context_line":"        # store version id as sysmeta"},{"line_number":455,"context_line":"        ver_id_header \u003d get_sys_meta_prefix(\u0027object\u0027) + \u0027version-id\u0027"},{"line_number":456,"context_line":"        get_resp.headers[ver_id_header] \u003d vers_obj_name.rsplit(\u0027/\u0027, 1)[-1]"},{"line_number":457,"context_line":""},{"line_number":458,"context_line":"        put_path_info \u003d \"/%s/%s/%s/%s\" % ("},{"line_number":459,"context_line":"            api_version, account_name, versions_cont, vers_obj_name)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f044301_38f84e47","line":456,"range":{"start_line":456,"start_character":42,"end_line":456,"end_character":74},"in_reply_to":"3f044301_983d22c6","updated":"2017-05-10 15:32:18.000000000","message":"Yes that is it.  I\u0027ll change it, thanks!","commit_id":"fec5bbbd8c055c28e33d972ef8e23b96f5c76f9c"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"4bcd131bba35771764f0fd525839cb24b622b4ba","unresolved":false,"context_lines":[{"line_number":416,"context_line":"    def _build_versions_object_name(self, object_name, ts):"},{"line_number":417,"context_line":"        return \u0027\u0027.join(("},{"line_number":418,"context_line":"            self._build_versions_object_prefix(object_name),"},{"line_number":419,"context_line":"            self._build_version_id(ts)))"},{"line_number":420,"context_line":""},{"line_number":421,"context_line":"    def _copy_current(self, req, versions_cont, api_version, account_name,"},{"line_number":422,"context_line":"                      object_name):"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f044301_521c12c0","line":419,"range":{"start_line":419,"start_character":12,"end_line":419,"end_character":38},"updated":"2017-05-10 20:49:00.000000000","message":"wait... this patch also changes the object_name meaning?\n\nBefore this patch, it\u0027s obviously timestamp but now version_id, even it\u0027s defined as same value at _build_version_id though.\n\n\nEither example-1 or example-2 in [1] are what I intended at the previous patch set. i prefer example-1 because example-2 could have too much change too.\n\nHow do you think of? \n\n1: https://gist.github.com/bloodeagle40234/eabe4f46f7bd986a88a31711b34fd833","commit_id":"f15b84c85082cbd2fb43a123afab5b5809255b78"},{"author":{"_account_id":23861,"name":"Karen Chan","email":"karen@karen-chan.com","username":"karenc"},"change_message_id":"3ba80048f0978bf6e3d484f0e400c6ed08a1239f","unresolved":false,"context_lines":[{"line_number":416,"context_line":"    def _build_versions_object_name(self, object_name, ts):"},{"line_number":417,"context_line":"        return \u0027\u0027.join(("},{"line_number":418,"context_line":"            self._build_versions_object_prefix(object_name),"},{"line_number":419,"context_line":"            self._build_version_id(ts)))"},{"line_number":420,"context_line":""},{"line_number":421,"context_line":"    def _copy_current(self, req, versions_cont, api_version, account_name,"},{"line_number":422,"context_line":"                      object_name):"}],"source_content_type":"text/x-python","patch_set":6,"id":"1f013ff3_6a279014","line":419,"range":{"start_line":419,"start_character":12,"end_line":419,"end_character":38},"in_reply_to":"3f044301_521c12c0","updated":"2017-05-15 11:24:01.000000000","message":"I changed _build_version_id to _format_timestamp to make it a bit clearer that it\u0027s a timestamp..\n\nI wanted to make sure it\u0027s clear that _build_versions_object_name and version id sysmeta use the same formatted timestamp.  (rather than duplicating the code like in example-1 ... it\u0027s only one line though hm...)","commit_id":"f15b84c85082cbd2fb43a123afab5b5809255b78"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"e39a4e2a42fd6da5fd80d04156c3b005a111daae","unresolved":false,"context_lines":[{"line_number":456,"context_line":""},{"line_number":457,"context_line":"        # store internal timestamp as version id to sysmeta"},{"line_number":458,"context_line":"        ver_id_header \u003d get_sys_meta_prefix(\u0027object\u0027) + \u0027version-id\u0027"},{"line_number":459,"context_line":"        get_resp.headers[ver_id_header] \u003d self._format_timestamp(ts_source)"},{"line_number":460,"context_line":""},{"line_number":461,"context_line":"        put_path_info \u003d \"/%s/%s/%s/%s\" % ("},{"line_number":462,"context_line":"            api_version, account_name, versions_cont, vers_obj_name)"}],"source_content_type":"text/x-python","patch_set":8,"id":"ff0f0b1f_b14f3291","line":459,"updated":"2017-05-19 05:44:45.000000000","message":"I prefer current name rather than _build_version_id if _build_versions_object_name uses it. it\u0027s clearly internal timestamp.\n\nOn the other hand, i suppose, you have right question if \"timestamp can be id or not\".\n\nFor now, i don\u0027t have clear answer. I guess it depends on the use case of version id. You say as \"swift3 needs to know the version id even after it is restored, but right now there is no way to get the version id.\" in the commit message so more clear constraint for the swift3 use case. (e.g. how do we want the id to identify?)\n\nCould you describe or point out the swift3 patch which wants this patch to use? I could help you to consider.","commit_id":"d3852433b69c1e42c6fea09703b9f1125dc4438e"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"57703201cfe89d027b4b016c39fcf997099da160","unresolved":false,"context_lines":[{"line_number":456,"context_line":""},{"line_number":457,"context_line":"        # store internal timestamp as version id to sysmeta"},{"line_number":458,"context_line":"        ver_id_header \u003d get_sys_meta_prefix(\u0027object\u0027) + \u0027version-id\u0027"},{"line_number":459,"context_line":"        get_resp.headers[ver_id_header] \u003d self._format_timestamp(ts_source)"},{"line_number":460,"context_line":""},{"line_number":461,"context_line":"        put_path_info \u003d \"/%s/%s/%s/%s\" % ("},{"line_number":462,"context_line":"            api_version, account_name, versions_cont, vers_obj_name)"}],"source_content_type":"text/x-python","patch_set":8,"id":"bfdaf3ff_22c20535","line":459,"in_reply_to":"5f7c97a3_ee3d638f","updated":"2019-01-22 20:43:14.000000000","message":"I think we might be able to satisfy both (keep version-id on restore *and* preserve it when re-archived) by doing\n\n get_resp.headers.setdefault(ver_id_header, self._format_timestamp(ts_source))\n\ninstead of an unconditional set...","commit_id":"d3852433b69c1e42c6fea09703b9f1125dc4438e"},{"author":{"_account_id":28111,"name":"Yuxin Wang","email":"wang.yuxin@ostorage.com.cn","username":"wangyx"},"change_message_id":"ca985aea2a86c082724b994357949dd8484f1174","unresolved":false,"context_lines":[{"line_number":456,"context_line":""},{"line_number":457,"context_line":"        # store internal timestamp as version id to sysmeta"},{"line_number":458,"context_line":"        ver_id_header \u003d get_sys_meta_prefix(\u0027object\u0027) + \u0027version-id\u0027"},{"line_number":459,"context_line":"        get_resp.headers[ver_id_header] \u003d self._format_timestamp(ts_source)"},{"line_number":460,"context_line":""},{"line_number":461,"context_line":"        put_path_info \u003d \"/%s/%s/%s/%s\" % ("},{"line_number":462,"context_line":"            api_version, account_name, versions_cont, vers_obj_name)"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f7c97a3_ee3d638f","line":459,"in_reply_to":"ff0f0b1f_1d2a6c8f","updated":"2018-05-10 07:23:28.000000000","message":"I think version id should be consistent when objects are archived or restored. But using x-timestamp as version id can\u0027t achieve this feature. For example, suppose there is a versioned object with a name 003abc/ts1, if we restore it and then archive it again, it becomes 003abc/ts2.\n\nIn my opinion, we should store a random unique string in sysmeta header as version id when objects are created in swift3.","commit_id":"d3852433b69c1e42c6fea09703b9f1125dc4438e"},{"author":{"_account_id":23861,"name":"Karen Chan","email":"karen@karen-chan.com","username":"karenc"},"change_message_id":"317b71ce9adc6948925f317730e4cd5c83e57eb9","unresolved":false,"context_lines":[{"line_number":456,"context_line":""},{"line_number":457,"context_line":"        # store internal timestamp as version id to sysmeta"},{"line_number":458,"context_line":"        ver_id_header \u003d get_sys_meta_prefix(\u0027object\u0027) + \u0027version-id\u0027"},{"line_number":459,"context_line":"        get_resp.headers[ver_id_header] \u003d self._format_timestamp(ts_source)"},{"line_number":460,"context_line":""},{"line_number":461,"context_line":"        put_path_info \u003d \"/%s/%s/%s/%s\" % ("},{"line_number":462,"context_line":"            api_version, account_name, versions_cont, vers_obj_name)"}],"source_content_type":"text/x-python","patch_set":8,"id":"ff0f0b1f_1d2a6c8f","line":459,"in_reply_to":"ff0f0b1f_b14f3291","updated":"2017-05-19 10:26:52.000000000","message":"An object first gets a version id when it is moved to the archive.  The version id is part of the object name (e.g. 006object/123456789.000000 where 123456789.000000 is the version id).  If this gets restored because the current object is deleted, we lose the version id.\n\nS3 allows users to get objects by version id even after an object is restored.  For example, GET /bucket/object?versionId\u003d123456789.000000 should work regardless of whether this versioned object is in the archive or is the current object.  This already works if the object is in the archive, but we don\u0027t know the version id of the current object, so I tried save the version id in sysmeta. \n\nThe relevant patch in swift3 is https://review.openstack.org/#/c/436570/\n\nI\u0027m open to different approaches, please let me know if you have more ideas :D","commit_id":"d3852433b69c1e42c6fea09703b9f1125dc4438e"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"57703201cfe89d027b4b016c39fcf997099da160","unresolved":false,"context_lines":[{"line_number":483,"context_line":""},{"line_number":484,"context_line":"        self._copy_current(req, versions_cont, api_version, account_name,"},{"line_number":485,"context_line":"                           object_name)"},{"line_number":486,"context_line":"        return self.app"},{"line_number":487,"context_line":""},{"line_number":488,"context_line":"    def handle_obj_versions_delete_push(self, req, versions_cont, api_version,"},{"line_number":489,"context_line":"                                        account_name, container_name,"}],"source_content_type":"text/x-python","patch_set":8,"id":"bfdaf3ff_e2187dd4","line":486,"updated":"2019-01-22 20:43:14.000000000","message":"... but we maybe want to be doing the version-id-setting here instead. As soon as versioning gets enabled, all new PUTs need a version-id for S3 compat, right? So something like\n\n req.headers.setdefault(\u0027x-timestamp\u0027, Timestamp.now().internal)\n req.headers.setdefault(ver_id_header, req.headers[\u0027x-timestamp\u0027])\n return app\n\nand then we let that hang around as we copy back and forth between containers.\n\nWe might want to do something more akin to _update_x_timestamp for that first line, though; see https://github.com/openstack/swift/blob/2.20.0/swift/proxy/controllers/obj.py#L539-L554","commit_id":"d3852433b69c1e42c6fea09703b9f1125dc4438e"}],"test/unit/common/middleware/test_versioned_writes.py":[{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"1e9938fdea951172ab557d3056c336ff0e550054","unresolved":false,"context_lines":[{"line_number":661,"context_line":"        # Check that X-Object-Sysmeta-Version-Id was added to the PUT request"},{"line_number":662,"context_line":"        put_call \u003d self.app.calls_with_headers[-2]"},{"line_number":663,"context_line":"        self.assertEqual(put_call.method, \u0027PUT\u0027)"},{"line_number":664,"context_line":"        self.assertIn(\u0027X-Object-Sysmeta-Version-Id\u0027, put_call.headers)"},{"line_number":665,"context_line":""},{"line_number":666,"context_line":"        prefix_listing_prefix \u003d \u0027/v1/a/ver_cont?format\u003djson\u0026prefix\u003d001o/\u0026\u0027"},{"line_number":667,"context_line":"        self.assertEqual(self.app.calls, ["}],"source_content_type":"text/x-python","patch_set":2,"id":"ffe62b97_e3dfda37","line":664,"updated":"2017-03-28 06:17:11.000000000","message":"It would also be good to confirm/test that the id came back as expected, so we can test that bit of the code is correct, something like:\n\n  self.assertEqual(put_call.headers[\u0027X-Object-Sysmeta-Version-Id\u0027], \u00272\u0027)","commit_id":"818e375ace7c9140f255b0acb3492bd9f3eabf51"}]}
