)]}'
{"test/unit/container/test_sharder.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"7fcc9e6e0ed5565a22063b6bc469682c5b5a6fb6","unresolved":true,"context_lines":[{"line_number":41,"context_line":"from swift.container import replicator"},{"line_number":42,"context_line":"from swift.container.backend import ContainerBroker, UNSHARDED, SHARDING, \\"},{"line_number":43,"context_line":"    SHARDED, DATADIR"},{"line_number":44,"context_line":"from swift.container.reconciler import cmp_policy_info, incorrect_policy_index"},{"line_number":45,"context_line":"from swift.container.server import gen_resp_headers"},{"line_number":46,"context_line":"from swift.container.sharder import ContainerSharder, sharding_enabled, \\"},{"line_number":47,"context_line":"    CleavingContext, DEFAULT_SHARDER_CONF, finalize_shrinking, \\"}],"source_content_type":"text/x-python","patch_set":1,"id":"e7dab23a_5ee79d62","line":44,"updated":"2021-08-20 18:40:17.000000000","message":"love that cmp_policy_info 👍","commit_id":"0d9e43f1693536346a5eeb409246fde3e4ce4090"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"7fcc9e6e0ed5565a22063b6bc469682c5b5a6fb6","unresolved":true,"context_lines":[{"line_number":5815,"context_line":""},{"line_number":5816,"context_line":"        self.assertEqual("},{"line_number":5817,"context_line":"            [1, 2, 3],"},{"line_number":5818,"context_line":"            [broker.storage_policy_index for broker in shard_brokers])"},{"line_number":5819,"context_line":""},{"line_number":5820,"context_line":"        # expect the sorted shards to produce the same winning policy as the"},{"line_number":5821,"context_line":"        # root"}],"source_content_type":"text/x-python","patch_set":1,"id":"039cb457_67745a17","line":5818,"updated":"2021-08-20 18:40:17.000000000","message":"so at this point we\u0027re way off the rails - it\u0027s not clear to me how many asserts/scenarios after this are relevant\n\nin my follow up I dropped most of this test:\n\nhttps://review.opendev.org/c/openstack/swift/+/805450\n\nwe might need Al to show us where it\u0027s still wrong","commit_id":"0d9e43f1693536346a5eeb409246fde3e4ce4090"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"1dc130a0f355b3af7984df9cf261e12e6a0c9339","unresolved":true,"context_lines":[{"line_number":5793,"context_line":"            sorted_root_infos[2], sorted_root_infos[0]))"},{"line_number":5794,"context_line":""},{"line_number":5795,"context_line":"        # the *last recreated* replica wins, not the most recently put..."},{"line_number":5796,"context_line":"        self.assertEqual(2, winning_root_policy)"},{"line_number":5797,"context_line":""},{"line_number":5798,"context_line":"        # each shard replica gets audit reposnse from different root, but in"},{"line_number":5799,"context_line":"        # order such that the last shard replica to audit gets the most"}],"source_content_type":"text/x-python","patch_set":3,"id":"0a98e5cf_b6fd0a67","line":5796,"updated":"2021-08-26 03:04:37.000000000","message":"I think the biggest problem here is why is the *last recreated* the correct choice here, I would have thought, like with the rest of Swift the winner should be the newest. IE what we did with the shard SPI change.\n\nSo what do we want to fix here? Make the shards behave like the reconciler in this case.. which I don\u0027t think is the right behaviour, unless I\u0027m missing something. Or fix the reconciler in the case above to pick the most recently PUT.\n\nmaybe it\u0027s time to rework cmp_policy_info() as it\u0027s not quite working. For example it first checks to see if the local or remote is deleted, and if one of them is, the the other one which isn\u0027t wins (or it does a last mod check). Then does the same for recreated.. if one has been recreated it wins. Which means we never actaully ever check for both not deleted and who is newer. Shouldn\u0027t the be a more important check in this usecase.\n\nObviously getting into this use case isn\u0027t easy.","commit_id":"0084c753a4410b77d4ab7ed3316a90771f571def"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"26631abf19c91dbb1d181058fb397d089e8a0d84","unresolved":true,"context_lines":[{"line_number":5793,"context_line":"            sorted_root_infos[2], sorted_root_infos[0]))"},{"line_number":5794,"context_line":""},{"line_number":5795,"context_line":"        # the *last recreated* replica wins, not the most recently put..."},{"line_number":5796,"context_line":"        self.assertEqual(2, winning_root_policy)"},{"line_number":5797,"context_line":""},{"line_number":5798,"context_line":"        # each shard replica gets audit reposnse from different root, but in"},{"line_number":5799,"context_line":"        # order such that the last shard replica to audit gets the most"}],"source_content_type":"text/x-python","patch_set":3,"id":"a1a9dca9_88056807","line":5796,"in_reply_to":"0a98e5cf_b6fd0a67","updated":"2021-08-26 08:56:39.000000000","message":"I can\u0027t claim to have authoritative history on this, but IIUC the reasoning is that a policy can only be changed when a container is created, or recreated i.e. previously deleted. So in single-brain scenarios, the last recreated trumps the last created.\n\nThe last line of cmp_policy_index does cover both never being deleted:\n\n  return cmp(info[\u0027status_changed_at\u0027], remote_info[\u0027status_changed_at\u0027])","commit_id":"0084c753a4410b77d4ab7ed3316a90771f571def"}]}
