)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"21c6e9ec2e317662e9bf34891bad98c7a29c90f7","unresolved":true,"context_lines":[{"line_number":13,"context_line":"Now, do the rehashing in the relinker as it completes work. Operators"},{"line_number":14,"context_line":"should already be mindful of the relinker\u0027s I/O usage and are likely"},{"line_number":15,"context_line":"limiting it through some combination of cgroups, ionice, and/or"},{"line_number":16,"context_line":"--objects-per-second."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: Ib5bf426cf38559091917f2d25f4f60183cd16354"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"ddb974f8_6410c3ac","line":16,"updated":"2021-02-11 06:04:49.000000000","message":"Oh good info. We should probably make sure that\u0027s written somewhere other then just the commit message. Maybe _at least_ the release notes but maybe the partpower increase section of the docs as a NOTE.","commit_id":"2fa1f68d6aec1524debee20241b06a25fa612081"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"4524997cc32b055acbf2f53961da7e2895241661","unresolved":true,"context_lines":[{"line_number":34,"context_line":"At t0, prior to relinking, there are"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    N :\u003d \u003creplica count\u003e * 2 ** \u003cold part power\u003e"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"primary partitions throughout the cluster and a negligible number of"},{"line_number":39,"context_line":"handoffs."},{"line_number":40,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"9e953cb0_d5da10c9","line":37,"updated":"2021-02-15 06:35:26.000000000","message":"Love the acsii art!!!","commit_id":"178c5ae456bc7056c6660008cf6d9e100343ef9c"}],"doc/source/ring_partpower.rst":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"2136c7535c7e5e5110a7e3980a6c0e4d545f27ec","unresolved":true,"context_lines":[{"line_number":39,"context_line":"  partition power increase. Replicators are not aware of hard-links, and would"},{"line_number":40,"context_line":"  simply copy the content; this would result in heavy data movement and the"},{"line_number":41,"context_line":"  worst case would be that all data is stored twice."},{"line_number":42,"context_line":"* Due to the fact that each object will now be hard linked from two locations,"},{"line_number":43,"context_line":"  many more inodes will be used - expect around twice the amount. You need to"},{"line_number":44,"context_line":"  check the free inode count *before* increasing the partition power."},{"line_number":45,"context_line":"* Also, object auditors might read each object twice before cleanup removes the"}],"source_content_type":"text/x-rst","patch_set":5,"id":"53cbb8a5_33c16dc9","line":42,"range":{"start_line":42,"start_character":35,"end_line":42,"end_character":58},"updated":"2021-02-12 15:33:17.000000000","message":"off-topic  but there should be a \u0027temporarily\u0027 somewhere in that statement","commit_id":"bd856bc63c1cc09324092742a3a5ad5bca1bf41a"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"70719fb951671fe9ac40242a5fd6e09b0664ece4","unresolved":true,"context_lines":[{"line_number":138,"context_line":"    period (which is by default 1 week). Otherwise objects that have been"},{"line_number":139,"context_line":"    overwritten between step #1 and step #2 and deleted afterwards can\u0027t be"},{"line_number":140,"context_line":"    cleaned up anymore. You may want to increase your ``reclaim_age`` before"},{"line_number":141,"context_line":"    or during relinking."},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"Afterwards it is required to update the rings one last"},{"line_number":144,"context_line":"time to inform servers that all steps to increase the partition power are done,"}],"source_content_type":"text/x-rst","patch_set":5,"id":"15dd3241_0f76436b","line":141,"updated":"2021-02-12 04:36:12.000000000","message":"great tip!","commit_id":"bd856bc63c1cc09324092742a3a5ad5bca1bf41a"}],"swift/cli/relinker.py":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"2136c7535c7e5e5110a7e3980a6c0e4d545f27ec","unresolved":true,"context_lines":[{"line_number":149,"context_line":""},{"line_number":150,"context_line":"    if step in (STEP_RELINK, STEP_CLEANUP):"},{"line_number":151,"context_line":"        states[\"state\"][part] \u003d True"},{"line_number":152,"context_line":"    _, device, _, partition \u003d partition_path.rsplit(\u0027/\u0027, 3)"},{"line_number":153,"context_line":"    partition \u003d int(partition)"},{"line_number":154,"context_line":"    if step \u003d\u003d STEP_CLEANUP:"},{"line_number":155,"context_line":"        # Note that when completing a part-power increase, cleanup only covers"}],"source_content_type":"text/x-python","patch_set":5,"id":"0bce98ed_f776697a","line":152,"range":{"start_line":152,"start_character":52,"end_line":152,"end_character":55},"updated":"2021-02-12 15:33:17.000000000","message":"nit: use os.path.sep\n\nsurprised that there isn\u0027t a utility to split up a path","commit_id":"bd856bc63c1cc09324092742a3a5ad5bca1bf41a"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ba8ac873a00dddc8b434fcb79c7c6b7fc492f119","unresolved":true,"context_lines":[{"line_number":149,"context_line":""},{"line_number":150,"context_line":"    if step in (STEP_RELINK, STEP_CLEANUP):"},{"line_number":151,"context_line":"        states[\"state\"][part] \u003d True"},{"line_number":152,"context_line":"    _, device, _, partition \u003d partition_path.rsplit(\u0027/\u0027, 3)"},{"line_number":153,"context_line":"    partition \u003d int(partition)"},{"line_number":154,"context_line":"    if step \u003d\u003d STEP_CLEANUP:"},{"line_number":155,"context_line":"        # Note that when completing a part-power increase, cleanup only covers"}],"source_content_type":"text/x-python","patch_set":5,"id":"2407b728_1268e149","line":152,"range":{"start_line":152,"start_character":52,"end_line":152,"end_character":55},"in_reply_to":"0bce98ed_f776697a","updated":"2021-02-12 16:56:24.000000000","message":"I\u0027m also surprised!  https://docs.python.org/3/library/os.path.html#os.path.split\n\nBut no one is gunna be trying to run any of this on windows anytime soon and we do a lot of rsplit(\u0027/\u0027) around here...","commit_id":"bd856bc63c1cc09324092742a3a5ad5bca1bf41a"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"23679b6de1967d178c05ff115fa73cbde9779780","unresolved":true,"context_lines":[{"line_number":149,"context_line":""},{"line_number":150,"context_line":"    if step in (STEP_RELINK, STEP_CLEANUP):"},{"line_number":151,"context_line":"        states[\"state\"][part] \u003d True"},{"line_number":152,"context_line":"    _, device, _, partition \u003d partition_path.rsplit(\u0027/\u0027, 3)"},{"line_number":153,"context_line":"    partition \u003d int(partition)"},{"line_number":154,"context_line":"    if step \u003d\u003d STEP_CLEANUP:"},{"line_number":155,"context_line":"        # Note that when completing a part-power increase, cleanup only covers"}],"source_content_type":"text/x-python","patch_set":5,"id":"89ce4bec_64dd5451","line":152,"range":{"start_line":152,"start_character":52,"end_line":152,"end_character":55},"in_reply_to":"2407b728_1268e149","updated":"2021-02-12 22:00:49.000000000","message":"I should make better use of all the calls to os.path.* we\u0027ve already got up above -- will take another stab.","commit_id":"bd856bc63c1cc09324092742a3a5ad5bca1bf41a"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"2136c7535c7e5e5110a7e3980a6c0e4d545f27ec","unresolved":true,"context_lines":[{"line_number":153,"context_line":"    partition \u003d int(partition)"},{"line_number":154,"context_line":"    if step \u003d\u003d STEP_CLEANUP:"},{"line_number":155,"context_line":"        # Note that when completing a part-power increase, cleanup only covers"},{"line_number":156,"context_line":"        # the lower half of partitions..."},{"line_number":157,"context_line":"        diskfile_manager.get_hashes(device, partition, [], policy)"},{"line_number":158,"context_line":"    elif partition \u003e\u003d 2 ** (states[\u0027part_power\u0027] - 1):"},{"line_number":159,"context_line":"        # ... so we need to rehash during relinking if we\u0027re linking into the"}],"source_content_type":"text/x-python","patch_set":5,"id":"2e4b3cd6_dc64a47b","line":156,"range":{"start_line":156,"start_character":10,"end_line":156,"end_character":39},"updated":"2021-02-12 15:33:17.000000000","message":"ok, useful comment. and we don\u0027t want to rehash these until they have been cleaned","commit_id":"bd856bc63c1cc09324092742a3a5ad5bca1bf41a"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"23679b6de1967d178c05ff115fa73cbde9779780","unresolved":true,"context_lines":[{"line_number":153,"context_line":"    partition \u003d int(partition)"},{"line_number":154,"context_line":"    if step \u003d\u003d STEP_CLEANUP:"},{"line_number":155,"context_line":"        # Note that when completing a part-power increase, cleanup only covers"},{"line_number":156,"context_line":"        # the lower half of partitions..."},{"line_number":157,"context_line":"        diskfile_manager.get_hashes(device, partition, [], policy)"},{"line_number":158,"context_line":"    elif partition \u003e\u003d 2 ** (states[\u0027part_power\u0027] - 1):"},{"line_number":159,"context_line":"        # ... so we need to rehash during relinking if we\u0027re linking into the"}],"source_content_type":"text/x-python","patch_set":5,"id":"f2709166_74fddf28","line":156,"range":{"start_line":156,"start_character":10,"end_line":156,"end_character":39},"in_reply_to":"2e4b3cd6_dc64a47b","updated":"2021-02-12 22:00:49.000000000","message":"Yeah, in general we want to put off rehashing until everything\u0027s been cleaned up, since that\u0027s the point at which diskfiles are settled and we\u0027re getting ready for replication again. The trouble is that cleanup doesn\u0027t visit all partitions following an increase. (Though it *will* during a cancel!)","commit_id":"bd856bc63c1cc09324092742a3a5ad5bca1bf41a"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"2136c7535c7e5e5110a7e3980a6c0e4d545f27ec","unresolved":true,"context_lines":[{"line_number":154,"context_line":"    if step \u003d\u003d STEP_CLEANUP:"},{"line_number":155,"context_line":"        # Note that when completing a part-power increase, cleanup only covers"},{"line_number":156,"context_line":"        # the lower half of partitions..."},{"line_number":157,"context_line":"        diskfile_manager.get_hashes(device, partition, [], policy)"},{"line_number":158,"context_line":"    elif partition \u003e\u003d 2 ** (states[\u0027part_power\u0027] - 1):"},{"line_number":159,"context_line":"        # ... so we need to rehash during relinking if we\u0027re linking into the"},{"line_number":160,"context_line":"        # upper (new) half"}],"source_content_type":"text/x-python","patch_set":5,"id":"48a3000e_1fd57777","line":157,"range":{"start_line":157,"start_character":25,"end_line":157,"end_character":35},"updated":"2021-02-12 15:33:17.000000000","message":"(I may be wrong...) this doesn\u0027t do a listdir, so if this is an existing partition that happened to be on same device then will relinked objects get hashed if they added a new suffix? I guess it wouldn\u0027t matter too much, now we\u0027re doing an invalidate_hash on relinking - it\u0027ll eventually be rehashed by replicator.","commit_id":"bd856bc63c1cc09324092742a3a5ad5bca1bf41a"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"23679b6de1967d178c05ff115fa73cbde9779780","unresolved":true,"context_lines":[{"line_number":154,"context_line":"    if step \u003d\u003d STEP_CLEANUP:"},{"line_number":155,"context_line":"        # Note that when completing a part-power increase, cleanup only covers"},{"line_number":156,"context_line":"        # the lower half of partitions..."},{"line_number":157,"context_line":"        diskfile_manager.get_hashes(device, partition, [], policy)"},{"line_number":158,"context_line":"    elif partition \u003e\u003d 2 ** (states[\u0027part_power\u0027] - 1):"},{"line_number":159,"context_line":"        # ... so we need to rehash during relinking if we\u0027re linking into the"},{"line_number":160,"context_line":"        # upper (new) half"}],"source_content_type":"text/x-python","patch_set":5,"id":"df6ae0fe_eff87f18","line":157,"updated":"2021-02-12 22:00:49.000000000","message":"We can do better with this. Inspect the hashes returned to determine whether there\u0027s anything there; if not:\n\n acquire partition lock\n rm hashes.pkl hashes.invalid .lock\n release partition lock\n rmdir \u003cpartition\u003e\n\n(*Don\u0027t* use rmtree, in case something suddenly *does* turn up.)\n\nI\u0027d *love* it if the empty handoffs weren\u0027t even around once relinking\u0027s done.","commit_id":"bd856bc63c1cc09324092742a3a5ad5bca1bf41a"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"23679b6de1967d178c05ff115fa73cbde9779780","unresolved":true,"context_lines":[{"line_number":154,"context_line":"    if step \u003d\u003d STEP_CLEANUP:"},{"line_number":155,"context_line":"        # Note that when completing a part-power increase, cleanup only covers"},{"line_number":156,"context_line":"        # the lower half of partitions..."},{"line_number":157,"context_line":"        diskfile_manager.get_hashes(device, partition, [], policy)"},{"line_number":158,"context_line":"    elif partition \u003e\u003d 2 ** (states[\u0027part_power\u0027] - 1):"},{"line_number":159,"context_line":"        # ... so we need to rehash during relinking if we\u0027re linking into the"},{"line_number":160,"context_line":"        # upper (new) half"}],"source_content_type":"text/x-python","patch_set":5,"id":"2eab13de_8bbead85","line":157,"range":{"start_line":157,"start_character":25,"end_line":157,"end_character":35},"in_reply_to":"48a3000e_1fd57777","updated":"2021-02-12 22:00:49.000000000","message":"Yup, relinked objects would get rehashed here since the relink (and its call to invalidate_hash) happened already.","commit_id":"bd856bc63c1cc09324092742a3a5ad5bca1bf41a"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ba8ac873a00dddc8b434fcb79c7c6b7fc492f119","unresolved":true,"context_lines":[{"line_number":159,"context_line":"        # ... so we need to rehash during relinking if we\u0027re linking into the"},{"line_number":160,"context_line":"        # upper (new) half"},{"line_number":161,"context_line":"        diskfile_manager.get_hashes(device, 2 * partition, [], policy)"},{"line_number":162,"context_line":"        diskfile_manager.get_hashes(device, 2 * partition + 1, [], policy)"},{"line_number":163,"context_line":"    with open(state_tmp_file, \u0027wt\u0027) as f:"},{"line_number":164,"context_line":"        json.dump(states, f)"},{"line_number":165,"context_line":"        os.fsync(f.fileno())"}],"source_content_type":"text/x-python","patch_set":5,"id":"9922e5f8_f7891849","line":162,"updated":"2021-02-12 16:56:24.000000000","message":"it\u0027s a little tricky to keep track of this hook executing in two different contex\n\n - if we\u0027re in \u0027cleanup\u0027 do a rehash of *this* (\"lower\"?) partition\n - if we\u0027re in \u0027relink\u0027 but only if this is an \"upper\" part do a rehash of the ... target parts (!?)\n\nSo if we\u0027re going from 2^2 to 2^3 and find part 4 (i.e. a new upper part) then we hsah... 8 \u0026 9 (those don\u0027t even exist in 2^3)","commit_id":"bd856bc63c1cc09324092742a3a5ad5bca1bf41a"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"a7aed7c5fa8a0297f5818c9cf9e83bf243801891","unresolved":true,"context_lines":[{"line_number":159,"context_line":"        # ... so we need to rehash during relinking if we\u0027re linking into the"},{"line_number":160,"context_line":"        # upper (new) half"},{"line_number":161,"context_line":"        diskfile_manager.get_hashes(device, 2 * partition, [], policy)"},{"line_number":162,"context_line":"        diskfile_manager.get_hashes(device, 2 * partition + 1, [], policy)"},{"line_number":163,"context_line":"    with open(state_tmp_file, \u0027wt\u0027) as f:"},{"line_number":164,"context_line":"        json.dump(states, f)"},{"line_number":165,"context_line":"        os.fsync(f.fileno())"}],"source_content_type":"text/x-python","patch_set":5,"id":"e04e3794_58fed2bb","line":162,"in_reply_to":"9922e5f8_f7891849","updated":"2021-02-12 17:41:28.000000000","message":"if part_power is 2, we\u0027d acctually have \"filtered\" part 4 - besides this \"upper\" is the upper of the *old* part, in 2^2 that\u0027s 2 \u0026 3 - which would reash 4\u00265, and 6\u00267 (which seem fine, 2\u00263 would get rehashed after cleanup)","commit_id":"bd856bc63c1cc09324092742a3a5ad5bca1bf41a"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ba8ac873a00dddc8b434fcb79c7c6b7fc492f119","unresolved":true,"context_lines":[{"line_number":209,"context_line":"           device\u003dNone,"},{"line_number":210,"context_line":"           files_per_second\u003d0):"},{"line_number":211,"context_line":"    mount_check \u003d not skip_mount_check"},{"line_number":212,"context_line":"    conf \u003d {\u0027devices\u0027: devices, \u0027mount_check\u0027: mount_check}"},{"line_number":213,"context_line":"    diskfile_router \u003d diskfile.DiskFileRouter(conf, logger)"},{"line_number":214,"context_line":"    found_policy \u003d False"},{"line_number":215,"context_line":"    relinked \u003d errors \u003d 0"}],"source_content_type":"text/x-python","patch_set":5,"id":"4be9db6b_304aa49e","line":212,"updated":"2021-02-12 16:56:24.000000000","message":"this is a failry anemic config; it\u0027d be nice to get in at least reclaim age.","commit_id":"bd856bc63c1cc09324092742a3a5ad5bca1bf41a"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"23679b6de1967d178c05ff115fa73cbde9779780","unresolved":true,"context_lines":[{"line_number":209,"context_line":"           device\u003dNone,"},{"line_number":210,"context_line":"           files_per_second\u003d0):"},{"line_number":211,"context_line":"    mount_check \u003d not skip_mount_check"},{"line_number":212,"context_line":"    conf \u003d {\u0027devices\u0027: devices, \u0027mount_check\u0027: mount_check}"},{"line_number":213,"context_line":"    diskfile_router \u003d diskfile.DiskFileRouter(conf, logger)"},{"line_number":214,"context_line":"    found_policy \u003d False"},{"line_number":215,"context_line":"    relinked \u003d errors \u003d 0"}],"source_content_type":"text/x-python","patch_set":5,"id":"9e2451f0_a80004f3","line":212,"in_reply_to":"4be9db6b_304aa49e","updated":"2021-02-12 22:00:49.000000000","message":"Mirrored from existing code in cleanup, but you\u0027re right -- will fix.","commit_id":"bd856bc63c1cc09324092742a3a5ad5bca1bf41a"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"2136c7535c7e5e5110a7e3980a6c0e4d545f27ec","unresolved":true,"context_lines":[{"line_number":261,"context_line":"            try:"},{"line_number":262,"context_line":"                diskfile.relink_paths(fname, newfname, check_existing\u003dTrue)"},{"line_number":263,"context_line":"                relinked +\u003d 1"},{"line_number":264,"context_line":"                diskfile.invalidate_hash(newfname.rsplit(\u0027/\u0027, 2)[0])"},{"line_number":265,"context_line":"            except OSError as exc:"},{"line_number":266,"context_line":"                errors +\u003d 1"},{"line_number":267,"context_line":"                logger.warning(\"Relinking %s to %s failed: %s\","}],"source_content_type":"text/x-python","patch_set":5,"id":"83647d8d_b1f53355","line":264,"updated":"2021-02-12 15:33:17.000000000","message":"was this a bug? i.e. if relinking into an existing partition the previously hashes were not invalidated; new partitions just don\u0027t have hashes.pkl yet","commit_id":"bd856bc63c1cc09324092742a3a5ad5bca1bf41a"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"a7aed7c5fa8a0297f5818c9cf9e83bf243801891","unresolved":true,"context_lines":[{"line_number":261,"context_line":"            try:"},{"line_number":262,"context_line":"                diskfile.relink_paths(fname, newfname, check_existing\u003dTrue)"},{"line_number":263,"context_line":"                relinked +\u003d 1"},{"line_number":264,"context_line":"                diskfile.invalidate_hash(newfname.rsplit(\u0027/\u0027, 2)[0])"},{"line_number":265,"context_line":"            except OSError as exc:"},{"line_number":266,"context_line":"                errors +\u003d 1"},{"line_number":267,"context_line":"                logger.warning(\"Relinking %s to %s failed: %s\","}],"source_content_type":"text/x-python","patch_set":5,"id":"cd41fca3_5eb8ee9b","line":264,"in_reply_to":"83647d8d_b1f53355","updated":"2021-02-12 17:41:28.000000000","message":"we could probably conslidate the calls to invalidate if we have multiple hashes in a suffix","commit_id":"bd856bc63c1cc09324092742a3a5ad5bca1bf41a"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"23679b6de1967d178c05ff115fa73cbde9779780","unresolved":true,"context_lines":[{"line_number":261,"context_line":"            try:"},{"line_number":262,"context_line":"                diskfile.relink_paths(fname, newfname, check_existing\u003dTrue)"},{"line_number":263,"context_line":"                relinked +\u003d 1"},{"line_number":264,"context_line":"                diskfile.invalidate_hash(newfname.rsplit(\u0027/\u0027, 2)[0])"},{"line_number":265,"context_line":"            except OSError as exc:"},{"line_number":266,"context_line":"                errors +\u003d 1"},{"line_number":267,"context_line":"                logger.warning(\"Relinking %s to %s failed: %s\","}],"source_content_type":"text/x-python","patch_set":5,"id":"70f7259a_e2ca3943","line":264,"in_reply_to":"cd41fca3_5eb8ee9b","updated":"2021-02-12 22:00:49.000000000","message":"Yeah, previously you could get bad/stale hash data shortly after relinking. Romain pointed out to me how the replicator would eventually get around to rehashing it [0]; this just deals with it more quickly. (The reconstructor apparently *always* rehashes [1], which feels like another bug.)\n\nConsolidating calls seems a little tricky -- you\u0027d want to do it on the *last* diskfile in the suffix in case there was some rougue process that got hashes midway through relinking, but we don\u0027t know when that happens.\n\nI suppose you could accumulate the suffixes touched and invalidate all of them at the end of the partition -- but then, that\u0027s going to be all of them... so I guess we could just remove hashes.pkl before getting hashes... but then, what happens if the node unexpectedly restarts, or the process is otherwise interrupted? And are we OK with responding with bad/stale hashes mid-relink? This seemed safest; consolidate_hashes() is perfectly content to deal with duplicate entries.\n\n[0] https://github.com/openstack/swift/blob/2.26.0/swift/obj/replicator.py#L630-L632\n[1] https://github.com/openstack/swift/blob/2.26.0/swift/obj/reconstructor.py#L930-L931","commit_id":"bd856bc63c1cc09324092742a3a5ad5bca1bf41a"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ba8ac873a00dddc8b434fcb79c7c6b7fc492f119","unresolved":true,"context_lines":[{"line_number":370,"context_line":"                os.remove(fname)"},{"line_number":371,"context_line":"                cleaned_up +\u003d 1"},{"line_number":372,"context_line":"                logger.debug(\"Removed %s\", fname)"},{"line_number":373,"context_line":"                diskfile.invalidate_hash(fname.rsplit(\u0027/\u0027, 2)[0])"},{"line_number":374,"context_line":"            except OSError as exc:"},{"line_number":375,"context_line":"                logger.warning(\u0027Error cleaning up %s: %r\u0027, fname, exc)"},{"line_number":376,"context_line":"                errors +\u003d 1"}],"source_content_type":"text/x-python","patch_set":5,"id":"59637785_15801254","line":373,"updated":"2021-02-12 16:56:24.000000000","message":"more readable as dirname(dirname(fname)) - oh, i guess it follows the other invalidate signature","commit_id":"bd856bc63c1cc09324092742a3a5ad5bca1bf41a"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"4524997cc32b055acbf2f53961da7e2895241661","unresolved":true,"context_lines":[{"line_number":152,"context_line":"    #"},{"line_number":153,"context_line":"    # After relinking, it will be more like"},{"line_number":154,"context_line":"    #   |0                             2N|"},{"line_number":155,"context_line":"    #   |AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPP|"},{"line_number":156,"context_line":"    #"},{"line_number":157,"context_line":"    # We want to hold off on rehashing until after cleanup, since that is the"},{"line_number":158,"context_line":"    # point at which we\u0027ve finished with filesystem manipulations. But there\u0027s"}],"source_content_type":"text/x-python","patch_set":7,"id":"e12954cd_f9107b16","line":155,"updated":"2021-02-15 06:35:26.000000000","message":"Again, love the ascii art. but just to understand this. The letters here are what, devices in the ring or partitions.\n\nThe devives in the ring after increase_part_power is [AABBCC] Ie device A is now responsible for partitions 0 and 1.","commit_id":"178c5ae456bc7056c6660008cf6d9e100343ef9c"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"77c888d3491fec333757e425dc786885b91e6339","unresolved":true,"context_lines":[{"line_number":152,"context_line":"    #"},{"line_number":153,"context_line":"    # After relinking, it will be more like"},{"line_number":154,"context_line":"    #   |0                             2N|"},{"line_number":155,"context_line":"    #   |AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPP|"},{"line_number":156,"context_line":"    #"},{"line_number":157,"context_line":"    # We want to hold off on rehashing until after cleanup, since that is the"},{"line_number":158,"context_line":"    # point at which we\u0027ve finished with filesystem manipulations. But there\u0027s"}],"source_content_type":"text/x-python","patch_set":7,"id":"c3f0f00f_f1bfffeb","line":155,"in_reply_to":"e12954cd_f9107b16","updated":"2021-02-15 06:57:01.000000000","message":"It\u0027s (roughly, kinda sorta) partitions in the old partition space. So A, B, C were partitions 0, 1, 2; after relinking, they\u0027ve been mapped\n\n 0 -\u003e 0, 1\n 1 -\u003e 2, 3\n 2 -\u003e 4, 5\n\netc. Of course, nobody should really be using a part power of 4 outside of a dev env, so I suppose in practice A would really be more like the *block* of partitions 0-4096 or something, but you get the idea.","commit_id":"178c5ae456bc7056c6660008cf6d9e100343ef9c"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"4524997cc32b055acbf2f53961da7e2895241661","unresolved":true,"context_lines":[{"line_number":171,"context_line":"    partition \u003d int(part)"},{"line_number":172,"context_line":"    if step \u003d\u003d STEP_RELINK and partition \u003e\u003d 2 ** (states[\u0027part_power\u0027] - 1):"},{"line_number":173,"context_line":"        for new_part in (2 * partition, 2 * partition + 1):"},{"line_number":174,"context_line":"            diskfile_manager.get_hashes(device, new_part, [], policy)"},{"line_number":175,"context_line":"    elif step \u003d\u003d STEP_CLEANUP:"},{"line_number":176,"context_line":"        hashes \u003d diskfile_manager.get_hashes(device, partition, [], policy)"},{"line_number":177,"context_line":"        # In any reasonably-large cluster, we\u0027d expect all old partitions P"}],"source_content_type":"text/x-python","patch_set":7,"id":"41bba97e_3ca6164e","line":174,"updated":"2021-02-15 06:35:26.000000000","message":"Not sure this makes sense. We only need to visit 2**part_power parts in the relinking phase to relink everything. We even make sure of that in the partition filter for relinking so how can the partition above ever be \u003e 2**part_power?\n\nI guess I can go confirm that by actaully testing. This comment was made by reading the code. Maybe my in brain python interpritor is broken (or I missed something obvous) which is definitely possible :P","commit_id":"178c5ae456bc7056c6660008cf6d9e100343ef9c"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"77c888d3491fec333757e425dc786885b91e6339","unresolved":true,"context_lines":[{"line_number":171,"context_line":"    partition \u003d int(part)"},{"line_number":172,"context_line":"    if step \u003d\u003d STEP_RELINK and partition \u003e\u003d 2 ** (states[\u0027part_power\u0027] - 1):"},{"line_number":173,"context_line":"        for new_part in (2 * partition, 2 * partition + 1):"},{"line_number":174,"context_line":"            diskfile_manager.get_hashes(device, new_part, [], policy)"},{"line_number":175,"context_line":"    elif step \u003d\u003d STEP_CLEANUP:"},{"line_number":176,"context_line":"        hashes \u003d diskfile_manager.get_hashes(device, partition, [], policy)"},{"line_number":177,"context_line":"        # In any reasonably-large cluster, we\u0027d expect all old partitions P"}],"source_content_type":"text/x-python","patch_set":7,"id":"5c94769a_b0515ffd","line":174,"in_reply_to":"41bba97e_3ca6164e","updated":"2021-02-15 06:57:01.000000000","message":"It\u0027s comparing against 2**(part_power -1) -- i.e., we only come in here for the upper half of the old partition space. So this block is for the last part of the comment above; the\n\n and partition \u003e\u003d 2 ** (states[\u0027part_power\u0027] - 1)\n\nsays partition is in that I-P range, so we go rehash the two *new* partitions that won\u0027t be checked during cleanup.","commit_id":"178c5ae456bc7056c6660008cf6d9e100343ef9c"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"46cd065646635a1a92bb8973367946f701ea23a0","unresolved":true,"context_lines":[{"line_number":171,"context_line":"    partition \u003d int(part)"},{"line_number":172,"context_line":"    if step \u003d\u003d STEP_RELINK and partition \u003e\u003d 2 ** (states[\u0027part_power\u0027] - 1):"},{"line_number":173,"context_line":"        for new_part in (2 * partition, 2 * partition + 1):"},{"line_number":174,"context_line":"            diskfile_manager.get_hashes(device, new_part, [], policy)"},{"line_number":175,"context_line":"    elif step \u003d\u003d STEP_CLEANUP:"},{"line_number":176,"context_line":"        hashes \u003d diskfile_manager.get_hashes(device, partition, [], policy)"},{"line_number":177,"context_line":"        # In any reasonably-large cluster, we\u0027d expect all old partitions P"}],"source_content_type":"text/x-python","patch_set":7,"id":"a01c219d_47c64410","line":174,"in_reply_to":"5c94769a_b0515ffd","updated":"2021-02-15 10:05:15.000000000","message":"Oh yes!!! I just clicked, very cleaver! I see it now. For the last 1/2 of the lower value, you can shift into the upper value to rehash!","commit_id":"178c5ae456bc7056c6660008cf6d9e100343ef9c"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"0355d72a3e4446880c90298712f4d1e4bd5489c6","unresolved":true,"context_lines":[{"line_number":172,"context_line":"    if step \u003d\u003d STEP_RELINK and partition \u003e\u003d 2 ** (states[\u0027part_power\u0027] - 1):"},{"line_number":173,"context_line":"        for new_part in (2 * partition, 2 * partition + 1):"},{"line_number":174,"context_line":"            diskfile_manager.get_hashes(device, new_part, [], policy)"},{"line_number":175,"context_line":"    elif step \u003d\u003d STEP_CLEANUP:"},{"line_number":176,"context_line":"        hashes \u003d diskfile_manager.get_hashes(device, partition, [], policy)"},{"line_number":177,"context_line":"        # In any reasonably-large cluster, we\u0027d expect all old partitions P"},{"line_number":178,"context_line":"        # to be empty after cleanup (i.e., it\u0027s unlikely that there\u0027s another"}],"source_content_type":"text/x-python","patch_set":7,"id":"881c5a21_f45fb64a","line":175,"updated":"2021-02-18 17:44:37.000000000","message":"nit: repeating this comment might be useful here:\n\n  the cleanup phase only looks at\n    #   |0                             2N|\n    #   |AABBCCDDEEFFGGHH                |","commit_id":"178c5ae456bc7056c6660008cf6d9e100343ef9c"}],"test/unit/cli/test_relinker.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ba8ac873a00dddc8b434fcb79c7c6b7fc492f119","unresolved":true,"context_lines":[{"line_number":741,"context_line":"        # Once for the cleanup..."},{"line_number":742,"context_line":"        self.assertIn(\u0027Bad fragment index: None\u0027, log_lines[0])"},{"line_number":743,"context_line":"        # ... then again for the rehash"},{"line_number":744,"context_line":"        self.assertIn(\u0027Bad fragment index: None\u0027, log_lines[1])"},{"line_number":745,"context_line":""},{"line_number":746,"context_line":"    def test_cleanup_quarantined(self):"},{"line_number":747,"context_line":"        self._common_test_cleanup()"}],"source_content_type":"text/x-python","patch_set":5,"id":"372b6368_4814124d","line":744,"updated":"2021-02-12 16:56:24.000000000","message":"this is the cloest thing this change adds to assert that this rehash is actually working - and I don\u0027t think this is even rolling over the new invalidate call - not great","commit_id":"bd856bc63c1cc09324092742a3a5ad5bca1bf41a"}]}
