)]}'
{"swift/proxy/controllers/container.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"6a935eb4794182a3c99bf9cfe1057eaae6d3ad6a","unresolved":true,"context_lines":[{"line_number":321,"context_line":"        policy_key \u003d \u0027X-Backend-Storage-Policy-Index\u0027"},{"line_number":322,"context_line":"        if (policy_key not in req.headers"},{"line_number":323,"context_line":"                and policy_key in resp.headers"},{"line_number":324,"context_line":"                and not shard_listing_history):"},{"line_number":325,"context_line":"            # We\u0027re handling the original request to the root container: set"},{"line_number":326,"context_line":"            # the root policy index in the request, unless it is already set,"},{"line_number":327,"context_line":"            # so that shards will return listings for that policy index."}],"source_content_type":"text/x-python","patch_set":1,"id":"17be9de3_76a9b586","line":324,"updated":"2021-08-11 18:19:46.000000000","message":"big advantage of using *this* condition to indicate \"the top-level request to list objects w/i a sharded namespace\" is that works both with root db\u0027s AND internal client requests directly to a sub-sharded .shards_a/c","commit_id":"8815fbcec0e66c5693d806e87d6684d9daa07c57"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"485d09351c7c51117a70f00bf8dd5354184c497c","unresolved":true,"context_lines":[{"line_number":325,"context_line":"            # We\u0027re handling the original request to the root container: set"},{"line_number":326,"context_line":"            # the root policy index in the request, unless it is already set,"},{"line_number":327,"context_line":"            # so that shards will return listings for that policy index."},{"line_number":328,"context_line":"            # TODO: we can probably drop the \u0027policy_key in resp.headers\u0027"},{"line_number":329,"context_line":"            #    condition..."},{"line_number":330,"context_line":"            # Note: we only get here if the root responded with shard"},{"line_number":331,"context_line":"            # ranges, or if the shard ranges were cached and the cached"},{"line_number":332,"context_line":"            # root container info has sharding_state\u003d\u003dsharded; in both"}],"source_content_type":"text/x-python","patch_set":1,"id":"090e12f3_4e3a7c68","line":329,"range":{"start_line":328,"start_character":11,"end_line":329,"end_character":29},"updated":"2021-08-11 13:23:57.000000000","message":"if we agree on the following comment then we can rip out \u0027policy_key in resp.headers\u0027","commit_id":"8815fbcec0e66c5693d806e87d6684d9daa07c57"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"796b6aefca832f1a963ee40ad63538c5dfbc4b33","unresolved":true,"context_lines":[{"line_number":331,"context_line":"            # ranges, or if the shard ranges were cached and the cached"},{"line_number":332,"context_line":"            # root container info has sharding_state\u003d\u003dsharded; in both"},{"line_number":333,"context_line":"            # cases we can assume that the response is populated from a"},{"line_number":334,"context_line":"            # root container server that is new enough to have sent"},{"line_number":335,"context_line":"            # \u0027X-Backend-Storage-Policy-Index\u0027."},{"line_number":336,"context_line":"            req.headers[policy_key] \u003d resp.headers[policy_key]"},{"line_number":337,"context_line":"        shard_listing_history.append((self.account_name, self.container_name))"}],"source_content_type":"text/x-python","patch_set":1,"id":"7d1f3b7c_4b6b44a7","line":334,"range":{"start_line":334,"start_character":44,"end_line":334,"end_character":54},"updated":"2021-08-11 16:55:40.000000000","message":"My reading on the history is that *all* versions of Swift that support sharding (and so would actually *be able* to return shard ranges) will include X-Backend-Storage-Policy-Index in the response. In fact, all versions of Swift *since storage policies were introduced* should send it.\n\nSo yeah, I\u0027d be fine with dropping the\n\n and policy_key in resp.headers","commit_id":"8815fbcec0e66c5693d806e87d6684d9daa07c57"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"acf6d8e94c1cb24d236f3cf62480732f66ca4886","unresolved":true,"context_lines":[{"line_number":331,"context_line":"            # ranges, or if the shard ranges were cached and the cached"},{"line_number":332,"context_line":"            # root container info has sharding_state\u003d\u003dsharded; in both"},{"line_number":333,"context_line":"            # cases we can assume that the response is populated from a"},{"line_number":334,"context_line":"            # root container server that is new enough to have sent"},{"line_number":335,"context_line":"            # \u0027X-Backend-Storage-Policy-Index\u0027."},{"line_number":336,"context_line":"            req.headers[policy_key] \u003d resp.headers[policy_key]"},{"line_number":337,"context_line":"        shard_listing_history.append((self.account_name, self.container_name))"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fc56c5b_5533bf35","line":334,"range":{"start_line":334,"start_character":44,"end_line":334,"end_character":54},"in_reply_to":"7d1f3b7c_4b6b44a7","updated":"2021-08-12 03:41:19.000000000","message":"So long as we now resp can never be some other resp, like a 404 or 500 or something they maynot have the header.. but looking at the GETorHEAD method that call it, it has to have a \u0027X-Backend-Record-Type: shard\u0027 to ever be called, and if it has that header then it should be a proper resp and therefore have a \u0027X-Backend-Storage-Policy-Index\u0027.\n\nI see no harm in keeping it as it\u0027s a getekeeper just in case.. but it looks like it should never happen so I\u0027m happy either way.","commit_id":"8815fbcec0e66c5693d806e87d6684d9daa07c57"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"3b36ada7e59bf7e9dfd9dc452fb21671430ea63c","unresolved":true,"context_lines":[{"line_number":331,"context_line":"            # ranges, or if the shard ranges were cached and the cached"},{"line_number":332,"context_line":"            # root container info has sharding_state\u003d\u003dsharded; in both"},{"line_number":333,"context_line":"            # cases we can assume that the response is populated from a"},{"line_number":334,"context_line":"            # root container server that is new enough to have sent"},{"line_number":335,"context_line":"            # \u0027X-Backend-Storage-Policy-Index\u0027."},{"line_number":336,"context_line":"            req.headers[policy_key] \u003d resp.headers[policy_key]"},{"line_number":337,"context_line":"        shard_listing_history.append((self.account_name, self.container_name))"}],"source_content_type":"text/x-python","patch_set":1,"id":"a65cad03_377c28d0","line":334,"range":{"start_line":334,"start_character":44,"end_line":334,"end_character":54},"in_reply_to":"9fc56c5b_5533bf35","updated":"2021-08-12 09:50:25.000000000","message":"Note to future self: I\u0027m satisfied the the header will always be in resp:\n\n- if the response came from a backend then to have shard ranges it must be a new enough backend to also return a policy index\n\n- if the response was composed from cached value in the proxy, then the presence of cached shard ranges is not sufficient - they may have come from a newer backend than the cached container info. However, this line is pertinent:\n\nhttps://github.com/openstack/swift/blob/e40cf1ec561c78c8a02d40b581bf195939a6450a/swift/proxy/controllers/container.py#L146\n\ni.e. we only fulfil a request from cache if the cached container info has a policy index","commit_id":"8815fbcec0e66c5693d806e87d6684d9daa07c57"}],"test/probe/test_sharder.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"6a935eb4794182a3c99bf9cfe1057eaae6d3ad6a","unresolved":true,"context_lines":[{"line_number":2258,"context_line":"                \u0027GET\u0027,"},{"line_number":2259,"context_line":"                path\u003dself.internal_client.make_path("},{"line_number":2260,"context_line":"                    self.account, self.container_name),"},{"line_number":2261,"context_line":"                headers\u003d{\u0027X-Backend-Storage-Policy-Index\u0027: str(policy_idx)},"},{"line_number":2262,"context_line":"                acceptable_statuses\u003d(2,),"},{"line_number":2263,"context_line":"                params\u003d{\u0027format\u0027: \u0027json\u0027}"},{"line_number":2264,"context_line":"            )"}],"source_content_type":"text/x-python","patch_set":1,"id":"ada6fb7f_e2a9e1db","line":2261,"updated":"2021-08-11 18:19:46.000000000","message":"oh nice!","commit_id":"8815fbcec0e66c5693d806e87d6684d9daa07c57"}],"test/unit/proxy/controllers/test_container.py":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"485d09351c7c51117a70f00bf8dd5354184c497c","unresolved":true,"context_lines":[{"line_number":2096,"context_line":"            captured_hdrs.update(req.headers)"},{"line_number":2097,"context_line":"            return None, shard_resp"},{"line_number":2098,"context_line":""},{"line_number":2099,"context_line":"        # no header in response -\u003e no header added to request"},{"line_number":2100,"context_line":"        captured_hdrs \u003d {}"},{"line_number":2101,"context_line":"        req \u003d Request.blank(\u0027/v1/a/c\u0027, environ\u003d{\u0027REQUEST_METHOD\u0027: \u0027GET\u0027})"},{"line_number":2102,"context_line":"        resp \u003d mock.MagicMock(body\u003dself._stub_shards_dump,"},{"line_number":2103,"context_line":"                              headers\u003dself.root_resp_hdrs,"},{"line_number":2104,"context_line":"                              request\u003dreq)"},{"line_number":2105,"context_line":"        del resp.headers[\u0027X-Backend-Storage-Policy-Index\u0027]"},{"line_number":2106,"context_line":"        with mock.patch(\u0027swift.proxy.controllers.container.\u0027"},{"line_number":2107,"context_line":"                        \u0027ContainerController._get_container_listing\u0027,"},{"line_number":2108,"context_line":"                        mock_get_container_listing):"},{"line_number":2109,"context_line":"            controller_cls, d \u003d self.app.get_controller(req)"},{"line_number":2110,"context_line":"            controller \u003d controller_cls(self.app, **d)"},{"line_number":2111,"context_line":"            controller._get_from_shards(req, resp)"},{"line_number":2112,"context_line":""},{"line_number":2113,"context_line":"        self.assertNotIn(\u0027X-Backend-Storage-Policy-Index\u0027, captured_hdrs)"},{"line_number":2114,"context_line":""},{"line_number":2115,"context_line":"        # header in response -\u003e header added to request"}],"source_content_type":"text/x-python","patch_set":1,"id":"36cd74a5_c5cac441","line":2112,"range":{"start_line":2099,"start_character":1,"end_line":2112,"end_character":0},"updated":"2021-08-11 13:23:57.000000000","message":"this will need to be ripped out if the \u0027policy_key in resp.headers\u0027 condition is not included","commit_id":"8815fbcec0e66c5693d806e87d6684d9daa07c57"}]}
