)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"40d498f2afb354fc57c2d37810e50aaa720956e9","unresolved":true,"context_lines":[{"line_number":9,"context_line":"We previously ensured that all sharder logs include the DB path"},{"line_number":10,"context_line":"and the container path. But there\u0027s places where the sharder"},{"line_number":11,"context_line":"inherits replicator code and the logs have not been treated in"},{"line_number":12,"context_line":"this way. It would be great to do the same consistently in"},{"line_number":13,"context_line":"replicator logging"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I289d3e9b6fe14159925786732ad748acd0459812"},{"line_number":16,"context_line":"Signed-off-by: ashnair \u003cashnair@nvidia.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"7589a1d2_69800a46","line":13,"range":{"start_line":12,"start_character":31,"end_line":13,"end_character":18},"updated":"2025-08-07 22:25:46.000000000","message":"We should probably be updating `swift/account/replicator.py` and `swift/container/replicator.py`, too, then. We\u0027ve got [places like `_sync_shard_ranges` that would benefit](https://github.com/openstack/swift/blob/2.35.0/swift/container/replicator.py#L130-L132) from also getting the container name.\n\n```\ngrep -n \u0027logger.\\(debug\\|info\\|warning\\|error\\|exception\\)\u0027 \\\n  swift/[ac]*/*replicator.py swift/container/sharder.py\n```\nmight help, but there\u0027s a lot of false-positives.","commit_id":"1a2186ac105c44a8d31f06f1ed96b976912c3b72"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"875e1a38455dd65abd2f2109d74e1f4b4241415d","unresolved":true,"context_lines":[{"line_number":9,"context_line":"We previously ensured that all sharder logs include the DB path"},{"line_number":10,"context_line":"and the container path. But there\u0027s places where the sharder"},{"line_number":11,"context_line":"inherits replicator code and the logs have not been treated in"},{"line_number":12,"context_line":"this way. It would be great to do the same consistently in"},{"line_number":13,"context_line":"replicator logging"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I289d3e9b6fe14159925786732ad748acd0459812"},{"line_number":16,"context_line":"Signed-off-by: ashnair \u003cashnair@nvidia.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"c703d862_97fadb07","line":13,"range":{"start_line":12,"start_character":31,"end_line":13,"end_character":18},"in_reply_to":"7589a1d2_69800a46","updated":"2025-08-08 20:07:09.000000000","message":"FWIW I would assume that Tim is suggesting account/replicator knowing full well that \"we should do that too\" could be true, and helpful and also scope creep\n\nHowever there is TON of logging in `container/replicator` *specifically* related to shard range replication that it seems like a big miss to not update.  However we could consider doing this a a \"base prefactor\" and then fixing `container/replicator` in a follow-up.\n\nAgain a commit message that highlights what is out of scope of this change could help make it clear to reviewers what we\u0027re trying to accomplish (and maybe missed?) vs what we\u0027re NOT trying to accomplish (and should be considered out-of-scope)","commit_id":"1a2186ac105c44a8d31f06f1ed96b976912c3b72"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"5524a4d30e1fcea91c4caf147b9afaa107c40cf8","unresolved":true,"context_lines":[{"line_number":9,"context_line":"We previously ensured that all sharder logs include the DB path"},{"line_number":10,"context_line":"and the container path. But there\u0027s places where the sharder"},{"line_number":11,"context_line":"inherits replicator code and the logs have not been treated in"},{"line_number":12,"context_line":"this way. It would be great to do the same consistently in"},{"line_number":13,"context_line":"replicator logging"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I289d3e9b6fe14159925786732ad748acd0459812"},{"line_number":16,"context_line":"Signed-off-by: ashnair \u003cashnair@nvidia.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"cc4a3419_327ed2be","line":13,"range":{"start_line":12,"start_character":31,"end_line":13,"end_character":18},"in_reply_to":"7589a1d2_69800a46","updated":"2025-08-08 21:02:03.000000000","message":"container-replicator, account-replicator is currently out of scope for this change. We will have a follow-up change for the container-replicator","commit_id":"1a2186ac105c44a8d31f06f1ed96b976912c3b72"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ee99bf437df4fe26947fe314236a9cc1d9935536","unresolved":true,"context_lines":[{"line_number":9,"context_line":"We previously ensured that all sharder logs include the DB path"},{"line_number":10,"context_line":"and the container path. But there\u0027s places where the sharder"},{"line_number":11,"context_line":"inherits replicator code and the logs have not been treated in"},{"line_number":12,"context_line":"this way. It would be great to do the same consistently in"},{"line_number":13,"context_line":"replicator logging"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I289d3e9b6fe14159925786732ad748acd0459812"},{"line_number":16,"context_line":"Signed-off-by: ashnair \u003cashnair@nvidia.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"1558a38a_fe074b74","line":13,"range":{"start_line":12,"start_character":31,"end_line":13,"end_character":18},"in_reply_to":"cc4a3419_327ed2be","updated":"2025-08-11 15:58:26.000000000","message":"\u003e We will have a follow-up change for the container-replicator\n\nYou might try to make that more clear in the commit.  Something like:\n\nFuture work\n  * audit container.replicator module logging\n  * audit account.replicator module logging","commit_id":"1a2186ac105c44a8d31f06f1ed96b976912c3b72"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"5a5835d9ec63412e0296f3eda3e67a216e9eb933","unresolved":false,"context_lines":[{"line_number":9,"context_line":"We previously ensured that all sharder logs include the DB path"},{"line_number":10,"context_line":"and the container path. But there\u0027s places where the sharder"},{"line_number":11,"context_line":"inherits replicator code and the logs have not been treated in"},{"line_number":12,"context_line":"this way. It would be great to do the same consistently in"},{"line_number":13,"context_line":"replicator logging"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I289d3e9b6fe14159925786732ad748acd0459812"},{"line_number":16,"context_line":"Signed-off-by: ashnair \u003cashnair@nvidia.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"ba9cfda4_956831a2","line":13,"range":{"start_line":12,"start_character":31,"end_line":13,"end_character":18},"in_reply_to":"cc4a3419_327ed2be","updated":"2025-08-11 17:15:24.000000000","message":"Acknowledged","commit_id":"1a2186ac105c44a8d31f06f1ed96b976912c3b72"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"875e1a38455dd65abd2f2109d74e1f4b4241415d","unresolved":true,"context_lines":[{"line_number":9,"context_line":"We previously ensured that all sharder logs include the DB path"},{"line_number":10,"context_line":"and the container path. But there\u0027s places where the sharder"},{"line_number":11,"context_line":"inherits replicator code and the logs have not been treated in"},{"line_number":12,"context_line":"this way. It would be great to do the same consistently in"},{"line_number":13,"context_line":"replicator logging"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I289d3e9b6fe14159925786732ad748acd0459812"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"3e714372_b85ce97e","line":12,"updated":"2025-08-08 20:07:09.000000000","message":"\u003e there\u0027s places where the sharder [...] logs have NOT been treated in this way\n\nthis seems to be describing a problem more than what is improved in this patch; consider rewording to describe:\n\n1) what this patch does (via bullets?)\n2) what this patch does NOT (i.e. reserved for future-work/further-imrpovement)","commit_id":"f33c4bb32009261c2e3205a4d8ba495e19da13a9"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"5a5835d9ec63412e0296f3eda3e67a216e9eb933","unresolved":false,"context_lines":[{"line_number":9,"context_line":"We previously ensured that all sharder logs include the DB path"},{"line_number":10,"context_line":"and the container path. But there\u0027s places where the sharder"},{"line_number":11,"context_line":"inherits replicator code and the logs have not been treated in"},{"line_number":12,"context_line":"this way. It would be great to do the same consistently in"},{"line_number":13,"context_line":"replicator logging"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I289d3e9b6fe14159925786732ad748acd0459812"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"53471460_187a22a0","line":12,"in_reply_to":"3e714372_b85ce97e","updated":"2025-08-11 17:15:24.000000000","message":"Acknowledged","commit_id":"f33c4bb32009261c2e3205a4d8ba495e19da13a9"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ee99bf437df4fe26947fe314236a9cc1d9935536","unresolved":false,"context_lines":[{"line_number":9,"context_line":"We previously ensured that all sharder logs include the DB path"},{"line_number":10,"context_line":"and the container path. But there\u0027s places where the sharder"},{"line_number":11,"context_line":"inherits replicator code and the logs have not been treated in"},{"line_number":12,"context_line":"this way. It would be great to do the same consistently in"},{"line_number":13,"context_line":"replicator logging"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I289d3e9b6fe14159925786732ad748acd0459812"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"10fec588_5e9f5f46","line":12,"in_reply_to":"3e714372_b85ce97e","updated":"2025-08-11 15:58:26.000000000","message":"Done","commit_id":"f33c4bb32009261c2e3205a4d8ba495e19da13a9"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"53a65637ece9d6a83b24aabf6d955dd08c02e43a","unresolved":true,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"db-replicator: include container name in logs, not just db path"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"We previously ensured that all sharder logs included the DB file"},{"line_number":10,"context_line":"path and the container path. We moved logging changes from container"},{"line_number":11,"context_line":"sharder to the parent db-replicator logging. It would be great to do"},{"line_number":12,"context_line":"this consistently across db-replicator logging"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"47d6337c_efe26fe9","line":9,"range":{"start_line":9,"start_character":14,"end_line":9,"end_character":21},"updated":"2025-08-11 09:22:58.000000000","message":"In fact, I previously *failed* to ensure that all sharder logs  were consistent because I missed the ones in ContainerReplicator. I think I can only claim to have made the logs in *sharder.py* consistent :/","commit_id":"c5b89dd4f6090a829d99b27a8f7d99fe06250845"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"53a65637ece9d6a83b24aabf6d955dd08c02e43a","unresolved":true,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"db-replicator: include container name in logs, not just db path"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"We previously ensured that all sharder logs included the DB file"},{"line_number":10,"context_line":"path and the container path. We moved logging changes from container"},{"line_number":11,"context_line":"sharder to the parent db-replicator logging. It would be great to do"},{"line_number":12,"context_line":"this consistently across db-replicator logging"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"47405c75_924b818a","line":9,"range":{"start_line":9,"start_character":3,"end_line":9,"end_character":21},"updated":"2025-08-11 09:22:58.000000000","message":"could you please include a reference to the previous change\n\n``Related-Change: I7d2fe064175f002055054a72f348b87dc396772b``\n\nAlso, it wouldn\u0027t hurt to reproduce the UpgradeImpact statement from that previous change in this commit message.","commit_id":"c5b89dd4f6090a829d99b27a8f7d99fe06250845"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"64e8eb771ee3a517bd62cf0ccea313d66f7bdd56","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"db-replicator: include container name in logs, not just db path"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"We previously ensured that all sharder logs included the DB file"},{"line_number":10,"context_line":"path and the container path. We moved logging changes from container"},{"line_number":11,"context_line":"sharder to the parent db-replicator logging. It would be great to do"},{"line_number":12,"context_line":"this consistently across db-replicator logging"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"9dd74a5c_15a4bc55","line":9,"range":{"start_line":9,"start_character":3,"end_line":9,"end_character":21},"in_reply_to":"47405c75_924b818a","updated":"2025-08-13 21:23:06.000000000","message":"Acknowledged","commit_id":"c5b89dd4f6090a829d99b27a8f7d99fe06250845"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ee99bf437df4fe26947fe314236a9cc1d9935536","unresolved":true,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"db-replicator: include container name in logs, not just db path"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"We previously ensured that all sharder logs included the DB file"},{"line_number":10,"context_line":"path and the container path. We moved logging changes from container"},{"line_number":11,"context_line":"sharder to the parent db-replicator logging. It would be great to do"},{"line_number":12,"context_line":"this consistently across db-replicator logging"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"6c80dccc_bc21d405","line":9,"range":{"start_line":9,"start_character":14,"end_line":9,"end_character":21},"in_reply_to":"47d6337c_efe26fe9","updated":"2025-08-11 15:58:26.000000000","message":"I think this commit message is trying to consistently refer to python modules as opposed to consistency engine services.\n\nI think it would only help clarity to explicitly state \"container.sharder module\" and \"container.replicator module\" and \"common.db_replicator module\" if that\u0027s what is intended vs \"container-sharder service\" or \"container-replicator service\"","commit_id":"c5b89dd4f6090a829d99b27a8f7d99fe06250845"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"7a6d0ddede1239b201049a58055303f1c527ddcc","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"db-replicator: include container name in logs, not just db path"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"We previously ensured that all sharder logs included the DB file"},{"line_number":10,"context_line":"path and the container path. We moved logging changes from container"},{"line_number":11,"context_line":"sharder to the parent db-replicator logging. It would be great to do"},{"line_number":12,"context_line":"this consistently across db-replicator logging"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"aecf3fef_384a3592","line":9,"range":{"start_line":9,"start_character":14,"end_line":9,"end_character":21},"in_reply_to":"6c80dccc_bc21d405","updated":"2025-08-14 08:41:31.000000000","message":"Done","commit_id":"c5b89dd4f6090a829d99b27a8f7d99fe06250845"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"53a65637ece9d6a83b24aabf6d955dd08c02e43a","unresolved":true,"context_lines":[{"line_number":7,"context_line":"db-replicator: include container name in logs, not just db path"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"We previously ensured that all sharder logs included the DB file"},{"line_number":10,"context_line":"path and the container path. We moved logging changes from container"},{"line_number":11,"context_line":"sharder to the parent db-replicator logging. It would be great to do"},{"line_number":12,"context_line":"this consistently across db-replicator logging"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"- this change addresses moving container sharding logging to"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"86ed0f9a_65dd7ea4","line":11,"range":{"start_line":10,"start_character":29,"end_line":11,"end_character":43},"updated":"2025-08-11 09:22:58.000000000","message":"I don\u0027t think this is true. In the previous patch I made no changes to the parent db-replicator logging. That\u0027s what this patch is doing.","commit_id":"c5b89dd4f6090a829d99b27a8f7d99fe06250845"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ee99bf437df4fe26947fe314236a9cc1d9935536","unresolved":true,"context_lines":[{"line_number":7,"context_line":"db-replicator: include container name in logs, not just db path"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"We previously ensured that all sharder logs included the DB file"},{"line_number":10,"context_line":"path and the container path. We moved logging changes from container"},{"line_number":11,"context_line":"sharder to the parent db-replicator logging. It would be great to do"},{"line_number":12,"context_line":"this consistently across db-replicator logging"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"- this change addresses moving container sharding logging to"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"ba57bd56_6964c5cc","line":11,"range":{"start_line":10,"start_character":29,"end_line":11,"end_character":43},"in_reply_to":"86ed0f9a_65dd7ea4","updated":"2025-08-11 15:58:26.000000000","message":"s/moved/move/\n\nI think this paragraph is mixing tenses - it would be better to separate:\n\nTitle\n\nContext (previous reference work)\n\nScope (what this change does, why it does only that)\n\nFuture-Work (additional work that is necessary/planned)","commit_id":"c5b89dd4f6090a829d99b27a8f7d99fe06250845"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"a98db65fbf3bf9a8395253a96c00e099a914b4e4","unresolved":false,"context_lines":[{"line_number":7,"context_line":"db-replicator: include container name in logs, not just db path"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"We previously ensured that all sharder logs included the DB file"},{"line_number":10,"context_line":"path and the container path. We moved logging changes from container"},{"line_number":11,"context_line":"sharder to the parent db-replicator logging. It would be great to do"},{"line_number":12,"context_line":"this consistently across db-replicator logging"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"- this change addresses moving container sharding logging to"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"911d85d8_de2e9858","line":11,"range":{"start_line":10,"start_character":29,"end_line":11,"end_character":43},"in_reply_to":"ba57bd56_6964c5cc","updated":"2025-08-13 20:33:46.000000000","message":"Acknowledged","commit_id":"c5b89dd4f6090a829d99b27a8f7d99fe06250845"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"53a65637ece9d6a83b24aabf6d955dd08c02e43a","unresolved":true,"context_lines":[{"line_number":12,"context_line":"this consistently across db-replicator logging"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"- this change addresses moving container sharding logging to"},{"line_number":15,"context_line":"its parent db-replicator logging and modifies the dependent"},{"line_number":16,"context_line":"unit-tests that have assertions. It also improves db-replicator"},{"line_number":17,"context_line":"logging by including DB file path and container paths"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"- this change doesn\u0027t address implementing the aformentioned"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"2bf48dba_827a2bf0","line":16,"range":{"start_line":15,"start_character":33,"end_line":16,"end_character":31},"updated":"2025-08-11 09:22:58.000000000","message":"The existing unit tests shouldn\u0027t need any modifications. I think this statement applies *after* the next sentence:\n\n```\nIt also improves db-replicator\nlogging by including DB file path and container paths and modifies the dependent\nunit-tests that have assertions.\n```","commit_id":"c5b89dd4f6090a829d99b27a8f7d99fe06250845"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"a98db65fbf3bf9a8395253a96c00e099a914b4e4","unresolved":false,"context_lines":[{"line_number":12,"context_line":"this consistently across db-replicator logging"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"- this change addresses moving container sharding logging to"},{"line_number":15,"context_line":"its parent db-replicator logging and modifies the dependent"},{"line_number":16,"context_line":"unit-tests that have assertions. It also improves db-replicator"},{"line_number":17,"context_line":"logging by including DB file path and container paths"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"- this change doesn\u0027t address implementing the aformentioned"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"a7c874ef_f03dcbf0","line":16,"range":{"start_line":15,"start_character":33,"end_line":16,"end_character":31},"in_reply_to":"2bf48dba_827a2bf0","updated":"2025-08-13 20:33:46.000000000","message":"Acknowledged","commit_id":"c5b89dd4f6090a829d99b27a8f7d99fe06250845"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"53a65637ece9d6a83b24aabf6d955dd08c02e43a","unresolved":true,"context_lines":[{"line_number":17,"context_line":"logging by including DB file path and container paths"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"- this change doesn\u0027t address implementing the aformentioned"},{"line_number":20,"context_line":"logging modifications to container replicator"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"Change-Id: I289d3e9b6fe14159925786732ad748acd0459812"},{"line_number":23,"context_line":"Signed-off-by: ashnair \u003cashnair@nvidia.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"e495eaac_05dc7be0","line":20,"updated":"2025-08-11 09:22:58.000000000","message":"why not? to my mind, the log messages that would most  benefit from harmonisation with the sharder are the sharding related messages e.g. the warnings in ``ContainerReplicator._choose_replication_mode``\n\n...more so than debug level messages that this patch changes. (The debug level changes are great, I just question why the scope of this patch doesn\u0027t cover the original motivation which I understood to be to make all *sharding* logging consistent).","commit_id":"c5b89dd4f6090a829d99b27a8f7d99fe06250845"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"a98db65fbf3bf9a8395253a96c00e099a914b4e4","unresolved":false,"context_lines":[{"line_number":17,"context_line":"logging by including DB file path and container paths"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"- this change doesn\u0027t address implementing the aformentioned"},{"line_number":20,"context_line":"logging modifications to container replicator"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"Change-Id: I289d3e9b6fe14159925786732ad748acd0459812"},{"line_number":23,"context_line":"Signed-off-by: ashnair \u003cashnair@nvidia.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"5bd6b958_c9b2103e","line":20,"in_reply_to":"11d7b758_362b4cd2","updated":"2025-08-13 20:33:46.000000000","message":"Acknowledged","commit_id":"c5b89dd4f6090a829d99b27a8f7d99fe06250845"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ee99bf437df4fe26947fe314236a9cc1d9935536","unresolved":true,"context_lines":[{"line_number":17,"context_line":"logging by including DB file path and container paths"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"- this change doesn\u0027t address implementing the aformentioned"},{"line_number":20,"context_line":"logging modifications to container replicator"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"Change-Id: I289d3e9b6fe14159925786732ad748acd0459812"},{"line_number":23,"context_line":"Signed-off-by: ashnair \u003cashnair@nvidia.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"11d7b758_362b4cd2","line":20,"in_reply_to":"e495eaac_05dc7be0","updated":"2025-08-11 15:58:26.000000000","message":"\u003e why not?\n\nIIUC this was just a scoping choice, I believe the commit message intended to imply that would be follow-on work.  No reason we can\u0027t audit all three modules in one change - I think the limited scope was just trying to \"bank the win\"","commit_id":"c5b89dd4f6090a829d99b27a8f7d99fe06250845"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"7a6d0ddede1239b201049a58055303f1c527ddcc","unresolved":true,"context_lines":[{"line_number":31,"context_line":"Why not (deferred work)"},{"line_number":32,"context_line":"-----------------------"},{"line_number":33,"context_line":"This change intentionally limits scope to the common.db_replicator"},{"line_number":34,"context_line":"module to “bank the win.” A follow-up will audit sharding-related"},{"line_number":35,"context_line":"messages in the container.replicator module (e.g _choose_replication_mode"},{"line_number":36,"context_line":"warnings) and bring them in line with the container.sharder"},{"line_number":37,"context_line":"module’s style."},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"No functional changes to replication behavior; this is"},{"line_number":40,"context_line":"logging/robustness and test updates only."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":15,"id":"acfcd08d_121844f2","line":37,"range":{"start_line":34,"start_character":26,"end_line":37,"end_character":15},"updated":"2025-08-14 08:41:31.000000000","message":"Re: \"A follow-up will\"\n\nOpinions may vary on this, but I\u0027d avoid forward-looking promises in commit messages [*], because too often they never happen.\n\nThe rest of the sentence is great: it\u0027s helpful to point out and justify the limited scope of this patch, and to describe work that still needs to be done, but you can\u0027t promise that it *will* be done. The risk is that future-someone spends time trawling through the gerrit/git history trying to find that follow-up patch (that never merged).\n\nPerhaps re-word as:\n```\nFurther work is needed to audit sharding-related\nmessages in the container.replicator module (e.g _choose_replication_mode\nwarnings) and bring them in line with the container.sharder\nmodule’s style.\n```\n\n[*] of course there are always exception to rules...Sometimes we have a small chain of patches that we consciously plan to merge simultaneously, when it may be ok to forward reference within that chain. I think I\u0027ve even seen a forward reference specifically cite a Related-Change gerrit id!","commit_id":"048fd2fb8b7475e143246f6cfe0d51c78994382f"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"aaba727c5ca79ba9f4990f48cd9574fd56a40e27","unresolved":false,"context_lines":[{"line_number":31,"context_line":"Why not (deferred work)"},{"line_number":32,"context_line":"-----------------------"},{"line_number":33,"context_line":"This change intentionally limits scope to the common.db_replicator"},{"line_number":34,"context_line":"module to “bank the win.” A follow-up will audit sharding-related"},{"line_number":35,"context_line":"messages in the container.replicator module (e.g _choose_replication_mode"},{"line_number":36,"context_line":"warnings) and bring them in line with the container.sharder"},{"line_number":37,"context_line":"module’s style."},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"No functional changes to replication behavior; this is"},{"line_number":40,"context_line":"logging/robustness and test updates only."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":15,"id":"c4c3d2e8_9d0e7aed","line":37,"range":{"start_line":34,"start_character":26,"end_line":37,"end_character":15},"in_reply_to":"acfcd08d_121844f2","updated":"2025-08-21 01:13:49.000000000","message":"Done","commit_id":"048fd2fb8b7475e143246f6cfe0d51c78994382f"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"23fe7c793eaaff27ab9346ac8366684bc051aad2","unresolved":true,"context_lines":[{"line_number":28,"context_line":"quarantine tests pass the same db_path into _replicate_object()"},{"line_number":29,"context_line":"and assert the quarantined dirname accordingly."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"Further work"},{"line_number":32,"context_line":"------------"},{"line_number":33,"context_line":"Further work is needed to audit sharding-related messages in the"},{"line_number":34,"context_line":"container.replicator module (e.g., _choose_replication_mode"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":22,"id":"efd2d470_22f3f6c9","line":31,"updated":"2025-08-25 16:22:47.000000000","message":"This thing\u0027s starting to read like a dissertation or something! Am I right to assume a decent bit of it\u0027s LLM-generated, at least? If not, I\u0027m so sorry!","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"52ca9c375a1e4bab812dff27396c9be37b08b0b4","unresolved":false,"context_lines":[{"line_number":28,"context_line":"quarantine tests pass the same db_path into _replicate_object()"},{"line_number":29,"context_line":"and assert the quarantined dirname accordingly."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"Further work"},{"line_number":32,"context_line":"------------"},{"line_number":33,"context_line":"Further work is needed to audit sharding-related messages in the"},{"line_number":34,"context_line":"container.replicator module (e.g., _choose_replication_mode"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":22,"id":"85a68498_22c7c3ec","line":31,"in_reply_to":"88a748ef_2ba9be04","updated":"2025-09-25 17:49:52.000000000","message":"Done","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"0c1e51d034d9c1401e9e1b67fbb07d9dfb925ee4","unresolved":true,"context_lines":[{"line_number":28,"context_line":"quarantine tests pass the same db_path into _replicate_object()"},{"line_number":29,"context_line":"and assert the quarantined dirname accordingly."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"Further work"},{"line_number":32,"context_line":"------------"},{"line_number":33,"context_line":"Further work is needed to audit sharding-related messages in the"},{"line_number":34,"context_line":"container.replicator module (e.g., _choose_replication_mode"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":22,"id":"88a748ef_2ba9be04","line":31,"in_reply_to":"efd2d470_22f3f6c9","updated":"2025-08-26 16:44:10.000000000","message":"Yes, it is AI-generated!","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4627d5e2d929b3d11a7df8574ddace4541f3eba8","unresolved":true,"context_lines":[{"line_number":15,"context_line":"Scope of this change"},{"line_number":16,"context_line":"--------------------"},{"line_number":17,"context_line":"- Update common.db_replicator, container.replicator log formatting so messages include both the container path (account/container) and the"},{"line_number":18,"context_line":"DB file path."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"- In _replicate_object(), predeclare broker \u003d None and handle"},{"line_number":21,"context_line":"failures to instantiate the broker without raising NameError."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":35,"id":"9ca2e193_ce955a8f","line":18,"updated":"2025-09-26 18:02:47.000000000","message":"the line wrapping here is messed up.","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"69538febbf5e32cff6f528440ff0fd543b9a85f1","unresolved":false,"context_lines":[{"line_number":15,"context_line":"Scope of this change"},{"line_number":16,"context_line":"--------------------"},{"line_number":17,"context_line":"- Update common.db_replicator, container.replicator log formatting so messages include both the container path (account/container) and the"},{"line_number":18,"context_line":"DB file path."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"- In _replicate_object(), predeclare broker \u003d None and handle"},{"line_number":21,"context_line":"failures to instantiate the broker without raising NameError."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":35,"id":"156da4cc_ec8f2f85","line":18,"in_reply_to":"9ca2e193_ce955a8f","updated":"2025-09-29 01:21:41.000000000","message":"Fixed!","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4627d5e2d929b3d11a7df8574ddace4541f3eba8","unresolved":true,"context_lines":[{"line_number":21,"context_line":"failures to instantiate the broker without raising NameError."},{"line_number":22,"context_line":"When the broker is absent, log using object_file exactly once"},{"line_number":23,"context_line":"(avoid duplicating the DB path). Keep the try-scope unchanged,"},{"line_number":24,"context_line":"per review."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"- Update unit tests to match the new log shapes and FakeBroker"},{"line_number":27,"context_line":"behavior. tighten assertions for \"db:\" and \"path:\" segments;"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":35,"id":"d885b6f7_502ced73","line":24,"updated":"2025-09-26 18:02:47.000000000","message":"this is confusingly worded - I sounds like an implementation detail but it\u0027s actually justifying some fairly complex special case where we want to log object_file when we don\u0027t have a broker, but use broker to get db_file AND path if it\u0027s available!\n\nI think this \"expanded use\" of the BrokerLogger has discovered a new requirement; just as it\u0027s already robust to broker\u0027s not having db_file and path attributes it seems we\u0027ll sometimes only have the db_file as a string and now a full broker - I think the new helper should try to say \"YES!  I can help you with that TOO!\" - Tim\u0027s recently told me this is called \"difficult for us, easy for them\" (or sometimes explained with the \"complexity iceberg\") - where instead of justifying the complexity in the commit message we should hide the complexity in the implementation!  (and then the explanation is in the tests i.e. \"show don\u0027t tell\")","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"69538febbf5e32cff6f528440ff0fd543b9a85f1","unresolved":false,"context_lines":[{"line_number":21,"context_line":"failures to instantiate the broker without raising NameError."},{"line_number":22,"context_line":"When the broker is absent, log using object_file exactly once"},{"line_number":23,"context_line":"(avoid duplicating the DB path). Keep the try-scope unchanged,"},{"line_number":24,"context_line":"per review."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"- Update unit tests to match the new log shapes and FakeBroker"},{"line_number":27,"context_line":"behavior. tighten assertions for \"db:\" and \"path:\" segments;"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":35,"id":"d0c653e3_ab046acf","line":24,"in_reply_to":"d885b6f7_502ced73","updated":"2025-09-29 01:21:41.000000000","message":"Acknowledged","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4627d5e2d929b3d11a7df8574ddace4541f3eba8","unresolved":true,"context_lines":[{"line_number":26,"context_line":"- Update unit tests to match the new log shapes and FakeBroker"},{"line_number":27,"context_line":"behavior. tighten assertions for \"db:\" and \"path:\" segments;"},{"line_number":28,"context_line":"quarantine tests pass the same db_path into _replicate_object()"},{"line_number":29,"context_line":"and assert the quarantined dirname accordingly."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"Further work"},{"line_number":32,"context_line":"------------"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":35,"id":"fdef66b8_61031690","line":29,"updated":"2025-09-26 18:02:47.000000000","message":"these are three unrelated bullets; I think it would be better as individual bullets\n\n```\nScope of this change\n--------------------\n\nExpand db logging consistency from container.sharder into continer.replicator and common.db_replicator\n\n* extract logging consistency helper from container.sharder and move it into common.db_replicator\n* update all log message call sites in common.db_replicator\n* update all log message call sites in container.replicator\n* update test.common.test_db_replicator fakes to better match real brokers db_file and path properties\n* update assertions for existing log messages\n* add assertions/tests for all updated log messages\n```","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"69538febbf5e32cff6f528440ff0fd543b9a85f1","unresolved":false,"context_lines":[{"line_number":26,"context_line":"- Update unit tests to match the new log shapes and FakeBroker"},{"line_number":27,"context_line":"behavior. tighten assertions for \"db:\" and \"path:\" segments;"},{"line_number":28,"context_line":"quarantine tests pass the same db_path into _replicate_object()"},{"line_number":29,"context_line":"and assert the quarantined dirname accordingly."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"Further work"},{"line_number":32,"context_line":"------------"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":35,"id":"90bcae07_be89a2ae","line":29,"in_reply_to":"fdef66b8_61031690","updated":"2025-09-29 01:21:41.000000000","message":"Done","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4627d5e2d929b3d11a7df8574ddace4541f3eba8","unresolved":true,"context_lines":[{"line_number":33,"context_line":"Further work is needed to audit sharding-related messages in the"},{"line_number":34,"context_line":"container.replicator module (e.g., _choose_replication_mode"},{"line_number":35,"context_line":"warnings) and bring them in line with the container.sharder"},{"line_number":36,"context_line":"module’s style."},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"No functional changes to replication behavior; this is"},{"line_number":39,"context_line":"logging/robustness and test updates only."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":35,"id":"78fa6180_63893a86","line":36,"updated":"2025-09-26 18:02:47.000000000","message":"this seems like an arbitrary line - more over I can see the example method DOES use the db_log format for logging?\n\n```\n    def _choose_replication_mode(self, node, rinfo, info, local_sync, broker,\n                                 http, different_region):\n        node_str \u003d \u0027%(ip)s:%(port)s/%(device)s\u0027 % node\n        if \u0027shard_max_row\u0027 in rinfo:\n            # Always replicate shard ranges to new-enough swift\n            shard_range_success \u003d self._sync_shard_ranges(\n                broker, http, info[\u0027id\u0027])\n        else:\n            shard_range_success \u003d False\n            self.warning(\n                broker,\n                \u0027is unable to replicate shard ranges to peer %s; \u0027\n                \u0027peer may need upgrading\u0027, node_str)\n```\n\nI didn\u0027t TRY to find log messages in container.replicator that didn\u0027t get updated - but I assume if any where missed after this change is merged that would be a bug - not \"out of scope\" work?","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"69538febbf5e32cff6f528440ff0fd543b9a85f1","unresolved":false,"context_lines":[{"line_number":33,"context_line":"Further work is needed to audit sharding-related messages in the"},{"line_number":34,"context_line":"container.replicator module (e.g., _choose_replication_mode"},{"line_number":35,"context_line":"warnings) and bring them in line with the container.sharder"},{"line_number":36,"context_line":"module’s style."},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"No functional changes to replication behavior; this is"},{"line_number":39,"context_line":"logging/robustness and test updates only."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":35,"id":"05d51f5a_d6e84659","line":36,"in_reply_to":"78fa6180_63893a86","updated":"2025-09-29 01:21:41.000000000","message":"Ya i agree, I intended to introduce the new db logger changes to the entire container.replicator module and i missed updating the commit message after squashing in the container.replicator changes, thanks for calling it out for me","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4627d5e2d929b3d11a7df8574ddace4541f3eba8","unresolved":true,"context_lines":[{"line_number":36,"context_line":"module’s style."},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"No functional changes to replication behavior; this is"},{"line_number":39,"context_line":"logging/robustness and test updates only."},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"Change-Id: I289d3e9b6fe14159925786732ad748acd0459812"},{"line_number":42,"context_line":"Related-Change: I7d2fe064175f002055054a72f348b87dc396772b"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":35,"id":"91df2a24_22e8002a","line":39,"updated":"2025-09-26 18:02:47.000000000","message":"this is the best part of the commit message!  Good to call out!","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"69538febbf5e32cff6f528440ff0fd543b9a85f1","unresolved":false,"context_lines":[{"line_number":36,"context_line":"module’s style."},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"No functional changes to replication behavior; this is"},{"line_number":39,"context_line":"logging/robustness and test updates only."},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"Change-Id: I289d3e9b6fe14159925786732ad748acd0459812"},{"line_number":42,"context_line":"Related-Change: I7d2fe064175f002055054a72f348b87dc396772b"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":35,"id":"7a98c4d4_6616d5d1","line":39,"in_reply_to":"91df2a24_22e8002a","updated":"2025-09-29 01:21:41.000000000","message":"Acknowledged","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"72dc0946f74d70b1f7af9d0e9c13a5f809329ac5","unresolved":true,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Extract helpers (from container.sharder) that formats log"},{"line_number":10,"context_line":"context from either a broker (preferring broker.path/db_file)"},{"line_number":11,"context_line":"or a plain db_file string. Use it in common.db_replicator and container.replicator so messages are uniform and robust."},{"line_number":12,"context_line":"Update tests to cover both cases."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"No functional changes to replication behavior; this is"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":39,"id":"0dfed1a0_808f09c5","line":11,"range":{"start_line":11,"start_character":0,"end_line":11,"end_character":118},"updated":"2025-09-30 06:40:40.000000000","message":"Not sure what happened to this line. Needs to break at or before the 72 character I belive. Eitherway, the rest did it.","commit_id":"777cc77329b3e38f3632b7d4e6172875c77973b1"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"1b8dfd167b01c5148c1ded37fb2d62590e7cd581","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Extract helpers (from container.sharder) that formats log"},{"line_number":10,"context_line":"context from either a broker (preferring broker.path/db_file)"},{"line_number":11,"context_line":"or a plain db_file string. Use it in common.db_replicator and container.replicator so messages are uniform and robust."},{"line_number":12,"context_line":"Update tests to cover both cases."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"No functional changes to replication behavior; this is"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":39,"id":"6905952b_2fc1a03f","line":11,"range":{"start_line":11,"start_character":0,"end_line":11,"end_character":118},"in_reply_to":"0dfed1a0_808f09c5","updated":"2025-10-02 20:01:09.000000000","message":"Done","commit_id":"777cc77329b3e38f3632b7d4e6172875c77973b1"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"e1da1a323fb0969625cf0c021136e43603b76805","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"0cbc344d_c9813d70","updated":"2024-10-24 22:54:29.000000000","message":"This is just a wip patch we have our dependent unit-tests still failing. Currently working on fixing `test/unit/container/test_replicator.py` but the logging structure is subject to change and could use suggestions from @alistairncoles@gmail.com","commit_id":"a5c06217fdd2b0d507b87b4a0935ee6067f50bdd"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"884065ec03fe24b1160ad4679dd107cfb059aa43","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"7f87a1fb_91844243","in_reply_to":"0cbc344d_c9813d70","updated":"2024-10-24 22:54:52.000000000","message":"unresolved","commit_id":"a5c06217fdd2b0d507b87b4a0935ee6067f50bdd"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"5524a4d30e1fcea91c4caf147b9afaa107c40cf8","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"42d0eca1_3676bc77","in_reply_to":"7f87a1fb_91844243","updated":"2025-08-08 21:02:03.000000000","message":"Done","commit_id":"a5c06217fdd2b0d507b87b4a0935ee6067f50bdd"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"ab0313a96e4ac8f1e81227c8cd11b3e421c7b347","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"2c5679aa_d95f489c","updated":"2024-12-11 16:41:00.000000000","message":"The helper methods ensure that every log line ends with ``path: \u003cpath\u003e, db: \u003cdb_file\u003e`` so there is no need to include db_file in the messages passed to the helpers.\n\nThere\u0027s also logging in swift/container/replicator.py that needs to be refactored to use the helpers\n\nThe base DatabaseBroker class and AccountBroker have no ``path`` attribute. We could try adding it but it\u0027s not trivial (the path isn\u0027t known to the broker without an sql query to the db), so I\u0027m inclined to just leave it out of the base class ``_format_log_msg`` if it is the empty string","commit_id":"e93c0bcc364991ab4758a5cf162f82953f6baf7a"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"1d3541b1bd05a218e92efff018cafd6fe43ceed0","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"d314197e_c06699b4","updated":"2025-01-03 17:18:45.000000000","message":"Will do another scan before requesting a re-review","commit_id":"17c8af933b5fed6ffba57370eca74ce5216dfec8"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"f5415789e0a07980d222c1af62d9aab6bfabc7f2","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":8,"id":"888608c0_c38d9253","updated":"2025-02-03 14:18:15.000000000","message":"revisting this patch after a break, needs feedback addressed and modified unit-tests","commit_id":"06c148544bde2c6f77a6c88003ce6526760b7d4f"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"875e1a38455dd65abd2f2109d74e1f4b4241415d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":10,"id":"ed0b6a62_535a5d6b","updated":"2025-08-08 20:07:09.000000000","message":"as best I can tell the \u0027\u0027.join() interpolation of logging args is wrong, the change is incomplete because it doesn\u0027t fix container/replicator, and I find the commit message unclear.\n\nPlease consider squashing:\n\n956965: sq? fix broker logging | https://review.opendev.org/c/openstack/swift/+/956965\n\nN.B. it\u0027s still WIP","commit_id":"f33c4bb32009261c2e3205a4d8ba495e19da13a9"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"53a65637ece9d6a83b24aabf6d955dd08c02e43a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":12,"id":"70beed9f_275d15f9","updated":"2025-08-11 09:22:58.000000000","message":"There\u0027s a couple of places in the Replicator class where we\u0027re still calling ``self.logger.error`` because the broker hasn\u0027t been passed down the call stack, where you might consider passing the broker so you can use self.error(broker,...):\n\n- _rsync_file (for this one you could pass in broker *instead* of broker.db_file)\n- _send_replicate_request\n\nMy bigger concern is that this patch doesn\u0027t make all the *sharder* logs consistent because it specifically excludes ContainerReplicator. Those are the logs that really frustrate me when debugging sharder incidents.","commit_id":"c5b89dd4f6090a829d99b27a8f7d99fe06250845"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ee99bf437df4fe26947fe314236a9cc1d9935536","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":12,"id":"59a8db34_8b51c3f1","updated":"2025-08-11 15:58:26.000000000","message":"This commit message is still a bit of jumble.\n\nThe NameError on broker in the else block of the Exception must be fixed - nice catch Al.\n\nWe shouldn\u0027t change the order of (path, db) in pre-existing sharder module logging.\n\nI don\u0027t understand the justification for removing the parens around the reason.\n\nPlease take care to review the patch and remove any un-necessary/off-topic changes.\n\nAll logging w/i the modules you\u0027ve identified as in \"in scope\" SHOULD be updated to pass in a broker.  If the message is both 1) lacking a broker in-context and 2) just a debug message you may want to annotate it as `# TODO plumb in a broker for improved debug logging` - esp if that gets you into working on the info/warning/error messages in `container.replicator` sooner!\n\nFWIW, I think it still *might* be justifiable to improve the logging across database services step-wise as dipping into the replicator module is going to introduce some additional complexity vis-a-vis the ReplicatorRpc class:\n\n956965: sq? fix broker logging | https://review.opendev.org/c/openstack/swift/+/956965\n\n... and most of the time it\u0027s reasonable to bank some progress when that can reasonable be understood as correct and complete.  However it might be hard to consider the changes in `common.db_replicator` as complete w/o doing the work in `container.replicator` - so I\u0027d recommend you spike into the full scope as soon as possible so you have the context, and then look at what\u0027s going to be the best way to get it all merged.","commit_id":"c5b89dd4f6090a829d99b27a8f7d99fe06250845"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"14b25c6c29b3546bd16543854b922f950c2c4411","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":12,"id":"5695b274_79743059","updated":"2025-08-11 09:28:27.000000000","message":"oops, hit the wrong button last time","commit_id":"c5b89dd4f6090a829d99b27a8f7d99fe06250845"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"a98db65fbf3bf9a8395253a96c00e099a914b4e4","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":12,"id":"8cc55c44_16e40147","in_reply_to":"70beed9f_275d15f9","updated":"2025-08-13 20:33:46.000000000","message":"There\u0027s no local var broker defined in `_send_replicate_request`, TODO for `_rsync_file`","commit_id":"c5b89dd4f6090a829d99b27a8f7d99fe06250845"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"01b45c5494fa8905e6a1eb517e55132e4a18c792","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":12,"id":"957e11f1_c8c6d957","in_reply_to":"8cc55c44_16e40147","updated":"2025-08-21 01:09:16.000000000","message":"Done","commit_id":"c5b89dd4f6090a829d99b27a8f7d99fe06250845"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"7a6d0ddede1239b201049a58055303f1c527ddcc","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":15,"id":"d5d620af_52813144","updated":"2025-08-14 08:41:31.000000000","message":"I\u0027m going to push back harder on the change to the order of db and path in the existing log line: please revert the change unless there is a motivating reason.","commit_id":"048fd2fb8b7475e143246f6cfe0d51c78994382f"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"14e47fa60709eafa0767c22348848bbca5561b22","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":21,"id":"e81d2e52_124a9059","updated":"2025-08-21 09:19:42.000000000","message":"This looks functionally correct. I\u0027d like the remaining re-use of ``case`` fixed, and it would be good to relocate the unit tests from test_sharder.py [1] into a test class that is a companion for the new mixin class.\n\n[1] see https://review.opendev.org/c/openstack/swift/+/875220/5/test/unit/container/test_sharder.py","commit_id":"941e41427c390d407c85fe5f033dcc42aa367527"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"f254312c4c010f9ceb61186b259df3d1fdc9cf8b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":21,"id":"9a5e90ed_c56977cd","updated":"2025-08-21 02:41:02.000000000","message":"recheck","commit_id":"941e41427c390d407c85fe5f033dcc42aa367527"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"d694b3068b0d557dd389b5c0dc89f029f902dfd7","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":21,"id":"d315eb6b_9e8cc65f","updated":"2025-08-21 02:40:55.000000000","message":"the test failures are unrelated.","commit_id":"941e41427c390d407c85fe5f033dcc42aa367527"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"805f976a86ea467ad88c21f296b734692c19d1f9","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":22,"id":"273b6d9f_de9c1b7b","updated":"2025-08-25 21:57:38.000000000","message":"I think we should consider how to add an AccountBroker.path before we merge this:\n\n```\naccount-replicator-6032: in sync with 127.0.0.4:6042/sdb4, nothing to do, path: , db: /srv/node3/sdb3/accounts/920/1a4/e618c667e502cc80575f2c4952b4d1a4/e618c667e502cc80575f2c4952b4d1a4.db\n```\n\n... or maybe there\u0027s a path towards ONLY instrumenting container.replicator or only adding `path: ...` if the broker has the attribute?","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"23fe7c793eaaff27ab9346ac8366684bc051aad2","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":22,"id":"b2c16eaa_27137894","updated":"2025-08-25 16:22:47.000000000","message":"So I like isolating the logger methods by pulling them out to a new class (`BrokerAnnotatedLogger`), but I\u0027m not so sure about needing to get everything to *subclass* it, rather than just *instantiate* it.","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"c4d8b6710d030480fc6fc6a33a5db026bc0c9e53","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":22,"id":"c1eb3cc3_4de41c9a","updated":"2025-08-21 23:32:59.000000000","message":"recheck","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4627d5e2d929b3d11a7df8574ddace4541f3eba8","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":35,"id":"27ebdb88_7bc286f2","updated":"2025-09-26 18:02:47.000000000","message":"I\u0027d still advocate we change to \"has-a-db-logger\" instead of \"is-a-db-logging-thing\" - I think that would be in better alignment with how we\u0027re *testing* the BrokerAnnotatedLogger.\n\nThere\u0027s some log message churn that has unfortunately discovering some untested code paths - for the log messages in container.replicator that ARE already tested (but apparently not asserted on) you should try to strengthen the test suite by adding assertions on the log messages (and to improve confidence in the completeness of THIS change but also establish patterns for maintaining the new behavior that all db-handler log messages should including the db_file and broker.path)\n\nThe fact that test.unit.common.test_db_replicator.FakeAccountBroker instances have a self.path that includes a container name is a regression in the test suite; it should probably be a blocking issue.\n\nThis is starting to shape up to a pretty comprehensive change!  I think the commit message could use some tightening up.","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"35b06d7d2a6b84cf209684fff77c7ebb3abec62c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":37,"id":"f4dabdfd_9bc42360","updated":"2025-09-29 16:01:56.000000000","message":"wait a minute, this change LOST the container.replicator changes!@?  those are the ones we wanted - all this BS with common.db and account.path turned out to be a side show and we keep pushing the part we actually care about further down to the end of the chain!?  😭","commit_id":"7e83f0d29f3eac36b5704af0bc6a758c3986062c"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"5d33b59db4d781fa7db0060473433c9232d91421","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":37,"id":"47f0b9d5_c058c2ee","in_reply_to":"f4dabdfd_9bc42360","updated":"2025-09-29 23:35:22.000000000","message":"It didn\u0027t, ref: https://review.opendev.org/c/openstack/swift/+/933379/37/swift/container/replicator.py","commit_id":"7e83f0d29f3eac36b5704af0bc6a758c3986062c"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"72dc0946f74d70b1f7af9d0e9c13a5f809329ac5","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":39,"id":"4a3ddb28_ffd0131e","updated":"2025-09-30 06:40:40.000000000","message":"This is looking great. Just a few tidy ups but I don\u0027t see any big blockers.","commit_id":"777cc77329b3e38f3632b7d4e6172875c77973b1"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"c6fef9dc091ced427d65aab64fe3b6a37f2bf7ec","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":42,"id":"4d153173_7cd3e3f1","updated":"2025-10-06 01:10:52.000000000","message":"Looking great Ash!\n\nYeah there are some things I think we can clean up. The return ordering, moving the adapter to common/db (although also happy for that to happen when we want to intergrate it into the other db daemons), I personally prefer db_logger over db_log (but that\u0027s just me, no stress there) and maybe using a helper for node_str (that already exists in swift). If you have to do another patch, maybe some of these can be fixed, but also happy to have it as a follow up.\n\n@clay you seemed like you might throw up a follow up, so happy to leave that to you or Ash.. if you want me to, then I\u0027m happy to whip up a follow up!\n\nGreat work Ash and thanks for pulling that thread that turned into a bigger patch then you expected.","commit_id":"cbe3c88083dfe0d96e7ae33bacbdc6aca811f8f8"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"51befc999641047129f8a7691c4bafe1c4d24b3f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":42,"id":"1d49c262_162ae464","updated":"2025-10-03 18:21:35.000000000","message":"at a glance this looks really good to me!\n\nI wanted to get some early feedback on here cause there is some nits I\u0027ll probably polish up in a follow-up if i\u0027m able to merge it.  I may not have time to finish before EoD tho - I have another task I also need to get to.\n\nI need to do a more detailed review, there may be some other issues in some of the new tests (but hopefully not blocking!)","commit_id":"cbe3c88083dfe0d96e7ae33bacbdc6aca811f8f8"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"44d16c35e3628fb4c843b1586e43f74eb435db61","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":44,"id":"211f09ba_2883cadc","updated":"2025-10-09 14:53:29.000000000","message":"The \u0027has a\u0027 pattern seems to have worked out nicely.\n\n-1 because:\n* there is a regression in a log message in db_replicator\n* the use of _get_broker_details in sharder.py\n\nI suggest fixups for the unnecessary test mocking here 963570: sq: container replicator: fixups for log messages and tests | https://review.opendev.org/c/openstack/swift/+/963570\n\nI\u0027d really like consistent naming of things we call to write logs i.e. ``logger`` not ``log``. I happen to also think that since it\u0027s a BrokerAnnotatedLogger then ``broker_logger`` would be an obvious name, but ``anything_logger`` please.","commit_id":"f8607fbc8b0dd7898fc224dfc6d2dd231957ae0c"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"7f34dcadccd122d5244bdc5d5507661237d4e51a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":45,"id":"5d290cc2_ce6af9a7","updated":"2025-10-13 12:28:02.000000000","message":"follow-up with some test cleanup as per my nits 963855: trivial test_[db_]replicator cleanup | https://review.opendev.org/c/openstack/swift/+/963855","commit_id":"41bf72a5cc5dbda1192732930c78a1fd91282f98"}],"swift/common/db_replicator.py":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"ab0313a96e4ac8f1e81227c8cd11b3e421c7b347","unresolved":true,"context_lines":[{"line_number":272,"context_line":"        db_file, path \u003d self._get_broker_details(broker)"},{"line_number":273,"context_line":"        if args:"},{"line_number":274,"context_line":"            msg \u003d msg % args"},{"line_number":275,"context_line":"        return \u0027%s, path: %s, db: %s\u0027 % (msg, quote(path), db_file)"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"    def _log(self, level, broker, msg, *args):"},{"line_number":278,"context_line":"        if not self.logger.isEnabledFor(level):"}],"source_content_type":"text/x-python","patch_set":3,"id":"858176c3_134dcfe9","line":275,"range":{"start_line":275,"start_character":8,"end_line":275,"end_character":67},"updated":"2024-12-11 16:41:00.000000000","message":"to allow for AccountBroker having no path attribute this could become\n\n```\ndiff --git a/swift/common/db_replicator.py b/swift/common/db_replicator.py\nindex 85ff4f909..dadcaf4ac 100644\n--- a/swift/common/db_replicator.py\n+++ b/swift/common/db_replicator.py\n@@ -270,9 +270,14 @@ class Replicator(Daemon):\n     def _format_log_msg(self, broker, msg, *args):\n         # make best effort to include broker properties...\n         db_file, path \u003d self._get_broker_details(broker)\n+        suffix \u003d \u0027\u0027\n+        if path:\n+            suffix +\u003d \u0027, path: %s\u0027 % quote(broker.path)\n+        if db_file:\n+            suffix +\u003d \u0027, db: %s\u0027 % broker.db_file\n         if args:\n             msg \u003d msg % args\n-        return \u0027%s, path: %s, db: %s\u0027 % (msg, quote(path), db_file)\n+        return \u0027%s%s\u0027 % (msg, suffix)\n\n     def _log(self, level, broker, msg, *args):\n         if not self.logger.isEnabledFor(level):\n         ```","commit_id":"e93c0bcc364991ab4758a5cf162f82953f6baf7a"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"11445fb504089a47dacf455bcfa67a50c3cdaf9e","unresolved":false,"context_lines":[{"line_number":272,"context_line":"        db_file, path \u003d self._get_broker_details(broker)"},{"line_number":273,"context_line":"        if args:"},{"line_number":274,"context_line":"            msg \u003d msg % args"},{"line_number":275,"context_line":"        return \u0027%s, path: %s, db: %s\u0027 % (msg, quote(path), db_file)"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"    def _log(self, level, broker, msg, *args):"},{"line_number":278,"context_line":"        if not self.logger.isEnabledFor(level):"}],"source_content_type":"text/x-python","patch_set":3,"id":"94fd90cf_86393247","line":275,"range":{"start_line":275,"start_character":8,"end_line":275,"end_character":67},"in_reply_to":"858176c3_134dcfe9","updated":"2025-01-03 17:17:57.000000000","message":"Done","commit_id":"e93c0bcc364991ab4758a5cf162f82953f6baf7a"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"ab0313a96e4ac8f1e81227c8cd11b3e421c7b347","unresolved":true,"context_lines":[{"line_number":295,"context_line":"    def exception(self, broker, msg, *args, **kwargs):"},{"line_number":296,"context_line":"        if not self.logger.isEnabledFor(logging.ERROR):"},{"line_number":297,"context_line":"            return"},{"line_number":298,"context_line":"        self.logger.exception(self._format_log_msg(broker, msg, *args))"},{"line_number":299,"context_line":""},{"line_number":300,"context_line":"    def _report_stats(self):"},{"line_number":301,"context_line":"        \"\"\"Report the current stats to the logs.\"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"f4bf42af_6abfb34f","line":298,"updated":"2024-12-11 16:41:00.000000000","message":"these methods are exact copies of those in the ContainerSharder subclass, so they are no longer needed in the subclass","commit_id":"e93c0bcc364991ab4758a5cf162f82953f6baf7a"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"11445fb504089a47dacf455bcfa67a50c3cdaf9e","unresolved":false,"context_lines":[{"line_number":295,"context_line":"    def exception(self, broker, msg, *args, **kwargs):"},{"line_number":296,"context_line":"        if not self.logger.isEnabledFor(logging.ERROR):"},{"line_number":297,"context_line":"            return"},{"line_number":298,"context_line":"        self.logger.exception(self._format_log_msg(broker, msg, *args))"},{"line_number":299,"context_line":""},{"line_number":300,"context_line":"    def _report_stats(self):"},{"line_number":301,"context_line":"        \"\"\"Report the current stats to the logs.\"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"98f2c0d6_33030d02","line":298,"in_reply_to":"f4bf42af_6abfb34f","updated":"2025-01-03 17:17:57.000000000","message":"Acknowledged","commit_id":"e93c0bcc364991ab4758a5cf162f82953f6baf7a"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"ab0313a96e4ac8f1e81227c8cd11b3e421c7b347","unresolved":true,"context_lines":[{"line_number":380,"context_line":"        mtime \u003d os.path.getmtime(broker.db_file)"},{"line_number":381,"context_line":"        if not self._rsync_file(db_file\u003dbroker.db_file,"},{"line_number":382,"context_line":"                                remote_file\u003dremote_file,"},{"line_number":383,"context_line":"                                different_region\u003ddifferent_region):"},{"line_number":384,"context_line":"            return False"},{"line_number":385,"context_line":"        # perform block-level sync if the db was modified during the first sync"},{"line_number":386,"context_line":"        if os.path.exists(broker.db_file + \u0027-journal\u0027) or \\"}],"source_content_type":"text/x-python","patch_set":3,"id":"464fa02e_6ccec822","line":383,"updated":"2024-12-11 16:41:00.000000000","message":"unnecessary change","commit_id":"e93c0bcc364991ab4758a5cf162f82953f6baf7a"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"11445fb504089a47dacf455bcfa67a50c3cdaf9e","unresolved":false,"context_lines":[{"line_number":380,"context_line":"        mtime \u003d os.path.getmtime(broker.db_file)"},{"line_number":381,"context_line":"        if not self._rsync_file(db_file\u003dbroker.db_file,"},{"line_number":382,"context_line":"                                remote_file\u003dremote_file,"},{"line_number":383,"context_line":"                                different_region\u003ddifferent_region):"},{"line_number":384,"context_line":"            return False"},{"line_number":385,"context_line":"        # perform block-level sync if the db was modified during the first sync"},{"line_number":386,"context_line":"        if os.path.exists(broker.db_file + \u0027-journal\u0027) or \\"}],"source_content_type":"text/x-python","patch_set":3,"id":"eb78a127_2886edc0","line":383,"in_reply_to":"464fa02e_6ccec822","updated":"2025-01-03 17:17:57.000000000","message":"Done","commit_id":"e93c0bcc364991ab4758a5cf162f82953f6baf7a"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"a98db65fbf3bf9a8395253a96c00e099a914b4e4","unresolved":false,"context_lines":[{"line_number":380,"context_line":"        mtime \u003d os.path.getmtime(broker.db_file)"},{"line_number":381,"context_line":"        if not self._rsync_file(db_file\u003dbroker.db_file,"},{"line_number":382,"context_line":"                                remote_file\u003dremote_file,"},{"line_number":383,"context_line":"                                different_region\u003ddifferent_region):"},{"line_number":384,"context_line":"            return False"},{"line_number":385,"context_line":"        # perform block-level sync if the db was modified during the first sync"},{"line_number":386,"context_line":"        if os.path.exists(broker.db_file + \u0027-journal\u0027) or \\"}],"source_content_type":"text/x-python","patch_set":3,"id":"c71f9fcd_7e4bcaa4","line":383,"in_reply_to":"8358dfa7_9a75d182","updated":"2025-08-13 20:33:46.000000000","message":"Done","commit_id":"e93c0bcc364991ab4758a5cf162f82953f6baf7a"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"53a65637ece9d6a83b24aabf6d955dd08c02e43a","unresolved":true,"context_lines":[{"line_number":380,"context_line":"        mtime \u003d os.path.getmtime(broker.db_file)"},{"line_number":381,"context_line":"        if not self._rsync_file(db_file\u003dbroker.db_file,"},{"line_number":382,"context_line":"                                remote_file\u003dremote_file,"},{"line_number":383,"context_line":"                                different_region\u003ddifferent_region):"},{"line_number":384,"context_line":"            return False"},{"line_number":385,"context_line":"        # perform block-level sync if the db was modified during the first sync"},{"line_number":386,"context_line":"        if os.path.exists(broker.db_file + \u0027-journal\u0027) or \\"}],"source_content_type":"text/x-python","patch_set":3,"id":"8358dfa7_9a75d182","line":383,"in_reply_to":"eb78a127_2886edc0","updated":"2025-08-11 09:22:58.000000000","message":"not Done","commit_id":"e93c0bcc364991ab4758a5cf162f82953f6baf7a"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"ab0313a96e4ac8f1e81227c8cd11b3e421c7b347","unresolved":true,"context_lines":[{"line_number":390,"context_line":"                if not self._rsync_file(db_file\u003dbroker.db_file,"},{"line_number":391,"context_line":"                                        remote_file\u003dremote_file,"},{"line_number":392,"context_line":"                                        whole_file\u003dFalse,"},{"line_number":393,"context_line":"                                        different_region\u003ddifferent_region):"},{"line_number":394,"context_line":"                    return False"},{"line_number":395,"context_line":"        with Timeout(replicate_timeout or self.node_timeout):"},{"line_number":396,"context_line":"            response \u003d http.replicate(replicate_method, local_id,"}],"source_content_type":"text/x-python","patch_set":3,"id":"a85cf848_cd4c4253","line":393,"updated":"2024-12-11 16:41:00.000000000","message":"unnecessary change","commit_id":"e93c0bcc364991ab4758a5cf162f82953f6baf7a"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"53a65637ece9d6a83b24aabf6d955dd08c02e43a","unresolved":true,"context_lines":[{"line_number":390,"context_line":"                if not self._rsync_file(db_file\u003dbroker.db_file,"},{"line_number":391,"context_line":"                                        remote_file\u003dremote_file,"},{"line_number":392,"context_line":"                                        whole_file\u003dFalse,"},{"line_number":393,"context_line":"                                        different_region\u003ddifferent_region):"},{"line_number":394,"context_line":"                    return False"},{"line_number":395,"context_line":"        with Timeout(replicate_timeout or self.node_timeout):"},{"line_number":396,"context_line":"            response \u003d http.replicate(replicate_method, local_id,"}],"source_content_type":"text/x-python","patch_set":3,"id":"9dc1487b_3d04b910","line":393,"in_reply_to":"104d4b7b_54c6d87a","updated":"2025-08-11 09:22:58.000000000","message":"not Done","commit_id":"e93c0bcc364991ab4758a5cf162f82953f6baf7a"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"a98db65fbf3bf9a8395253a96c00e099a914b4e4","unresolved":false,"context_lines":[{"line_number":390,"context_line":"                if not self._rsync_file(db_file\u003dbroker.db_file,"},{"line_number":391,"context_line":"                                        remote_file\u003dremote_file,"},{"line_number":392,"context_line":"                                        whole_file\u003dFalse,"},{"line_number":393,"context_line":"                                        different_region\u003ddifferent_region):"},{"line_number":394,"context_line":"                    return False"},{"line_number":395,"context_line":"        with Timeout(replicate_timeout or self.node_timeout):"},{"line_number":396,"context_line":"            response \u003d http.replicate(replicate_method, local_id,"}],"source_content_type":"text/x-python","patch_set":3,"id":"e9155dd0_538b54e7","line":393,"in_reply_to":"9dc1487b_3d04b910","updated":"2025-08-13 20:33:46.000000000","message":"Done","commit_id":"e93c0bcc364991ab4758a5cf162f82953f6baf7a"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"11445fb504089a47dacf455bcfa67a50c3cdaf9e","unresolved":false,"context_lines":[{"line_number":390,"context_line":"                if not self._rsync_file(db_file\u003dbroker.db_file,"},{"line_number":391,"context_line":"                                        remote_file\u003dremote_file,"},{"line_number":392,"context_line":"                                        whole_file\u003dFalse,"},{"line_number":393,"context_line":"                                        different_region\u003ddifferent_region):"},{"line_number":394,"context_line":"                    return False"},{"line_number":395,"context_line":"        with Timeout(replicate_timeout or self.node_timeout):"},{"line_number":396,"context_line":"            response \u003d http.replicate(replicate_method, local_id,"}],"source_content_type":"text/x-python","patch_set":3,"id":"104d4b7b_54c6d87a","line":393,"in_reply_to":"a85cf848_cd4c4253","updated":"2025-01-03 17:17:57.000000000","message":"Done","commit_id":"e93c0bcc364991ab4758a5cf162f82953f6baf7a"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"ab0313a96e4ac8f1e81227c8cd11b3e421c7b347","unresolved":true,"context_lines":[{"line_number":422,"context_line":"        self.stats[\u0027diff\u0027] +\u003d 1"},{"line_number":423,"context_line":"        self.logger.increment(\u0027diffs\u0027)"},{"line_number":424,"context_line":"        self.debug(broker, \u0027%s usyncing chunks to %s, starting at row %s\u0027,"},{"line_number":425,"context_line":"                   broker.db_file, \u0027%(ip)s:%(port)s/%(device)s\u0027 %"},{"line_number":426,"context_line":"                   http.node,"},{"line_number":427,"context_line":"                   point)"},{"line_number":428,"context_line":"        start \u003d time.time()"}],"source_content_type":"text/x-python","patch_set":3,"id":"061743a5_4cc373b0","line":425,"range":{"start_line":425,"start_character":19,"end_line":425,"end_character":33},"updated":"2024-12-11 16:41:00.000000000","message":"the goal of the change is for db_file and path to be added to each log message by the helpers, so it can be dropped from the message here","commit_id":"e93c0bcc364991ab4758a5cf162f82953f6baf7a"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"c025bcfe7257d5f262e94b581ba23844091c5944","unresolved":false,"context_lines":[{"line_number":422,"context_line":"        self.stats[\u0027diff\u0027] +\u003d 1"},{"line_number":423,"context_line":"        self.logger.increment(\u0027diffs\u0027)"},{"line_number":424,"context_line":"        self.debug(broker, \u0027%s usyncing chunks to %s, starting at row %s\u0027,"},{"line_number":425,"context_line":"                   broker.db_file, \u0027%(ip)s:%(port)s/%(device)s\u0027 %"},{"line_number":426,"context_line":"                   http.node,"},{"line_number":427,"context_line":"                   point)"},{"line_number":428,"context_line":"        start \u003d time.time()"}],"source_content_type":"text/x-python","patch_set":3,"id":"90f8c803_f69fe91c","line":425,"range":{"start_line":425,"start_character":19,"end_line":425,"end_character":33},"in_reply_to":"061743a5_4cc373b0","updated":"2025-01-15 21:25:08.000000000","message":"Done","commit_id":"e93c0bcc364991ab4758a5cf162f82953f6baf7a"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"ab0313a96e4ac8f1e81227c8cd11b3e421c7b347","unresolved":true,"context_lines":[{"line_number":442,"context_line":"        self.debug("},{"line_number":443,"context_line":"            broker,"},{"line_number":444,"context_line":"            \u0027%s usyncing chunks to %s, finished at row %s (%gs)\u0027,"},{"line_number":445,"context_line":"            broker.db_file,"},{"line_number":446,"context_line":"            \u0027%(ip)s:%(port)s/%(device)s\u0027 % http.node,"},{"line_number":447,"context_line":"            point,"},{"line_number":448,"context_line":"            time.time() - start"}],"source_content_type":"text/x-python","patch_set":3,"id":"541f6bf8_996ad354","line":445,"range":{"start_line":445,"start_character":12,"end_line":445,"end_character":26},"updated":"2024-12-11 16:41:00.000000000","message":"again, this is now repeated information","commit_id":"e93c0bcc364991ab4758a5cf162f82953f6baf7a"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"c025bcfe7257d5f262e94b581ba23844091c5944","unresolved":false,"context_lines":[{"line_number":442,"context_line":"        self.debug("},{"line_number":443,"context_line":"            broker,"},{"line_number":444,"context_line":"            \u0027%s usyncing chunks to %s, finished at row %s (%gs)\u0027,"},{"line_number":445,"context_line":"            broker.db_file,"},{"line_number":446,"context_line":"            \u0027%(ip)s:%(port)s/%(device)s\u0027 % http.node,"},{"line_number":447,"context_line":"            point,"},{"line_number":448,"context_line":"            time.time() - start"}],"source_content_type":"text/x-python","patch_set":3,"id":"367511b0_b9fc97d3","line":445,"range":{"start_line":445,"start_character":12,"end_line":445,"end_character":26},"in_reply_to":"541f6bf8_996ad354","updated":"2025-01-15 21:25:08.000000000","message":"Done","commit_id":"e93c0bcc364991ab4758a5cf162f82953f6baf7a"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"ab0313a96e4ac8f1e81227c8cd11b3e421c7b347","unresolved":true,"context_lines":[{"line_number":557,"context_line":"    def _choose_replication_mode(self, node, rinfo, info, local_sync, broker,"},{"line_number":558,"context_line":"                                 http, different_region):"},{"line_number":559,"context_line":"        if self._in_sync(rinfo, info, broker, local_sync):"},{"line_number":560,"context_line":"            error_msg \u003d \u0027%s in sync with %s, nothing to do\u0027 % (broker.db_file,"},{"line_number":561,"context_line":"                                                               node)"},{"line_number":562,"context_line":"            self.debug(broker, error_msg)"},{"line_number":563,"context_line":"            return True"}],"source_content_type":"text/x-python","patch_set":3,"id":"09b13465_2ded4be5","line":560,"range":{"start_line":560,"start_character":12,"end_line":560,"end_character":21},"updated":"2024-12-11 16:41:00.000000000","message":"curious that you have named this ``error_msg`` - it\u0027s not an error condition that is being logged","commit_id":"e93c0bcc364991ab4758a5cf162f82953f6baf7a"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"ab0313a96e4ac8f1e81227c8cd11b3e421c7b347","unresolved":true,"context_lines":[{"line_number":557,"context_line":"    def _choose_replication_mode(self, node, rinfo, info, local_sync, broker,"},{"line_number":558,"context_line":"                                 http, different_region):"},{"line_number":559,"context_line":"        if self._in_sync(rinfo, info, broker, local_sync):"},{"line_number":560,"context_line":"            error_msg \u003d \u0027%s in sync with %s, nothing to do\u0027 % (broker.db_file,"},{"line_number":561,"context_line":"                                                               node)"},{"line_number":562,"context_line":"            self.debug(broker, error_msg)"},{"line_number":563,"context_line":"            return True"}],"source_content_type":"text/x-python","patch_set":3,"id":"805186eb_678fc99f","line":560,"range":{"start_line":560,"start_character":63,"end_line":560,"end_character":77},"updated":"2024-12-11 16:41:00.000000000","message":"ditto","commit_id":"e93c0bcc364991ab4758a5cf162f82953f6baf7a"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"c025bcfe7257d5f262e94b581ba23844091c5944","unresolved":false,"context_lines":[{"line_number":557,"context_line":"    def _choose_replication_mode(self, node, rinfo, info, local_sync, broker,"},{"line_number":558,"context_line":"                                 http, different_region):"},{"line_number":559,"context_line":"        if self._in_sync(rinfo, info, broker, local_sync):"},{"line_number":560,"context_line":"            error_msg \u003d \u0027%s in sync with %s, nothing to do\u0027 % (broker.db_file,"},{"line_number":561,"context_line":"                                                               node)"},{"line_number":562,"context_line":"            self.debug(broker, error_msg)"},{"line_number":563,"context_line":"            return True"}],"source_content_type":"text/x-python","patch_set":3,"id":"1dfa53c1_101bc3d0","line":560,"range":{"start_line":560,"start_character":12,"end_line":560,"end_character":21},"in_reply_to":"09b13465_2ded4be5","updated":"2025-01-15 21:25:08.000000000","message":"Done","commit_id":"e93c0bcc364991ab4758a5cf162f82953f6baf7a"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"c025bcfe7257d5f262e94b581ba23844091c5944","unresolved":false,"context_lines":[{"line_number":557,"context_line":"    def _choose_replication_mode(self, node, rinfo, info, local_sync, broker,"},{"line_number":558,"context_line":"                                 http, different_region):"},{"line_number":559,"context_line":"        if self._in_sync(rinfo, info, broker, local_sync):"},{"line_number":560,"context_line":"            error_msg \u003d \u0027%s in sync with %s, nothing to do\u0027 % (broker.db_file,"},{"line_number":561,"context_line":"                                                               node)"},{"line_number":562,"context_line":"            self.debug(broker, error_msg)"},{"line_number":563,"context_line":"            return True"}],"source_content_type":"text/x-python","patch_set":3,"id":"87bc6a98_fd8dcf6e","line":560,"range":{"start_line":560,"start_character":63,"end_line":560,"end_character":77},"in_reply_to":"805186eb_678fc99f","updated":"2025-01-15 21:25:08.000000000","message":"Done","commit_id":"e93c0bcc364991ab4758a5cf162f82953f6baf7a"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"ab0313a96e4ac8f1e81227c8cd11b3e421c7b347","unresolved":true,"context_lines":[{"line_number":600,"context_line":"        :return success: returns False if deletion of the database was"},{"line_number":601,"context_line":"            attempted but unsuccessful, otherwise returns True."},{"line_number":602,"context_line":"        \"\"\""},{"line_number":603,"context_line":"        log_template \u003d \u0027Not deleting db %s\u0027 % broker.db_file"},{"line_number":604,"context_line":"        max_row_delta \u003d broker.get_max_row() - orig_info[\u0027max_row\u0027]"},{"line_number":605,"context_line":"        if max_row_delta \u003c 0:"},{"line_number":606,"context_line":"            reason \u003d \u0027negative max_row_delta: %s\u0027 % max_row_delta"}],"source_content_type":"text/x-python","patch_set":3,"id":"bcd74f25_4fe48945","line":603,"range":{"start_line":603,"start_character":46,"end_line":603,"end_character":60},"updated":"2024-12-11 16:41:00.000000000","message":"ditto - this is now duplicated - I think it would be sufficient for the log line to be\n\n``Not deleting db (\u003creason\u003e), path: \u003cpath\u003e, db: \u003cdb_file\u003e``","commit_id":"e93c0bcc364991ab4758a5cf162f82953f6baf7a"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"c025bcfe7257d5f262e94b581ba23844091c5944","unresolved":false,"context_lines":[{"line_number":600,"context_line":"        :return success: returns False if deletion of the database was"},{"line_number":601,"context_line":"            attempted but unsuccessful, otherwise returns True."},{"line_number":602,"context_line":"        \"\"\""},{"line_number":603,"context_line":"        log_template \u003d \u0027Not deleting db %s\u0027 % broker.db_file"},{"line_number":604,"context_line":"        max_row_delta \u003d broker.get_max_row() - orig_info[\u0027max_row\u0027]"},{"line_number":605,"context_line":"        if max_row_delta \u003c 0:"},{"line_number":606,"context_line":"            reason \u003d \u0027negative max_row_delta: %s\u0027 % max_row_delta"}],"source_content_type":"text/x-python","patch_set":3,"id":"246f43b1_b07a47fc","line":603,"range":{"start_line":603,"start_character":46,"end_line":603,"end_character":60},"in_reply_to":"bcd74f25_4fe48945","updated":"2025-01-15 21:25:08.000000000","message":"Done","commit_id":"e93c0bcc364991ab4758a5cf162f82953f6baf7a"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"ab0313a96e4ac8f1e81227c8cd11b3e421c7b347","unresolved":true,"context_lines":[{"line_number":604,"context_line":"        max_row_delta \u003d broker.get_max_row() - orig_info[\u0027max_row\u0027]"},{"line_number":605,"context_line":"        if max_row_delta \u003c 0:"},{"line_number":606,"context_line":"            reason \u003d \u0027negative max_row_delta: %s\u0027 % max_row_delta"},{"line_number":607,"context_line":"            error_msg \u003d \u0027{} ({})\u0027.format(log_template, reason)"},{"line_number":608,"context_line":"            self.error(broker, error_msg)"},{"line_number":609,"context_line":"            return True"},{"line_number":610,"context_line":"        if max_row_delta:"}],"source_content_type":"text/x-python","patch_set":3,"id":"526db63b_25a150ac","line":607,"range":{"start_line":607,"start_character":12,"end_line":607,"end_character":62},"updated":"2024-12-11 16:41:00.000000000","message":"was it necessary to pre-format the message? IIRC the helpers would forward the template and args to the logger functions just as before.\n\nsame for following changes","commit_id":"e93c0bcc364991ab4758a5cf162f82953f6baf7a"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"c025bcfe7257d5f262e94b581ba23844091c5944","unresolved":false,"context_lines":[{"line_number":604,"context_line":"        max_row_delta \u003d broker.get_max_row() - orig_info[\u0027max_row\u0027]"},{"line_number":605,"context_line":"        if max_row_delta \u003c 0:"},{"line_number":606,"context_line":"            reason \u003d \u0027negative max_row_delta: %s\u0027 % max_row_delta"},{"line_number":607,"context_line":"            error_msg \u003d \u0027{} ({})\u0027.format(log_template, reason)"},{"line_number":608,"context_line":"            self.error(broker, error_msg)"},{"line_number":609,"context_line":"            return True"},{"line_number":610,"context_line":"        if max_row_delta:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9db424a2_c45aff4b","line":607,"range":{"start_line":607,"start_character":12,"end_line":607,"end_character":62},"in_reply_to":"526db63b_25a150ac","updated":"2025-01-15 21:25:08.000000000","message":"Acknowledged","commit_id":"e93c0bcc364991ab4758a5cf162f82953f6baf7a"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"ab0313a96e4ac8f1e81227c8cd11b3e421c7b347","unresolved":true,"context_lines":[{"line_number":682,"context_line":"        except (Exception, Timeout) as e:"},{"line_number":683,"context_line":"            if \u0027no such table\u0027 in str(e):"},{"line_number":684,"context_line":"                self.error(broker, \u0027Quarantining DB %s\u0027,"},{"line_number":685,"context_line":"                           object_file)"},{"line_number":686,"context_line":"                quarantine_db(broker.db_file, broker.db_type)"},{"line_number":687,"context_line":"            else:"},{"line_number":688,"context_line":"                self.exception(broker, \u0027ERROR reading db %s\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"d3ccce88_8276f3ab","line":685,"range":{"start_line":685,"start_character":27,"end_line":685,"end_character":38},"updated":"2024-12-11 16:41:00.000000000","message":"object_file IS the db_file","commit_id":"e93c0bcc364991ab4758a5cf162f82953f6baf7a"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"c025bcfe7257d5f262e94b581ba23844091c5944","unresolved":false,"context_lines":[{"line_number":682,"context_line":"        except (Exception, Timeout) as e:"},{"line_number":683,"context_line":"            if \u0027no such table\u0027 in str(e):"},{"line_number":684,"context_line":"                self.error(broker, \u0027Quarantining DB %s\u0027,"},{"line_number":685,"context_line":"                           object_file)"},{"line_number":686,"context_line":"                quarantine_db(broker.db_file, broker.db_type)"},{"line_number":687,"context_line":"            else:"},{"line_number":688,"context_line":"                self.exception(broker, \u0027ERROR reading db %s\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"9d26a09a_e392502a","line":685,"range":{"start_line":685,"start_character":27,"end_line":685,"end_character":38},"in_reply_to":"d3ccce88_8276f3ab","updated":"2025-01-15 21:25:08.000000000","message":"Acknowledged","commit_id":"e93c0bcc364991ab4758a5cf162f82953f6baf7a"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"40d498f2afb354fc57c2d37810e50aaa720956e9","unresolved":true,"context_lines":[{"line_number":277,"context_line":"                except TypeError:"},{"line_number":278,"context_line":"                    msg \u003d msg + \u0027\u0027 + \u0027\u0027.join(str(a) for a in args)"},{"line_number":279,"context_line":"            else:"},{"line_number":280,"context_line":"                msg \u003d msg + \u0027\u0027 + \u0027\u0027.join(str(a) for a in args)"},{"line_number":281,"context_line":"        return \u0027%s, path: %s, db: %s\u0027 % (msg, quote(path), db_file)"},{"line_number":282,"context_line":""},{"line_number":283,"context_line":"    def _log(self, level, broker, msg, *args):"}],"source_content_type":"text/x-python","patch_set":9,"id":"7af4ba47_4d47bef9","line":280,"updated":"2025-08-07 22:25:46.000000000","message":"Why can\u0027t we just say `msg \u003d msg % args` like the sharder used to have? I take it there are places where the interpolation currently fails -- can we just fix them, instead?","commit_id":"1a2186ac105c44a8d31f06f1ed96b976912c3b72"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"875e1a38455dd65abd2f2109d74e1f4b4241415d","unresolved":true,"context_lines":[{"line_number":277,"context_line":"                except TypeError:"},{"line_number":278,"context_line":"                    msg \u003d msg + \u0027\u0027 + \u0027\u0027.join(str(a) for a in args)"},{"line_number":279,"context_line":"            else:"},{"line_number":280,"context_line":"                msg \u003d msg + \u0027\u0027 + \u0027\u0027.join(str(a) for a in args)"},{"line_number":281,"context_line":"        return \u0027%s, path: %s, db: %s\u0027 % (msg, quote(path), db_file)"},{"line_number":282,"context_line":""},{"line_number":283,"context_line":"    def _log(self, level, broker, msg, *args):"}],"source_content_type":"text/x-python","patch_set":9,"id":"df9f50ce_02c8f4a2","line":280,"in_reply_to":"7af4ba47_4d47bef9","updated":"2025-08-08 20:07:09.000000000","message":"that would be SO much better, `if \u0027%\u0027 in msg` looks wrong-AF\n\nas a review I would *definitely* change this and see what happens so I can tell the author what this code should do.  Hopefully:\n\n```\ndef _format_log_msg_template(broker, msg, *args, **kwargs):\n   msg +\u003d r\u0027, path %s, db: %s\u0027\n   args \u003d tuple(list(args) + [quote(path), db_file])\n   return msg, args, kwargs\n   \ndef _log(broker, msg, *args, **kwargs):\n   msg, args, kwargs \u003d self._format_log_msg(broker, msg, *args, **kwargs):\n   self.logger.log(msg, *args, **kwargs)\n```\n\nI came up with this:\n\n```\n+        db_path, db_file \u003d self._get_broker_details(broker)\n+        if len(args) \u003d\u003d 1 and isinstance(args, dict):\n+            msg +\u003d \u0027, path: %(db_path)s, db: %(db_file)s\u0027\n+            args[0].update({\u0027db_path\u0027: db_path, \u0027db_file\u0027: db_file})\n+        else:\n+            msg +\u003d \u0027, path: %s, db: %s\u0027\n+            args \u003d tuple(list(args) + [db_path, db_file])\n+        return msg, args\n \n     def _log(self, level, broker, msg, *args):\n-        if not self.logger.isEnabledFor(level):\n-            return\n-\n-        self.logger.log(level, self._format_log_msg(broker, msg, *args))\n+        msg, args \u003d self._format_broker_log(broker, msg, *args)\n+        self.logger.log(level, msg, *args)\n```\n\n... seems to work\n\nok, so wow - yeah `msg + \u0027\u0027 + \u0027\u0027.join(str(a) for a in args)` is CRAZY - that\u0027s so... like if the message was:\n\n`self.debug(broker, \u0027start of message\u0027, \u0027rest of message\u0027, \u0027crazy\u0027)`\n\n... it just slams them altogether... that\u0027s not how `self.logger.debug()` works at all:\n\nhttps://docs.python.org/3/howto/logging.html#logging-variable-data","commit_id":"1a2186ac105c44a8d31f06f1ed96b976912c3b72"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"5a5835d9ec63412e0296f3eda3e67a216e9eb933","unresolved":false,"context_lines":[{"line_number":277,"context_line":"                except TypeError:"},{"line_number":278,"context_line":"                    msg \u003d msg + \u0027\u0027 + \u0027\u0027.join(str(a) for a in args)"},{"line_number":279,"context_line":"            else:"},{"line_number":280,"context_line":"                msg \u003d msg + \u0027\u0027 + \u0027\u0027.join(str(a) for a in args)"},{"line_number":281,"context_line":"        return \u0027%s, path: %s, db: %s\u0027 % (msg, quote(path), db_file)"},{"line_number":282,"context_line":""},{"line_number":283,"context_line":"    def _log(self, level, broker, msg, *args):"}],"source_content_type":"text/x-python","patch_set":9,"id":"f2b8b2d7_dd18ce70","line":280,"in_reply_to":"df9f50ce_02c8f4a2","updated":"2025-08-11 17:15:24.000000000","message":"Acknowledged","commit_id":"1a2186ac105c44a8d31f06f1ed96b976912c3b72"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ee99bf437df4fe26947fe314236a9cc1d9935536","unresolved":false,"context_lines":[{"line_number":277,"context_line":"                except TypeError:"},{"line_number":278,"context_line":"                    msg \u003d msg + \u0027\u0027 + \u0027\u0027.join(str(a) for a in args)"},{"line_number":279,"context_line":"            else:"},{"line_number":280,"context_line":"                msg \u003d msg + \u0027\u0027 + \u0027\u0027.join(str(a) for a in args)"},{"line_number":281,"context_line":"        return \u0027%s, path: %s, db: %s\u0027 % (msg, quote(path), db_file)"},{"line_number":282,"context_line":""},{"line_number":283,"context_line":"    def _log(self, level, broker, msg, *args):"}],"source_content_type":"text/x-python","patch_set":9,"id":"b40c01c2_13a52493","line":280,"in_reply_to":"df9f50ce_02c8f4a2","updated":"2025-08-11 15:58:26.000000000","message":"Done","commit_id":"1a2186ac105c44a8d31f06f1ed96b976912c3b72"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"40d498f2afb354fc57c2d37810e50aaa720956e9","unresolved":true,"context_lines":[{"line_number":427,"context_line":"        \"\"\""},{"line_number":428,"context_line":"        self.stats[\u0027diff\u0027] +\u003d 1"},{"line_number":429,"context_line":"        self.logger.increment(\u0027diffs\u0027)"},{"line_number":430,"context_line":"        self.debug(broker, \u0027%s usyncing chunks to %s, starting at row %s\u0027,"},{"line_number":431,"context_line":"                   \u0027%(ip)s:%(port)s/%(device)s\u0027 %"},{"line_number":432,"context_line":"                   http.node,"},{"line_number":433,"context_line":"                   point)"}],"source_content_type":"text/x-python","patch_set":9,"id":"13fdb37e_b06718ea","line":430,"range":{"start_line":430,"start_character":28,"end_line":430,"end_character":31},"updated":"2025-08-07 22:25:46.000000000","message":"We should drop this, since we no longer pass `broker.db_file` as an arg. Tests would catch it, too, if we had the simpler\n```\n       if args:\n            msg \u003d msg % args\n```\nin `_format_log_msg`","commit_id":"1a2186ac105c44a8d31f06f1ed96b976912c3b72"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"875e1a38455dd65abd2f2109d74e1f4b4241415d","unresolved":true,"context_lines":[{"line_number":427,"context_line":"        \"\"\""},{"line_number":428,"context_line":"        self.stats[\u0027diff\u0027] +\u003d 1"},{"line_number":429,"context_line":"        self.logger.increment(\u0027diffs\u0027)"},{"line_number":430,"context_line":"        self.debug(broker, \u0027%s usyncing chunks to %s, starting at row %s\u0027,"},{"line_number":431,"context_line":"                   \u0027%(ip)s:%(port)s/%(device)s\u0027 %"},{"line_number":432,"context_line":"                   http.node,"},{"line_number":433,"context_line":"                   point)"}],"source_content_type":"text/x-python","patch_set":9,"id":"139c635d_58b9caed","line":430,"range":{"start_line":430,"start_character":28,"end_line":430,"end_character":31},"in_reply_to":"13fdb37e_b06718ea","updated":"2025-08-08 20:07:09.000000000","message":"\u003e We should drop this\n\nright, the positional argument formatting placeholder doesn\u0027t make sense if we removed the positional arg.\n\nHowever I\u0027m not sure I understand the justification for `msg \u003d msg % args` in `_format_log_msg` - presumably that should just be adding\n\n1) additional positional format arguments to the template\n2) additional positional args for the template\n\n... and passing them into logging as `msg, *args`\n\nmaybe even simpler to use logger.log\u0027s kwarg templating\n\nhow did this even work?  There\u0027s 3 pos format args and only 2 arguments","commit_id":"1a2186ac105c44a8d31f06f1ed96b976912c3b72"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"5524a4d30e1fcea91c4caf147b9afaa107c40cf8","unresolved":false,"context_lines":[{"line_number":427,"context_line":"        \"\"\""},{"line_number":428,"context_line":"        self.stats[\u0027diff\u0027] +\u003d 1"},{"line_number":429,"context_line":"        self.logger.increment(\u0027diffs\u0027)"},{"line_number":430,"context_line":"        self.debug(broker, \u0027%s usyncing chunks to %s, starting at row %s\u0027,"},{"line_number":431,"context_line":"                   \u0027%(ip)s:%(port)s/%(device)s\u0027 %"},{"line_number":432,"context_line":"                   http.node,"},{"line_number":433,"context_line":"                   point)"}],"source_content_type":"text/x-python","patch_set":9,"id":"f63e2fdf_0363f65f","line":430,"range":{"start_line":430,"start_character":28,"end_line":430,"end_character":31},"in_reply_to":"13fdb37e_b06718ea","updated":"2025-08-08 21:02:03.000000000","message":"Done","commit_id":"1a2186ac105c44a8d31f06f1ed96b976912c3b72"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"40d498f2afb354fc57c2d37810e50aaa720956e9","unresolved":true,"context_lines":[{"line_number":447,"context_line":""},{"line_number":448,"context_line":"        self.debug("},{"line_number":449,"context_line":"            broker,"},{"line_number":450,"context_line":"            \u0027%s usyncing chunks to %s, finished at row %s (%gs)\u0027,"},{"line_number":451,"context_line":"            \u0027%(ip)s:%(port)s/%(device)s\u0027 % http.node,"},{"line_number":452,"context_line":"            point,"},{"line_number":453,"context_line":"            time.time() - start"}],"source_content_type":"text/x-python","patch_set":9,"id":"0943b2d6_9bf696d0","line":450,"range":{"start_line":450,"start_character":13,"end_line":450,"end_character":16},"updated":"2025-08-07 22:25:46.000000000","message":"Here, too.","commit_id":"1a2186ac105c44a8d31f06f1ed96b976912c3b72"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"5524a4d30e1fcea91c4caf147b9afaa107c40cf8","unresolved":false,"context_lines":[{"line_number":447,"context_line":""},{"line_number":448,"context_line":"        self.debug("},{"line_number":449,"context_line":"            broker,"},{"line_number":450,"context_line":"            \u0027%s usyncing chunks to %s, finished at row %s (%gs)\u0027,"},{"line_number":451,"context_line":"            \u0027%(ip)s:%(port)s/%(device)s\u0027 % http.node,"},{"line_number":452,"context_line":"            point,"},{"line_number":453,"context_line":"            time.time() - start"}],"source_content_type":"text/x-python","patch_set":9,"id":"3a91a479_facb6764","line":450,"range":{"start_line":450,"start_character":13,"end_line":450,"end_character":16},"in_reply_to":"0943b2d6_9bf696d0","updated":"2025-08-08 21:02:03.000000000","message":"Acknowledged","commit_id":"1a2186ac105c44a8d31f06f1ed96b976912c3b72"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"40d498f2afb354fc57c2d37810e50aaa720956e9","unresolved":true,"context_lines":[{"line_number":562,"context_line":"    def _choose_replication_mode(self, node, rinfo, info, local_sync, broker,"},{"line_number":563,"context_line":"                                 http, different_region):"},{"line_number":564,"context_line":"        if self._in_sync(rinfo, info, broker, local_sync):"},{"line_number":565,"context_line":"            self.debug(broker, \u0027in sync with %s, nothing to do\u0027"},{"line_number":566,"context_line":"                       \u0027%(ip)s:%(port)s/%(device)s\u0027 % node)"},{"line_number":567,"context_line":"            return True"},{"line_number":568,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"649ecff3_536ebbcd","line":565,"updated":"2025-08-07 22:25:46.000000000","message":"Lost the comma here.","commit_id":"1a2186ac105c44a8d31f06f1ed96b976912c3b72"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"5524a4d30e1fcea91c4caf147b9afaa107c40cf8","unresolved":false,"context_lines":[{"line_number":562,"context_line":"    def _choose_replication_mode(self, node, rinfo, info, local_sync, broker,"},{"line_number":563,"context_line":"                                 http, different_region):"},{"line_number":564,"context_line":"        if self._in_sync(rinfo, info, broker, local_sync):"},{"line_number":565,"context_line":"            self.debug(broker, \u0027in sync with %s, nothing to do\u0027"},{"line_number":566,"context_line":"                       \u0027%(ip)s:%(port)s/%(device)s\u0027 % node)"},{"line_number":567,"context_line":"            return True"},{"line_number":568,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"d96300a1_48f3efbd","line":565,"in_reply_to":"649ecff3_536ebbcd","updated":"2025-08-08 21:02:03.000000000","message":"Acknowledged","commit_id":"1a2186ac105c44a8d31f06f1ed96b976912c3b72"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"40d498f2afb354fc57c2d37810e50aaa720956e9","unresolved":true,"context_lines":[{"line_number":961,"context_line":"        yield"},{"line_number":962,"context_line":"        timespan \u003d time.time() - timemark"},{"line_number":963,"context_line":"        if timespan \u003e DEBUG_TIMINGS_THRESHOLD:"},{"line_number":964,"context_line":"            self.logger.debug("},{"line_number":965,"context_line":"                \u0027replicator-rpc-sync time for %s: %.02fs\u0027 % (name, timespan))"},{"line_number":966,"context_line":""},{"line_number":967,"context_line":"    def _parse_sync_args(self, args):"}],"source_content_type":"text/x-python","patch_set":9,"id":"b1029232_b981ed73","line":964,"updated":"2025-08-07 22:25:46.000000000","message":"Not `self.debug(broker, ...)`? Of course, it\u0027d require that we update `debug_timing`\u0027s signature to take a broker, but I think the caller should always have one on hand.","commit_id":"1a2186ac105c44a8d31f06f1ed96b976912c3b72"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"f970959920e0cebf9f0936b5240b56e7c8659db8","unresolved":true,"context_lines":[{"line_number":961,"context_line":"        yield"},{"line_number":962,"context_line":"        timespan \u003d time.time() - timemark"},{"line_number":963,"context_line":"        if timespan \u003e DEBUG_TIMINGS_THRESHOLD:"},{"line_number":964,"context_line":"            self.logger.debug("},{"line_number":965,"context_line":"                \u0027replicator-rpc-sync time for %s: %.02fs\u0027 % (name, timespan))"},{"line_number":966,"context_line":""},{"line_number":967,"context_line":"    def _parse_sync_args(self, args):"}],"source_content_type":"text/x-python","patch_set":9,"id":"c0301e75_7435839b","line":964,"in_reply_to":"a09b0418_fd2dae40","updated":"2025-08-21 23:12:53.000000000","message":"The hunk off diff has improved in the newer revisions, please let me know if you\u0027re still seeing them. I will try to modify my editor settings to make the code formatting appear better","commit_id":"1a2186ac105c44a8d31f06f1ed96b976912c3b72"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"875e1a38455dd65abd2f2109d74e1f4b4241415d","unresolved":true,"context_lines":[{"line_number":961,"context_line":"        yield"},{"line_number":962,"context_line":"        timespan \u003d time.time() - timemark"},{"line_number":963,"context_line":"        if timespan \u003e DEBUG_TIMINGS_THRESHOLD:"},{"line_number":964,"context_line":"            self.logger.debug("},{"line_number":965,"context_line":"                \u0027replicator-rpc-sync time for %s: %.02fs\u0027 % (name, timespan))"},{"line_number":966,"context_line":""},{"line_number":967,"context_line":"    def _parse_sync_args(self, args):"}],"source_content_type":"text/x-python","patch_set":9,"id":"a09b0418_fd2dae40","line":964,"in_reply_to":"b1029232_b981ed73","updated":"2025-08-08 20:07:09.000000000","message":"improving the debug timeing may be helpful, but also potentially out of scope - there\u0027s really no end to \"better logging\" - afaik this change was mostly inspired by helping speed up debugging sharding issues in prod so one reasonable way to scope it might be \"all replicator/sharder info/warning/error messages and only *opportunistically* any debug messages while we\u0027re in there\"\n\nHowever, if we\u0027re NOT going to try to make this log statement better then it should NOT show up in the diff.\n\n@nairashwin952013@gmail.com please read ever hunk of of you diff and consider if they can be removed.  AFAICT this was probably some sort of editor auto formatting - having that stuff in a diff is distracting to reviewers and slows down getting your patches merged.","commit_id":"1a2186ac105c44a8d31f06f1ed96b976912c3b72"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"805f976a86ea467ad88c21f296b734692c19d1f9","unresolved":false,"context_lines":[{"line_number":961,"context_line":"        yield"},{"line_number":962,"context_line":"        timespan \u003d time.time() - timemark"},{"line_number":963,"context_line":"        if timespan \u003e DEBUG_TIMINGS_THRESHOLD:"},{"line_number":964,"context_line":"            self.logger.debug("},{"line_number":965,"context_line":"                \u0027replicator-rpc-sync time for %s: %.02fs\u0027 % (name, timespan))"},{"line_number":966,"context_line":""},{"line_number":967,"context_line":"    def _parse_sync_args(self, args):"}],"source_content_type":"text/x-python","patch_set":9,"id":"c0900594_21858e8f","line":964,"in_reply_to":"c0301e75_7435839b","updated":"2025-08-25 21:57:38.000000000","message":"IMHO this thread is resolved since\n\n1) it\u0027s a debug message that doesn\u0027t have a broker in scope already\n2) it\u0027s not changed or molested anyway by this diff","commit_id":"1a2186ac105c44a8d31f06f1ed96b976912c3b72"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"875e1a38455dd65abd2f2109d74e1f4b4241415d","unresolved":true,"context_lines":[{"line_number":275,"context_line":"                try:"},{"line_number":276,"context_line":"                    msg \u003d msg % args"},{"line_number":277,"context_line":"                except TypeError:"},{"line_number":278,"context_line":"                    msg \u003d msg + \u0027\u0027 + \u0027\u0027.join(str(a) for a in args)"},{"line_number":279,"context_line":"            else:"},{"line_number":280,"context_line":"                msg \u003d msg + \u0027\u0027 + \u0027\u0027.join(str(a) for a in args)"},{"line_number":281,"context_line":"        return \u0027%s, path: %s, db: %s\u0027 % (msg, quote(path), db_file)"}],"source_content_type":"text/x-python","patch_set":10,"id":"c51ba15c_3c928b26","line":278,"updated":"2025-08-08 20:07:09.000000000","message":"this is not what we want.\n\nWhen I run\n\n```\npytest swift/test/unit/container/test_replicator.py::TestReplicatorSync::test_diff_capped_sync -vsx\n```\n\nI see log messages like:\n\n```\ntest DEBUG: %s usyncing chunks to %s, starting at row %s10.0.0.1:1001/sdb30, path: a/c, db: /mnt/tmp/tmpfzy30y9d/sda/containers/0/651/1bc27449c6de656c8327f841dd9d2651/1bc27449c6de656c8327f841dd9d2651.db\n```","commit_id":"f33c4bb32009261c2e3205a4d8ba495e19da13a9"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"5524a4d30e1fcea91c4caf147b9afaa107c40cf8","unresolved":false,"context_lines":[{"line_number":275,"context_line":"                try:"},{"line_number":276,"context_line":"                    msg \u003d msg % args"},{"line_number":277,"context_line":"                except TypeError:"},{"line_number":278,"context_line":"                    msg \u003d msg + \u0027\u0027 + \u0027\u0027.join(str(a) for a in args)"},{"line_number":279,"context_line":"            else:"},{"line_number":280,"context_line":"                msg \u003d msg + \u0027\u0027 + \u0027\u0027.join(str(a) for a in args)"},{"line_number":281,"context_line":"        return \u0027%s, path: %s, db: %s\u0027 % (msg, quote(path), db_file)"}],"source_content_type":"text/x-python","patch_set":10,"id":"c956799c_83c2656b","line":278,"in_reply_to":"c51ba15c_3c928b26","updated":"2025-08-08 21:02:03.000000000","message":"Done","commit_id":"f33c4bb32009261c2e3205a4d8ba495e19da13a9"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"875e1a38455dd65abd2f2109d74e1f4b4241415d","unresolved":true,"context_lines":[{"line_number":605,"context_line":"        :return success: returns False if deletion of the database was"},{"line_number":606,"context_line":"            attempted but unsuccessful, otherwise returns True."},{"line_number":607,"context_line":"        \"\"\""},{"line_number":608,"context_line":"        log_template \u003d \u0027Not deleting db \u0027"},{"line_number":609,"context_line":"        max_row_delta \u003d broker.get_max_row() - orig_info[\u0027max_row\u0027]"},{"line_number":610,"context_line":"        if max_row_delta \u003c 0:"},{"line_number":611,"context_line":"            reason \u003d \u0027negative max_row_delta: %s\u0027 % max_row_delta"}],"source_content_type":"text/x-python","patch_set":10,"id":"7f0840b0_b5d4f721","line":608,"updated":"2025-08-08 20:07:09.000000000","message":"how is this even working?  how does `reason` get formatted into the message!?","commit_id":"f33c4bb32009261c2e3205a4d8ba495e19da13a9"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"5524a4d30e1fcea91c4caf147b9afaa107c40cf8","unresolved":false,"context_lines":[{"line_number":605,"context_line":"        :return success: returns False if deletion of the database was"},{"line_number":606,"context_line":"            attempted but unsuccessful, otherwise returns True."},{"line_number":607,"context_line":"        \"\"\""},{"line_number":608,"context_line":"        log_template \u003d \u0027Not deleting db \u0027"},{"line_number":609,"context_line":"        max_row_delta \u003d broker.get_max_row() - orig_info[\u0027max_row\u0027]"},{"line_number":610,"context_line":"        if max_row_delta \u003c 0:"},{"line_number":611,"context_line":"            reason \u003d \u0027negative max_row_delta: %s\u0027 % max_row_delta"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a22f1ce_e0b38f54","line":608,"in_reply_to":"7f0840b0_b5d4f721","updated":"2025-08-08 21:02:03.000000000","message":"Done","commit_id":"f33c4bb32009261c2e3205a4d8ba495e19da13a9"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"53a65637ece9d6a83b24aabf6d955dd08c02e43a","unresolved":true,"context_lines":[{"line_number":272,"context_line":"        db_file, path \u003d self._get_broker_details(broker)"},{"line_number":273,"context_line":"        if args:"},{"line_number":274,"context_line":"            msg \u003d msg % args"},{"line_number":275,"context_line":"        return \u0027%s, db: %s, path: %s\u0027 % (msg, db_file, quote(path))"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"    def _log(self, level, broker, msg, *args):"},{"line_number":278,"context_line":"        if not self.logger.isEnabledFor(level):"}],"source_content_type":"text/x-python","patch_set":12,"id":"464d87c0_c12770cc","line":275,"updated":"2025-08-11 09:22:58.000000000","message":"this all appears to be a faithful copy of the existing code in sharder.py relocated to db_replicator.py, except the order of the db file and path has been switched in the logs. I assume that was deliberate, but you haven\u0027t changed any of the unit tests to match the change here.\n\nWhy did you feel that it was necessary/better to switch the order?","commit_id":"c5b89dd4f6090a829d99b27a8f7d99fe06250845"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"a98db65fbf3bf9a8395253a96c00e099a914b4e4","unresolved":true,"context_lines":[{"line_number":272,"context_line":"        db_file, path \u003d self._get_broker_details(broker)"},{"line_number":273,"context_line":"        if args:"},{"line_number":274,"context_line":"            msg \u003d msg % args"},{"line_number":275,"context_line":"        return \u0027%s, db: %s, path: %s\u0027 % (msg, db_file, quote(path))"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"    def _log(self, level, broker, msg, *args):"},{"line_number":278,"context_line":"        if not self.logger.isEnabledFor(level):"}],"source_content_type":"text/x-python","patch_set":12,"id":"397a7ea7_cf5ec1f5","line":275,"in_reply_to":"350fbc50_0d594b09","updated":"2025-08-13 20:33:46.000000000","message":"\u003e you haven\u0027t changed any of the unit tests to match the change here\n\n@alistairncoles@gmail.com if you look at this diff closely almost every diff was changed to account for the switched out order for db being first, followed by path [11..12/test/unit/common/test_db_replicator.py](ref: https://review.opendev.org/c/openstack/swift/+/933379/11..12/test/unit/common/test_db_replicator.py)","commit_id":"c5b89dd4f6090a829d99b27a8f7d99fe06250845"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"7a6d0ddede1239b201049a58055303f1c527ddcc","unresolved":true,"context_lines":[{"line_number":272,"context_line":"        db_file, path \u003d self._get_broker_details(broker)"},{"line_number":273,"context_line":"        if args:"},{"line_number":274,"context_line":"            msg \u003d msg % args"},{"line_number":275,"context_line":"        return \u0027%s, db: %s, path: %s\u0027 % (msg, db_file, quote(path))"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"    def _log(self, level, broker, msg, *args):"},{"line_number":278,"context_line":"        if not self.logger.isEnabledFor(level):"}],"source_content_type":"text/x-python","patch_set":12,"id":"b1f86c42_ce302aae","line":275,"in_reply_to":"397a7ea7_cf5ec1f5","updated":"2025-08-14 08:41:31.000000000","message":"@Ash I am looking closely at patchset 12 and you had not changed anything in test_sharder.py.\n\nHence on patchset 12 you see the test failures below.\n\nYou have now in this patchset changed all test_sharder.py tests, but I do not understand your motivation for switching the order in which the db file and path are reported, and creating so much churn as a result. I was expecting there to be *no* changes in test_sharder.py, partly because that would reassure me that the relocation of the logging code to the superclass was all ok.\n\nDo you perceive a problem with the previous logging format? If not, please don\u0027t change it. As @Clay pointed out, someone may be parsing the existing log line.\n\nzuul reported on patchset 12:\n```\nFAILED test/unit/container/test_sharder.py::TestSharder::test_audit_deleted_root_container - AssertionError: Lists differ: [\u0027Rec[36 chars]ing, path: a/c, db: /home/zuul/xfstmp/tmpcr_88[90 chars].db\u0027] !\u003d [\u0027Rec[36 chars]ing, db: /home/zuul...\nFAILED test/unit/container/test_sharder.py::TestSharder::test_audit_old_style_shard_container - AssertionError: \u0027path: bad_account/shard_c, db: /home/zuul/xfstmp/tmp9kn8gobi/sda/containers/0/f3b/b3fac948f9f029603d4248b5e2d39f3b/b3fac948f...\nFAILED test/unit/container/test_sharder.py::TestSharder::test_audit_root_container - AssertionError: \u0027path: a/c, db: /home/zuul/xfstmp/tmpaq89bcyk/sda/containers/0/f33/4a8a08f09d37b73795649038408b5f33/4a8a08f09d37b73795649038408b5f33.db\u0027...\nFAILED test/unit/container/test_sharder.py::TestSharder::test_audit_shard_container - AssertionError: \u0027path: bad_account/shard_c, db: /home/zuul/xfstmp/tmpms831lyl/sda/containers/0/f3b/b3fac948f9f029603d4248b5e2d39f3b/b3fac948f9f029603d4...\nFAILED test/unit/container/test_sharder.py::TestSharder::test_cleave_repeated - AssertionError: Lists differ: [\"Kic[58 chars]ng\u0027, path: a/c, db: /home/zuul/xfstmp/tmpecqp_[291 chars].db\u0027] !\u003d [\"Kic[58 chars]ng\u0027, db: /home/zuul/xfstmp/tmpe...\nFAILED test/unit/container/test_sharder.py::TestSharder::test_cleave_shard_range_no_own_shard_range - AssertionError: \u0027Fail[22 chars]nge, db: /home/zuul/xfstmp/tmpoqhvo_sm/sda/con[89 chars] a/c\u0027 !\u003d \u0027Fail[22 chars]nge, path: a/c, db: /hom...\nFAILED test/unit/container/test_sharder.py::TestSharder::test_cleave_timing_metrics - AssertionError: \u0027Star[20 chars]do), path: a/c, db: /home/zuul/xfstmp/tmpt0k68[106 chars]9.db\u0027 !\u003d \u0027Star[20 chars]do), db: /home/zuul/xfstmp/tmpt0k68hpb/...\nFAILED test/unit/container/test_sharder.py::TestSharder::test_complete_sharding_missing_own_shard_range - AssertionError: \u0027Fail[22 chars]nge, db: /home/zuul/xfstmp/tmp6ki863y_/sda/con[106 chars] a/c\u0027 !\u003d \u0027Fail[22 chars]nge, path: a/c, db:...\nFAILED test/unit/container/test_sharder.py::TestSharder::test_log_broker - AssertionError: Lists differ: [\u0027bonjour mes amis, path: a/c%40d, db: /home/zuul/xfstmp/tmpd[423 chars].db\u0027] !\u003d [\u0027bonjour mes amis, db: /home/zuul/xfstmp/tmpde3itn...\nFAILED test/unit/container/test_sharder.py::TestSharder::test_log_broker_exception - AssertionError: Lists differ: [\u0027exception: test, path: a/c, db: /home/zuul/xfstmp/tmp1oe21[92 chars]b: \u0027] !\u003d [\u0027exception: test, db: /home/zuul/xfstmp/tm...\nFAILED test/unit/container/test_sharder.py::TestSharder::test_log_broker_exception_while_logging - AssertionError: Lists differ: [\u0027bonjour mes amis, path: , db: /home/zuul/xfstmp/tmpb_knunjx[124 chars]b: \u0027] !\u003d [\u0027bonjour mes amis, db: /ho...\nFAILED test/unit/container/test_sharder.py::TestSharder::test_periodic_warning - AssertionError: Lists differ: [\u0027periodic warning 1, path: a/c1, db: /home/zuul/xfstmp/tmprdd7[1676 chars].db\u0027] !\u003d [\u0027periodic warning 1, db: /home/zuul/xfstm...\nFAILED test/unit/container/test_sharder.py::TestSharder::test_process_broker_sharding_completes_with_own_and_other_ranges - AssertionError: \u0027Completed creating 2 shard range containers, path: a/c, db: /home/zuul/xfstmp/tmp1q574jop/sda/co...\nFAILED test/unit/container/test_sharder.py::TestSharder::test_send_shard_ranges - AssertionError: Lists differ: [True] !\u003d [False]\n```","commit_id":"c5b89dd4f6090a829d99b27a8f7d99fe06250845"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ee99bf437df4fe26947fe314236a9cc1d9935536","unresolved":true,"context_lines":[{"line_number":272,"context_line":"        db_file, path \u003d self._get_broker_details(broker)"},{"line_number":273,"context_line":"        if args:"},{"line_number":274,"context_line":"            msg \u003d msg % args"},{"line_number":275,"context_line":"        return \u0027%s, db: %s, path: %s\u0027 % (msg, db_file, quote(path))"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"    def _log(self, level, broker, msg, *args):"},{"line_number":278,"context_line":"        if not self.logger.isEnabledFor(level):"}],"source_content_type":"text/x-python","patch_set":12,"id":"350fbc50_0d594b09","line":275,"in_reply_to":"464d87c0_c12770cc","updated":"2025-08-11 15:58:26.000000000","message":"\u003e better to switch the order\n\nI had noticed the tuple returned the values in an order opposite of the logging - because of their close relationship/proximity I would support some attention/effort to consistency - but if we\u0027re going to change anything I\u0027d prefer it be the return order in the tuple - as the log line is a kind of \"interface\" to any log parsing alerting machinery.","commit_id":"c5b89dd4f6090a829d99b27a8f7d99fe06250845"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"01b45c5494fa8905e6a1eb517e55132e4a18c792","unresolved":false,"context_lines":[{"line_number":272,"context_line":"        db_file, path \u003d self._get_broker_details(broker)"},{"line_number":273,"context_line":"        if args:"},{"line_number":274,"context_line":"            msg \u003d msg % args"},{"line_number":275,"context_line":"        return \u0027%s, db: %s, path: %s\u0027 % (msg, db_file, quote(path))"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"    def _log(self, level, broker, msg, *args):"},{"line_number":278,"context_line":"        if not self.logger.isEnabledFor(level):"}],"source_content_type":"text/x-python","patch_set":12,"id":"b1c267dd_639b4da0","line":275,"in_reply_to":"b1f86c42_ce302aae","updated":"2025-08-21 01:09:16.000000000","message":"Done","commit_id":"c5b89dd4f6090a829d99b27a8f7d99fe06250845"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"53a65637ece9d6a83b24aabf6d955dd08c02e43a","unresolved":true,"context_lines":[{"line_number":379,"context_line":"        remote_file \u003d \u0027%s/%s\u0027 % (rsync_module, rsync_path)"},{"line_number":380,"context_line":"        mtime \u003d os.path.getmtime(broker.db_file)"},{"line_number":381,"context_line":"        if not self._rsync_file(db_file\u003dbroker.db_file,"},{"line_number":382,"context_line":"                                remote_file\u003dremote_file,"},{"line_number":383,"context_line":"                                different_region\u003ddifferent_region):"},{"line_number":384,"context_line":"            return False"},{"line_number":385,"context_line":"        # perform block-level sync if the db was modified during the first sync"}],"source_content_type":"text/x-python","patch_set":12,"id":"688e0dce_7dfe53be","line":382,"updated":"2025-08-11 09:22:58.000000000","message":"this change seems unrelated and (I think) unnecessary.\n\nPerhaps you\u0027d started thinking about passing broker to ``_rsync_file`` so that the logger.error could be annotated at line 358, but even then you don\u0027t *need* to pass positional args as named args.","commit_id":"c5b89dd4f6090a829d99b27a8f7d99fe06250845"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"a98db65fbf3bf9a8395253a96c00e099a914b4e4","unresolved":false,"context_lines":[{"line_number":379,"context_line":"        remote_file \u003d \u0027%s/%s\u0027 % (rsync_module, rsync_path)"},{"line_number":380,"context_line":"        mtime \u003d os.path.getmtime(broker.db_file)"},{"line_number":381,"context_line":"        if not self._rsync_file(db_file\u003dbroker.db_file,"},{"line_number":382,"context_line":"                                remote_file\u003dremote_file,"},{"line_number":383,"context_line":"                                different_region\u003ddifferent_region):"},{"line_number":384,"context_line":"            return False"},{"line_number":385,"context_line":"        # perform block-level sync if the db was modified during the first sync"}],"source_content_type":"text/x-python","patch_set":12,"id":"4539b0ad_6bbfb37c","line":382,"in_reply_to":"688e0dce_7dfe53be","updated":"2025-08-13 20:33:46.000000000","message":"Acknowledged","commit_id":"c5b89dd4f6090a829d99b27a8f7d99fe06250845"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"53a65637ece9d6a83b24aabf6d955dd08c02e43a","unresolved":true,"context_lines":[{"line_number":599,"context_line":"        :return success: returns False if deletion of the database was"},{"line_number":600,"context_line":"            attempted but unsuccessful, otherwise returns True."},{"line_number":601,"context_line":"        \"\"\""},{"line_number":602,"context_line":"        log_template \u003d \u0027Not deleting %s\u0027"},{"line_number":603,"context_line":"        max_row_delta \u003d broker.get_max_row() - orig_info[\u0027max_row\u0027]"},{"line_number":604,"context_line":"        if max_row_delta \u003c 0:"},{"line_number":605,"context_line":"            reason \u003d \u0027negative max_row_delta: %s\u0027 % max_row_delta"}],"source_content_type":"text/x-python","patch_set":12,"id":"3eb12e31_6424a487","line":602,"range":{"start_line":602,"start_character":37,"end_line":602,"end_character":39},"updated":"2025-08-11 09:22:58.000000000","message":"you\u0027ve lost the parentheses that were applied at line 607 on master. The messages are much clearer with the parentheses i.e. ``Not deleting (\u003creason\u003e)``","commit_id":"c5b89dd4f6090a829d99b27a8f7d99fe06250845"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"a98db65fbf3bf9a8395253a96c00e099a914b4e4","unresolved":false,"context_lines":[{"line_number":599,"context_line":"        :return success: returns False if deletion of the database was"},{"line_number":600,"context_line":"            attempted but unsuccessful, otherwise returns True."},{"line_number":601,"context_line":"        \"\"\""},{"line_number":602,"context_line":"        log_template \u003d \u0027Not deleting %s\u0027"},{"line_number":603,"context_line":"        max_row_delta \u003d broker.get_max_row() - orig_info[\u0027max_row\u0027]"},{"line_number":604,"context_line":"        if max_row_delta \u003c 0:"},{"line_number":605,"context_line":"            reason \u003d \u0027negative max_row_delta: %s\u0027 % max_row_delta"}],"source_content_type":"text/x-python","patch_set":12,"id":"fe94b915_e98d9e47","line":602,"range":{"start_line":602,"start_character":37,"end_line":602,"end_character":39},"in_reply_to":"3eb12e31_6424a487","updated":"2025-08-13 20:33:46.000000000","message":"Done","commit_id":"c5b89dd4f6090a829d99b27a8f7d99fe06250845"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"53a65637ece9d6a83b24aabf6d955dd08c02e43a","unresolved":true,"context_lines":[{"line_number":674,"context_line":"                    \u0027replicate out and remove\u0027 % bpart)"},{"line_number":675,"context_line":"        except (Exception, Timeout) as e:"},{"line_number":676,"context_line":"            if \u0027no such table\u0027 in str(e):"},{"line_number":677,"context_line":"                self.error(broker, \u0027Quarantining DB \u0027)"},{"line_number":678,"context_line":"                quarantine_db(broker.db_file, broker.db_type)"},{"line_number":679,"context_line":"            else:"},{"line_number":680,"context_line":"                self.exception(broker, \u0027ERROR reading db %s\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"8d918c81_e6833252","line":677,"range":{"start_line":677,"start_character":27,"end_line":677,"end_character":33},"updated":"2025-08-11 09:22:58.000000000","message":"``broker`` is instantiated inside the ``try`` clause so you cannot assume it exists here. My IDE warns me of this.\n\nalso, nit: the trailing whitespace in the message isn\u0027t needed.","commit_id":"c5b89dd4f6090a829d99b27a8f7d99fe06250845"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"a98db65fbf3bf9a8395253a96c00e099a914b4e4","unresolved":false,"context_lines":[{"line_number":674,"context_line":"                    \u0027replicate out and remove\u0027 % bpart)"},{"line_number":675,"context_line":"        except (Exception, Timeout) as e:"},{"line_number":676,"context_line":"            if \u0027no such table\u0027 in str(e):"},{"line_number":677,"context_line":"                self.error(broker, \u0027Quarantining DB \u0027)"},{"line_number":678,"context_line":"                quarantine_db(broker.db_file, broker.db_type)"},{"line_number":679,"context_line":"            else:"},{"line_number":680,"context_line":"                self.exception(broker, \u0027ERROR reading db %s\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"b164ca68_ad70f3ce","line":677,"range":{"start_line":677,"start_character":27,"end_line":677,"end_character":33},"in_reply_to":"792887c2_4713d826","updated":"2025-08-13 20:33:46.000000000","message":"Done","commit_id":"c5b89dd4f6090a829d99b27a8f7d99fe06250845"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ee99bf437df4fe26947fe314236a9cc1d9935536","unresolved":true,"context_lines":[{"line_number":674,"context_line":"                    \u0027replicate out and remove\u0027 % bpart)"},{"line_number":675,"context_line":"        except (Exception, Timeout) as e:"},{"line_number":676,"context_line":"            if \u0027no such table\u0027 in str(e):"},{"line_number":677,"context_line":"                self.error(broker, \u0027Quarantining DB \u0027)"},{"line_number":678,"context_line":"                quarantine_db(broker.db_file, broker.db_type)"},{"line_number":679,"context_line":"            else:"},{"line_number":680,"context_line":"                self.exception(broker, \u0027ERROR reading db %s\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"792887c2_4713d826","line":677,"range":{"start_line":677,"start_character":27,"end_line":677,"end_character":33},"in_reply_to":"8d918c81_e6833252","updated":"2025-08-11 15:58:26.000000000","message":"\u003e My IDE warns me of this.\n\nI\u0027m a little surprised flake8 does not:\n\n```\n(name_error) cgerrard@NVStation:/tmp/name_error$ flake8 name_error.py \nname_error.py:2:11: F821 undefined name \u0027bar\u0027\n(name_error) cgerrard@NVStation:/tmp/name_error$ cat name_error.py \ntry:\n    foo \u003d bar\nexcept Exception:\n    print(foo)\n(name_error) cgerrard@NVStation:/tmp/name_error$ python3 name_error.py \nTraceback (most recent call last):\n  File \"/tmp/name_error/name_error.py\", line 2, in \u003cmodule\u003e\n    foo \u003d bar\n          ^^^\nNameError: name \u0027bar\u0027 is not defined\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n  File \"/tmp/name_error/name_error.py\", line 4, in \u003cmodule\u003e\n    print(foo)\n          ^^^\nNameError: name \u0027foo\u0027 is not defined\n```\n\nFWIW vscode/cursor didn\u0027t complain either.  But at least in else block, for sure broker might NameError (e.g. permission denied).\n\nI think `broker \u003d None` ahead of the `try` would prevent the NameError, but still runs the risk of loosing the object_file in the log message.\n\nYou could do:\n\n```\nif \u0027broker\u0027 in locals():\n    self.exception(broker, msg)\nelse:\n    self.logger.exception(\u0027Unable to load broker from %s\u0027, object_file)\n```","commit_id":"c5b89dd4f6090a829d99b27a8f7d99fe06250845"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"53a65637ece9d6a83b24aabf6d955dd08c02e43a","unresolved":true,"context_lines":[{"line_number":678,"context_line":"                quarantine_db(broker.db_file, broker.db_type)"},{"line_number":679,"context_line":"            else:"},{"line_number":680,"context_line":"                self.exception(broker, \u0027ERROR reading db %s\u0027,"},{"line_number":681,"context_line":"                               object_file)"},{"line_number":682,"context_line":"            nodes \u003d self.ring.get_part_nodes(int(partition))"},{"line_number":683,"context_line":"            self._add_failure_stats([(failure_dev[\u0027replication_ip\u0027],"},{"line_number":684,"context_line":"                                      failure_dev[\u0027device\u0027])"}],"source_content_type":"text/x-python","patch_set":12,"id":"99f78259_19c34f1f","line":681,"updated":"2025-08-11 09:22:58.000000000","message":"notwithstanding my previous comment, this is now logging the db file twice because ``object_file`` *is* the ``db file``.\n\nHowever, you either need to convince yourself that line 660 can be moved outside of the ``try``, or unwind these changes. Personally, even though I *think* it would be *probably* be ok, I would cowardly avoid changing the scope of the ``try``. The messages I really care about are those to do with the sharder lifecycle, and I could live with these log messages remaining as they have always been.","commit_id":"c5b89dd4f6090a829d99b27a8f7d99fe06250845"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"a98db65fbf3bf9a8395253a96c00e099a914b4e4","unresolved":false,"context_lines":[{"line_number":678,"context_line":"                quarantine_db(broker.db_file, broker.db_type)"},{"line_number":679,"context_line":"            else:"},{"line_number":680,"context_line":"                self.exception(broker, \u0027ERROR reading db %s\u0027,"},{"line_number":681,"context_line":"                               object_file)"},{"line_number":682,"context_line":"            nodes \u003d self.ring.get_part_nodes(int(partition))"},{"line_number":683,"context_line":"            self._add_failure_stats([(failure_dev[\u0027replication_ip\u0027],"},{"line_number":684,"context_line":"                                      failure_dev[\u0027device\u0027])"}],"source_content_type":"text/x-python","patch_set":12,"id":"40250105_e4d5277b","line":681,"in_reply_to":"99f78259_19c34f1f","updated":"2025-08-13 20:33:46.000000000","message":"Done","commit_id":"c5b89dd4f6090a829d99b27a8f7d99fe06250845"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"53a65637ece9d6a83b24aabf6d955dd08c02e43a","unresolved":true,"context_lines":[{"line_number":783,"context_line":"                elif err.errno \u003d\u003d errno.ENOENT:"},{"line_number":784,"context_line":"                    continue"},{"line_number":785,"context_line":"                else:"},{"line_number":786,"context_line":"                    self.logger.exception("},{"line_number":787,"context_line":"                        \u0027ERROR while trying to clean up %s\u0027, parent_dir)"},{"line_number":788,"context_line":"                    return False"},{"line_number":789,"context_line":"        return True"}],"source_content_type":"text/x-python","patch_set":12,"id":"c0a0a531_b3fc6845","line":786,"range":{"start_line":786,"start_character":20,"end_line":786,"end_character":41},"updated":"2025-08-11 09:22:58.000000000","message":"this could be ``self.exception(broker, ...)``","commit_id":"c5b89dd4f6090a829d99b27a8f7d99fe06250845"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ee99bf437df4fe26947fe314236a9cc1d9935536","unresolved":true,"context_lines":[{"line_number":783,"context_line":"                elif err.errno \u003d\u003d errno.ENOENT:"},{"line_number":784,"context_line":"                    continue"},{"line_number":785,"context_line":"                else:"},{"line_number":786,"context_line":"                    self.logger.exception("},{"line_number":787,"context_line":"                        \u0027ERROR while trying to clean up %s\u0027, parent_dir)"},{"line_number":788,"context_line":"                    return False"},{"line_number":789,"context_line":"        return True"}],"source_content_type":"text/x-python","patch_set":12,"id":"d5e709bc_d013a00a","line":786,"range":{"start_line":786,"start_character":20,"end_line":786,"end_character":41},"in_reply_to":"c0a0a531_b3fc6845","updated":"2025-08-11 15:58:26.000000000","message":"\u003e It also improves db-replicator logging by including DB file path and container paths\n\nI think this is trying to say that auditing the db_replicator module logging is in scope for this change, so this seems like an oversight.","commit_id":"c5b89dd4f6090a829d99b27a8f7d99fe06250845"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"a98db65fbf3bf9a8395253a96c00e099a914b4e4","unresolved":false,"context_lines":[{"line_number":783,"context_line":"                elif err.errno \u003d\u003d errno.ENOENT:"},{"line_number":784,"context_line":"                    continue"},{"line_number":785,"context_line":"                else:"},{"line_number":786,"context_line":"                    self.logger.exception("},{"line_number":787,"context_line":"                        \u0027ERROR while trying to clean up %s\u0027, parent_dir)"},{"line_number":788,"context_line":"                    return False"},{"line_number":789,"context_line":"        return True"}],"source_content_type":"text/x-python","patch_set":12,"id":"e39d470c_c4566ea2","line":786,"range":{"start_line":786,"start_character":20,"end_line":786,"end_character":41},"in_reply_to":"d5e709bc_d013a00a","updated":"2025-08-13 20:33:46.000000000","message":"Done","commit_id":"c5b89dd4f6090a829d99b27a8f7d99fe06250845"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"512447750c70d90602b79cdbf33c76dcbf8035d8","unresolved":true,"context_lines":[{"line_number":420,"context_line":"        self.logger.increment(\u0027diffs\u0027)"},{"line_number":421,"context_line":"        self.debug(broker, \u0027usyncing chunks to %s, starting at row %s\u0027,"},{"line_number":422,"context_line":"                   \u0027%(ip)s:%(port)s/%(device)s\u0027 %"},{"line_number":423,"context_line":"                   http.node,"},{"line_number":424,"context_line":"                   point)"},{"line_number":425,"context_line":"        start \u003d time.time()"},{"line_number":426,"context_line":"        sync_table \u003d broker.get_syncs()"}],"source_content_type":"text/x-python","patch_set":18,"id":"608cca1a_514fbc88","line":423,"updated":"2025-08-20 13:40:09.000000000","message":"no need for a line wrap here","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"01b45c5494fa8905e6a1eb517e55132e4a18c792","unresolved":false,"context_lines":[{"line_number":420,"context_line":"        self.logger.increment(\u0027diffs\u0027)"},{"line_number":421,"context_line":"        self.debug(broker, \u0027usyncing chunks to %s, starting at row %s\u0027,"},{"line_number":422,"context_line":"                   \u0027%(ip)s:%(port)s/%(device)s\u0027 %"},{"line_number":423,"context_line":"                   http.node,"},{"line_number":424,"context_line":"                   point)"},{"line_number":425,"context_line":"        start \u003d time.time()"},{"line_number":426,"context_line":"        sync_table \u003d broker.get_syncs()"}],"source_content_type":"text/x-python","patch_set":18,"id":"007ab424_cfd6e0fb","line":423,"in_reply_to":"608cca1a_514fbc88","updated":"2025-08-21 01:09:16.000000000","message":"Done","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"01b45c5494fa8905e6a1eb517e55132e4a18c792","unresolved":false,"context_lines":[{"line_number":420,"context_line":"        self.logger.increment(\u0027diffs\u0027)"},{"line_number":421,"context_line":"        self.debug(broker, \u0027usyncing chunks to %s, starting at row %s\u0027,"},{"line_number":422,"context_line":"                   \u0027%(ip)s:%(port)s/%(device)s\u0027 %"},{"line_number":423,"context_line":"                   http.node,"},{"line_number":424,"context_line":"                   point)"},{"line_number":425,"context_line":"        start \u003d time.time()"},{"line_number":426,"context_line":"        sync_table \u003d broker.get_syncs()"}],"source_content_type":"text/x-python","patch_set":18,"id":"2ef7c11d_8cb0647a","line":423,"in_reply_to":"608cca1a_514fbc88","updated":"2025-08-21 01:09:16.000000000","message":"Done","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"512447750c70d90602b79cdbf33c76dcbf8035d8","unresolved":true,"context_lines":[{"line_number":438,"context_line":""},{"line_number":439,"context_line":"        self.debug("},{"line_number":440,"context_line":"            broker,"},{"line_number":441,"context_line":"            \u0027syncing chunks to %s, finished at row %s (%gs)\u0027,"},{"line_number":442,"context_line":"            \u0027%(ip)s:%(port)s/%(device)s\u0027 % http.node,"},{"line_number":443,"context_line":"            point,"},{"line_number":444,"context_line":"            time.time() - start"}],"source_content_type":"text/x-python","patch_set":18,"id":"53543632_1e10d779","line":441,"range":{"start_line":441,"start_character":13,"end_line":441,"end_character":14},"updated":"2025-08-20 13:40:09.000000000","message":"you\u0027ve lost the \u0027u\u0027 at start of \u0027usyncing\u0027","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"01b45c5494fa8905e6a1eb517e55132e4a18c792","unresolved":false,"context_lines":[{"line_number":438,"context_line":""},{"line_number":439,"context_line":"        self.debug("},{"line_number":440,"context_line":"            broker,"},{"line_number":441,"context_line":"            \u0027syncing chunks to %s, finished at row %s (%gs)\u0027,"},{"line_number":442,"context_line":"            \u0027%(ip)s:%(port)s/%(device)s\u0027 % http.node,"},{"line_number":443,"context_line":"            point,"},{"line_number":444,"context_line":"            time.time() - start"}],"source_content_type":"text/x-python","patch_set":18,"id":"a0811c1b_afaaf958","line":441,"range":{"start_line":441,"start_character":13,"end_line":441,"end_character":14},"in_reply_to":"53543632_1e10d779","updated":"2025-08-21 01:09:16.000000000","message":"Done","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"01b45c5494fa8905e6a1eb517e55132e4a18c792","unresolved":false,"context_lines":[{"line_number":438,"context_line":""},{"line_number":439,"context_line":"        self.debug("},{"line_number":440,"context_line":"            broker,"},{"line_number":441,"context_line":"            \u0027syncing chunks to %s, finished at row %s (%gs)\u0027,"},{"line_number":442,"context_line":"            \u0027%(ip)s:%(port)s/%(device)s\u0027 % http.node,"},{"line_number":443,"context_line":"            point,"},{"line_number":444,"context_line":"            time.time() - start"}],"source_content_type":"text/x-python","patch_set":18,"id":"b52ecfad_68a73b0a","line":441,"range":{"start_line":441,"start_character":13,"end_line":441,"end_character":14},"in_reply_to":"53543632_1e10d779","updated":"2025-08-21 01:09:16.000000000","message":"Done","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"512447750c70d90602b79cdbf33c76dcbf8035d8","unresolved":true,"context_lines":[{"line_number":620,"context_line":"        # removed. Callers should have already checked that the db is not on a"},{"line_number":621,"context_line":"        # primary node."},{"line_number":622,"context_line":"        if not self.delete_db(broker):"},{"line_number":623,"context_line":"            self.debug(broker, \u0027Failed to delete\u0027)"},{"line_number":624,"context_line":"            return False"},{"line_number":625,"context_line":"        self.debug(broker, \u0027Successfully deleted\u0027)"},{"line_number":626,"context_line":"        return True"}],"source_content_type":"text/x-python","patch_set":18,"id":"ac9a43ed_8d0fc399","line":623,"updated":"2025-08-20 13:40:09.000000000","message":"please restore the \u0027 db\u0027 to the end of the message","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"01b45c5494fa8905e6a1eb517e55132e4a18c792","unresolved":false,"context_lines":[{"line_number":620,"context_line":"        # removed. Callers should have already checked that the db is not on a"},{"line_number":621,"context_line":"        # primary node."},{"line_number":622,"context_line":"        if not self.delete_db(broker):"},{"line_number":623,"context_line":"            self.debug(broker, \u0027Failed to delete\u0027)"},{"line_number":624,"context_line":"            return False"},{"line_number":625,"context_line":"        self.debug(broker, \u0027Successfully deleted\u0027)"},{"line_number":626,"context_line":"        return True"}],"source_content_type":"text/x-python","patch_set":18,"id":"3de311a3_c1137e2c","line":623,"in_reply_to":"ac9a43ed_8d0fc399","updated":"2025-08-21 01:09:16.000000000","message":"Done","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"01b45c5494fa8905e6a1eb517e55132e4a18c792","unresolved":false,"context_lines":[{"line_number":620,"context_line":"        # removed. Callers should have already checked that the db is not on a"},{"line_number":621,"context_line":"        # primary node."},{"line_number":622,"context_line":"        if not self.delete_db(broker):"},{"line_number":623,"context_line":"            self.debug(broker, \u0027Failed to delete\u0027)"},{"line_number":624,"context_line":"            return False"},{"line_number":625,"context_line":"        self.debug(broker, \u0027Successfully deleted\u0027)"},{"line_number":626,"context_line":"        return True"}],"source_content_type":"text/x-python","patch_set":18,"id":"96fafa71_c9a37612","line":623,"in_reply_to":"ac9a43ed_8d0fc399","updated":"2025-08-21 01:09:16.000000000","message":"Done","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"512447750c70d90602b79cdbf33c76dcbf8035d8","unresolved":true,"context_lines":[{"line_number":622,"context_line":"        if not self.delete_db(broker):"},{"line_number":623,"context_line":"            self.debug(broker, \u0027Failed to delete\u0027)"},{"line_number":624,"context_line":"            return False"},{"line_number":625,"context_line":"        self.debug(broker, \u0027Successfully deleted\u0027)"},{"line_number":626,"context_line":"        return True"},{"line_number":627,"context_line":""},{"line_number":628,"context_line":"    def _reclaim(self, broker, now\u003dNone):"}],"source_content_type":"text/x-python","patch_set":18,"id":"fa926292_325fdc5f","line":625,"updated":"2025-08-20 13:40:09.000000000","message":"please restore the \u0027 db\u0027 to the end of the message","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"01b45c5494fa8905e6a1eb517e55132e4a18c792","unresolved":false,"context_lines":[{"line_number":622,"context_line":"        if not self.delete_db(broker):"},{"line_number":623,"context_line":"            self.debug(broker, \u0027Failed to delete\u0027)"},{"line_number":624,"context_line":"            return False"},{"line_number":625,"context_line":"        self.debug(broker, \u0027Successfully deleted\u0027)"},{"line_number":626,"context_line":"        return True"},{"line_number":627,"context_line":""},{"line_number":628,"context_line":"    def _reclaim(self, broker, now\u003dNone):"}],"source_content_type":"text/x-python","patch_set":18,"id":"128eb980_4d535698","line":625,"in_reply_to":"fa926292_325fdc5f","updated":"2025-08-21 01:09:16.000000000","message":"Done","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"01b45c5494fa8905e6a1eb517e55132e4a18c792","unresolved":false,"context_lines":[{"line_number":622,"context_line":"        if not self.delete_db(broker):"},{"line_number":623,"context_line":"            self.debug(broker, \u0027Failed to delete\u0027)"},{"line_number":624,"context_line":"            return False"},{"line_number":625,"context_line":"        self.debug(broker, \u0027Successfully deleted\u0027)"},{"line_number":626,"context_line":"        return True"},{"line_number":627,"context_line":""},{"line_number":628,"context_line":"    def _reclaim(self, broker, now\u003dNone):"}],"source_content_type":"text/x-python","patch_set":18,"id":"71bb9010_88452240","line":625,"in_reply_to":"fa926292_325fdc5f","updated":"2025-08-21 01:09:16.000000000","message":"Done","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"512447750c70d90602b79cdbf33c76dcbf8035d8","unresolved":true,"context_lines":[{"line_number":633,"context_line":""},{"line_number":634,"context_line":"    def _replicate_object(self, partition, object_file, node_id):"},{"line_number":635,"context_line":"        \"\"\""},{"line_number":636,"context_line":"        Replicate the db, choosing method based on whether it"},{"line_number":637,"context_line":"        already exists on peers."},{"line_number":638,"context_line":""},{"line_number":639,"context_line":"        :param partition: partition to be replicated to"}],"source_content_type":"text/x-python","patch_set":18,"id":"cdb108bf_6f5f602f","line":636,"updated":"2025-08-20 13:40:09.000000000","message":"this change is unrelated and I think very subjective in terms of grammatical correctness, or not","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"01b45c5494fa8905e6a1eb517e55132e4a18c792","unresolved":false,"context_lines":[{"line_number":633,"context_line":""},{"line_number":634,"context_line":"    def _replicate_object(self, partition, object_file, node_id):"},{"line_number":635,"context_line":"        \"\"\""},{"line_number":636,"context_line":"        Replicate the db, choosing method based on whether it"},{"line_number":637,"context_line":"        already exists on peers."},{"line_number":638,"context_line":""},{"line_number":639,"context_line":"        :param partition: partition to be replicated to"}],"source_content_type":"text/x-python","patch_set":18,"id":"70e8bd98_7c9325a7","line":636,"in_reply_to":"cdb108bf_6f5f602f","updated":"2025-08-21 01:09:16.000000000","message":"Acknowledged","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"01b45c5494fa8905e6a1eb517e55132e4a18c792","unresolved":false,"context_lines":[{"line_number":633,"context_line":""},{"line_number":634,"context_line":"    def _replicate_object(self, partition, object_file, node_id):"},{"line_number":635,"context_line":"        \"\"\""},{"line_number":636,"context_line":"        Replicate the db, choosing method based on whether it"},{"line_number":637,"context_line":"        already exists on peers."},{"line_number":638,"context_line":""},{"line_number":639,"context_line":"        :param partition: partition to be replicated to"}],"source_content_type":"text/x-python","patch_set":18,"id":"945d1dae_843f8828","line":636,"in_reply_to":"cdb108bf_6f5f602f","updated":"2025-08-21 01:09:16.000000000","message":"Acknowledged","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"512447750c70d90602b79cdbf33c76dcbf8035d8","unresolved":true,"context_lines":[{"line_number":675,"context_line":"                if broker is None:"},{"line_number":676,"context_line":"                    self.logger.error(\u0027Quarantining DB %s\u0027, object_file)"},{"line_number":677,"context_line":"                else:"},{"line_number":678,"context_line":"                    self.error(broker, \u0027Quarantining DB \u0027)"},{"line_number":679,"context_line":"                quarantine_db(broker.db_file, broker.db_type)"},{"line_number":680,"context_line":"            else:"},{"line_number":681,"context_line":"                if broker is None:"}],"source_content_type":"text/x-python","patch_set":18,"id":"f2b05fd5_0f5533f1","line":678,"range":{"start_line":678,"start_character":55,"end_line":678,"end_character":56},"updated":"2025-08-20 13:40:09.000000000","message":"delete the trailing space","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"01b45c5494fa8905e6a1eb517e55132e4a18c792","unresolved":false,"context_lines":[{"line_number":675,"context_line":"                if broker is None:"},{"line_number":676,"context_line":"                    self.logger.error(\u0027Quarantining DB %s\u0027, object_file)"},{"line_number":677,"context_line":"                else:"},{"line_number":678,"context_line":"                    self.error(broker, \u0027Quarantining DB \u0027)"},{"line_number":679,"context_line":"                quarantine_db(broker.db_file, broker.db_type)"},{"line_number":680,"context_line":"            else:"},{"line_number":681,"context_line":"                if broker is None:"}],"source_content_type":"text/x-python","patch_set":18,"id":"2b8c2646_e7dc5af9","line":678,"range":{"start_line":678,"start_character":55,"end_line":678,"end_character":56},"in_reply_to":"f2b05fd5_0f5533f1","updated":"2025-08-21 01:09:16.000000000","message":"Acknowledged","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"01b45c5494fa8905e6a1eb517e55132e4a18c792","unresolved":false,"context_lines":[{"line_number":675,"context_line":"                if broker is None:"},{"line_number":676,"context_line":"                    self.logger.error(\u0027Quarantining DB %s\u0027, object_file)"},{"line_number":677,"context_line":"                else:"},{"line_number":678,"context_line":"                    self.error(broker, \u0027Quarantining DB \u0027)"},{"line_number":679,"context_line":"                quarantine_db(broker.db_file, broker.db_type)"},{"line_number":680,"context_line":"            else:"},{"line_number":681,"context_line":"                if broker is None:"}],"source_content_type":"text/x-python","patch_set":18,"id":"a5aaedd2_235bd6ac","line":678,"range":{"start_line":678,"start_character":55,"end_line":678,"end_character":56},"in_reply_to":"f2b05fd5_0f5533f1","updated":"2025-08-21 01:09:16.000000000","message":"Done","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"512447750c70d90602b79cdbf33c76dcbf8035d8","unresolved":true,"context_lines":[{"line_number":679,"context_line":"                quarantine_db(broker.db_file, broker.db_type)"},{"line_number":680,"context_line":"            else:"},{"line_number":681,"context_line":"                if broker is None:"},{"line_number":682,"context_line":"                    self.logger.exception(\u0027Unable to load broker from %s\u0027,"},{"line_number":683,"context_line":"                                          object_file)"},{"line_number":684,"context_line":"                else:"},{"line_number":685,"context_line":"                    self.exception(broker, \u0027ERROR reading db\u0027)"}],"source_content_type":"text/x-python","patch_set":18,"id":"447b1f58_26ce4571","line":682,"range":{"start_line":682,"start_character":43,"end_line":682,"end_character":72},"updated":"2025-08-20 13:40:09.000000000","message":"I was expecting _this_ message to remain unchanged i.e. ``ERROR reading db``","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"01b45c5494fa8905e6a1eb517e55132e4a18c792","unresolved":false,"context_lines":[{"line_number":679,"context_line":"                quarantine_db(broker.db_file, broker.db_type)"},{"line_number":680,"context_line":"            else:"},{"line_number":681,"context_line":"                if broker is None:"},{"line_number":682,"context_line":"                    self.logger.exception(\u0027Unable to load broker from %s\u0027,"},{"line_number":683,"context_line":"                                          object_file)"},{"line_number":684,"context_line":"                else:"},{"line_number":685,"context_line":"                    self.exception(broker, \u0027ERROR reading db\u0027)"}],"source_content_type":"text/x-python","patch_set":18,"id":"55da28dc_5af959f4","line":682,"range":{"start_line":682,"start_character":43,"end_line":682,"end_character":72},"in_reply_to":"447b1f58_26ce4571","updated":"2025-08-21 01:09:16.000000000","message":"Acknowledged","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"01b45c5494fa8905e6a1eb517e55132e4a18c792","unresolved":false,"context_lines":[{"line_number":679,"context_line":"                quarantine_db(broker.db_file, broker.db_type)"},{"line_number":680,"context_line":"            else:"},{"line_number":681,"context_line":"                if broker is None:"},{"line_number":682,"context_line":"                    self.logger.exception(\u0027Unable to load broker from %s\u0027,"},{"line_number":683,"context_line":"                                          object_file)"},{"line_number":684,"context_line":"                else:"},{"line_number":685,"context_line":"                    self.exception(broker, \u0027ERROR reading db\u0027)"}],"source_content_type":"text/x-python","patch_set":18,"id":"dd6c0059_c982a693","line":682,"range":{"start_line":682,"start_character":43,"end_line":682,"end_character":72},"in_reply_to":"447b1f58_26ce4571","updated":"2025-08-21 01:09:16.000000000","message":"Acknowledged","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"512447750c70d90602b79cdbf33c76dcbf8035d8","unresolved":true,"context_lines":[{"line_number":751,"context_line":"            self._post_replicate_hook(broker, info, responses)"},{"line_number":752,"context_line":"        except (Exception, Timeout):"},{"line_number":753,"context_line":"            self.exception(broker, \u0027UNHANDLED EXCEPTION: \u0027"},{"line_number":754,"context_line":"                                   \u0027in post replicate\u0027)"},{"line_number":755,"context_line":"        if not shouldbehere:"},{"line_number":756,"context_line":"            if not self.cleanup_post_replicate(broker, info, responses):"},{"line_number":757,"context_line":"                failure_devs_info.update("}],"source_content_type":"text/x-python","patch_set":18,"id":"eaacc549_d5bc6502","line":754,"range":{"start_line":754,"start_character":36,"end_line":754,"end_character":53},"updated":"2025-08-20 13:40:09.000000000","message":"\"in post replicate _hook_\"","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"01b45c5494fa8905e6a1eb517e55132e4a18c792","unresolved":false,"context_lines":[{"line_number":751,"context_line":"            self._post_replicate_hook(broker, info, responses)"},{"line_number":752,"context_line":"        except (Exception, Timeout):"},{"line_number":753,"context_line":"            self.exception(broker, \u0027UNHANDLED EXCEPTION: \u0027"},{"line_number":754,"context_line":"                                   \u0027in post replicate\u0027)"},{"line_number":755,"context_line":"        if not shouldbehere:"},{"line_number":756,"context_line":"            if not self.cleanup_post_replicate(broker, info, responses):"},{"line_number":757,"context_line":"                failure_devs_info.update("}],"source_content_type":"text/x-python","patch_set":18,"id":"4ee39e63_1bb4ffcc","line":754,"range":{"start_line":754,"start_character":36,"end_line":754,"end_character":53},"in_reply_to":"eaacc549_d5bc6502","updated":"2025-08-21 01:09:16.000000000","message":"Acknowledged","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"01b45c5494fa8905e6a1eb517e55132e4a18c792","unresolved":false,"context_lines":[{"line_number":751,"context_line":"            self._post_replicate_hook(broker, info, responses)"},{"line_number":752,"context_line":"        except (Exception, Timeout):"},{"line_number":753,"context_line":"            self.exception(broker, \u0027UNHANDLED EXCEPTION: \u0027"},{"line_number":754,"context_line":"                                   \u0027in post replicate\u0027)"},{"line_number":755,"context_line":"        if not shouldbehere:"},{"line_number":756,"context_line":"            if not self.cleanup_post_replicate(broker, info, responses):"},{"line_number":757,"context_line":"                failure_devs_info.update("}],"source_content_type":"text/x-python","patch_set":18,"id":"be41ee00_83ec4c13","line":754,"range":{"start_line":754,"start_character":36,"end_line":754,"end_character":53},"in_reply_to":"eaacc549_d5bc6502","updated":"2025-08-21 01:09:16.000000000","message":"Done","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"512447750c70d90602b79cdbf33c76dcbf8035d8","unresolved":true,"context_lines":[{"line_number":944,"context_line":"        db_file, path \u003d self._get_broker_details(broker)"},{"line_number":945,"context_line":"        if args:"},{"line_number":946,"context_line":"            msg \u003d msg % args"},{"line_number":947,"context_line":"        return \u0027%s, db: %s, path: %s\u0027 % (msg, db_file, quote(path))"},{"line_number":948,"context_line":""},{"line_number":949,"context_line":"    def _log(self, level, broker, msg, *args):"},{"line_number":950,"context_line":"        if not self.logger.isEnabledFor(level):"}],"source_content_type":"text/x-python","patch_set":18,"id":"f521b2ee_e81df33c","line":947,"updated":"2025-08-20 13:40:09.000000000","message":"We shouldn\u0027t have duplicated code to do the same thing here and in ``Replicator``. I would strongly advocate using a mixin with a single implementation of the annotated log methods.\n\nBefore I noticed that Clay had suggested similar in a follow on, I came up with this https://paste.openstack.org/show/b9wTeRN3wuGjo2zANfPO/\n\nApart from being less code to maintain, it also ensures the goal of _uniform_ logging. Case in point: this is NOT the same as the Replicator logging because the db file and path here are in the opposite order to that in Replicator","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"01b45c5494fa8905e6a1eb517e55132e4a18c792","unresolved":false,"context_lines":[{"line_number":944,"context_line":"        db_file, path \u003d self._get_broker_details(broker)"},{"line_number":945,"context_line":"        if args:"},{"line_number":946,"context_line":"            msg \u003d msg % args"},{"line_number":947,"context_line":"        return \u0027%s, db: %s, path: %s\u0027 % (msg, db_file, quote(path))"},{"line_number":948,"context_line":""},{"line_number":949,"context_line":"    def _log(self, level, broker, msg, *args):"},{"line_number":950,"context_line":"        if not self.logger.isEnabledFor(level):"}],"source_content_type":"text/x-python","patch_set":18,"id":"3a3921cc_4211e73f","line":947,"in_reply_to":"f521b2ee_e81df33c","updated":"2025-08-21 01:09:16.000000000","message":"Acknowledged","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"01b45c5494fa8905e6a1eb517e55132e4a18c792","unresolved":false,"context_lines":[{"line_number":944,"context_line":"        db_file, path \u003d self._get_broker_details(broker)"},{"line_number":945,"context_line":"        if args:"},{"line_number":946,"context_line":"            msg \u003d msg % args"},{"line_number":947,"context_line":"        return \u0027%s, db: %s, path: %s\u0027 % (msg, db_file, quote(path))"},{"line_number":948,"context_line":""},{"line_number":949,"context_line":"    def _log(self, level, broker, msg, *args):"},{"line_number":950,"context_line":"        if not self.logger.isEnabledFor(level):"}],"source_content_type":"text/x-python","patch_set":18,"id":"c6e2a192_d23e0928","line":947,"in_reply_to":"f521b2ee_e81df33c","updated":"2025-08-21 01:09:16.000000000","message":"Done","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"14e47fa60709eafa0767c22348848bbca5561b22","unresolved":true,"context_lines":[{"line_number":180,"context_line":"            return None"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"class AnnotatedLogger:"},{"line_number":184,"context_line":"    \"\"\""},{"line_number":185,"context_line":"    Lightweight adapter that formats log messages with broker details."},{"line_number":186,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"f7d9846f_e9d194f4","line":183,"updated":"2025-08-21 09:19:42.000000000","message":"ok! \n\nThree issues arise from breaking this out:\n\n1. there\u0027s probably a naming debate to be had :/ . AnnotatedLogger is quite generic - we might end up with other annotated loggers - so it might be good to have a nod and a wink to this being specifically related to brokers. IIRC Clay had proposed a very similar mixin called BrokerLogger which definitely improves naming specificity :) but perhaps suggests it is a logger that a broker would use (which it isn\u0027t). Maybe BrokerAnnotatedLogger??\n\n2. where should this class live? IMHO here is just fine, since this is a module in _common_ and it\u0027s only used by classes in this module. An alternative might be swift.common.utils.logs.py but I\u0027m not convinced it is worth moving to utils.\n\n3. Tests! Ideally a class like this would have an accompanying set of unit tests in a matching TestAnnotatedLogger class. IMHO it makes sense for the unit tests to be in a test module that matches the module where the unit (in this case, a class) is defined i.e. test_db_replicator. That\u0027s where I would go and look for a test for this class.\n\nThere are some existing tests in test_sharder (e.g. test.unit.container.test_sharder.TestSharder.test_log_broker and others) which could be repurposed into a TestAnnotatedLogger class.","commit_id":"941e41427c390d407c85fe5f033dcc42aa367527"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"f970959920e0cebf9f0936b5240b56e7c8659db8","unresolved":false,"context_lines":[{"line_number":180,"context_line":"            return None"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"class AnnotatedLogger:"},{"line_number":184,"context_line":"    \"\"\""},{"line_number":185,"context_line":"    Lightweight adapter that formats log messages with broker details."},{"line_number":186,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"052ac0b2_ddd7d2e3","line":183,"in_reply_to":"f7d9846f_e9d194f4","updated":"2025-08-21 23:12:53.000000000","message":"The class has been renamed to BrokerAnnotatedLogger (accounting for your pydoc feedback in a different comment) with a new TestBrokerAnnotatedLogger in test.unit.common.test_db_replicator comprising of all the broker logger tests:\n- test_log_broker\n- test_log_broker_exception\n- test_log_broker_levels\n- test_log_broker_exception_while_logging\nwhich were moved from test.unit.container.test_sharder which sorta also answers questions 2) and 3)","commit_id":"941e41427c390d407c85fe5f033dcc42aa367527"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"14e47fa60709eafa0767c22348848bbca5561b22","unresolved":true,"context_lines":[{"line_number":182,"context_line":""},{"line_number":183,"context_line":"class AnnotatedLogger:"},{"line_number":184,"context_line":"    \"\"\""},{"line_number":185,"context_line":"    Lightweight adapter that formats log messages with broker details."},{"line_number":186,"context_line":""},{"line_number":187,"context_line":"    This class augments messages with the broker\u0027s container path and DB"},{"line_number":188,"context_line":"    file path so that logs are easier to correlate during replication"}],"source_content_type":"text/x-python","patch_set":21,"id":"65867366_dbb54f8b","line":185,"range":{"start_line":185,"start_character":16,"end_line":185,"end_character":23},"updated":"2025-08-21 09:19:42.000000000","message":"note that the term \u0027adapter\u0027 has a specific meaning in the context of logging, and this is *not* a LoggerAdapter  https://docs.python.org/3/library/logging.html#loggeradapter-objects\n\nnit: You could avoid any confusion by just writing \"Formats log messages with broker details.\"","commit_id":"941e41427c390d407c85fe5f033dcc42aa367527"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"f970959920e0cebf9f0936b5240b56e7c8659db8","unresolved":false,"context_lines":[{"line_number":182,"context_line":""},{"line_number":183,"context_line":"class AnnotatedLogger:"},{"line_number":184,"context_line":"    \"\"\""},{"line_number":185,"context_line":"    Lightweight adapter that formats log messages with broker details."},{"line_number":186,"context_line":""},{"line_number":187,"context_line":"    This class augments messages with the broker\u0027s container path and DB"},{"line_number":188,"context_line":"    file path so that logs are easier to correlate during replication"}],"source_content_type":"text/x-python","patch_set":21,"id":"9440c8f7_34a2bf2c","line":185,"range":{"start_line":185,"start_character":16,"end_line":185,"end_character":23},"in_reply_to":"65867366_dbb54f8b","updated":"2025-08-21 23:12:53.000000000","message":"Acknowledged","commit_id":"941e41427c390d407c85fe5f033dcc42aa367527"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"14e47fa60709eafa0767c22348848bbca5561b22","unresolved":true,"context_lines":[{"line_number":187,"context_line":"    This class augments messages with the broker\u0027s container path and DB"},{"line_number":188,"context_line":"    file path so that logs are easier to correlate during replication"},{"line_number":189,"context_line":"    and sharding workflows."},{"line_number":190,"context_line":"    \"\"\""},{"line_number":191,"context_line":"    def __init__(self, conf, logger\u003dNone):"},{"line_number":192,"context_line":"        self.conf \u003d conf"},{"line_number":193,"context_line":"        self.logger \u003d logger or get_logger(conf, log_route\u003d\u0027replicator\u0027)"}],"source_content_type":"text/x-python","patch_set":21,"id":"dcf766cc_497e1023","line":190,"updated":"2025-08-21 09:19:42.000000000","message":"great docstring!","commit_id":"941e41427c390d407c85fe5f033dcc42aa367527"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"f970959920e0cebf9f0936b5240b56e7c8659db8","unresolved":false,"context_lines":[{"line_number":187,"context_line":"    This class augments messages with the broker\u0027s container path and DB"},{"line_number":188,"context_line":"    file path so that logs are easier to correlate during replication"},{"line_number":189,"context_line":"    and sharding workflows."},{"line_number":190,"context_line":"    \"\"\""},{"line_number":191,"context_line":"    def __init__(self, conf, logger\u003dNone):"},{"line_number":192,"context_line":"        self.conf \u003d conf"},{"line_number":193,"context_line":"        self.logger \u003d logger or get_logger(conf, log_route\u003d\u0027replicator\u0027)"}],"source_content_type":"text/x-python","patch_set":21,"id":"981d1a83_2370059e","line":190,"in_reply_to":"dcf766cc_497e1023","updated":"2025-08-21 23:12:53.000000000","message":"Acknowledged","commit_id":"941e41427c390d407c85fe5f033dcc42aa367527"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"8e50f4ef2b61b5e102e71be8347c7f6f4d5fc043","unresolved":true,"context_lines":[{"line_number":180,"context_line":"            return None"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"class BrokerAnnotatedLogger:"},{"line_number":184,"context_line":"    \"\"\""},{"line_number":185,"context_line":"    Formats log messages with broker details."},{"line_number":186,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"10bff304_2715466b","line":183,"updated":"2025-08-26 14:40:32.000000000","message":"OK, at the very least, we oughta rename this to something like `BrokerAnnotatedLoggingMixin` -- which makes it more obvious that `TestBrokerAnnotatedLogger` shouldn\u0027t be instantiating the thing directly (as that\u0027s now how it\u0027s expected to be used), which still has me thinking that the `BrokerAnnotatedLoggingMixin.__init__` is unnecessary.","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4627d5e2d929b3d11a7df8574ddace4541f3eba8","unresolved":true,"context_lines":[{"line_number":180,"context_line":"            return None"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"class BrokerAnnotatedLogger:"},{"line_number":184,"context_line":"    \"\"\""},{"line_number":185,"context_line":"    Formats log messages with broker details."},{"line_number":186,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"7d7e367c_38afae37","line":183,"in_reply_to":"10bff304_2715466b","updated":"2025-09-26 18:02:47.000000000","message":"I\u0027m still keen in the idea of:\n\n```\nself.logger \u003d logger or get_logger()\nself.db_log \u003d BrokerLogger(logger)\n```\n\nI *think* it will be easier to audit:\n\n```\n-self.logger.log(...)\n+self.db_log.log(broker, ...)\n```\n\nthan\n\n```\n-self.logger.log(...)\n+self.log(broker, ...)\n```\n\n... but I could be unfairly preferencing \"composistion over inheritience\"","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"5d33b59db4d781fa7db0060473433c9232d91421","unresolved":false,"context_lines":[{"line_number":180,"context_line":"            return None"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"class BrokerAnnotatedLogger:"},{"line_number":184,"context_line":"    \"\"\""},{"line_number":185,"context_line":"    Formats log messages with broker details."},{"line_number":186,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"0e166c28_344391b2","line":183,"in_reply_to":"2ab92523_e469e091","updated":"2025-09-29 23:35:22.000000000","message":"Acknowledged","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"35b06d7d2a6b84cf209684fff77c7ebb3abec62c","unresolved":true,"context_lines":[{"line_number":180,"context_line":"            return None"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"class BrokerAnnotatedLogger:"},{"line_number":184,"context_line":"    \"\"\""},{"line_number":185,"context_line":"    Formats log messages with broker details."},{"line_number":186,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"2ab92523_e469e091","line":183,"in_reply_to":"7d7e367c_38afae37","updated":"2025-09-29 16:01:56.000000000","message":"\u003e OK, at the very least, we oughta rename this to something like BrokerAnnotatedLoggingMixin\n\nIf you sq in 959609: sq: self.broker_logger to container/sharder | https://review.opendev.org/c/openstack/swift/+/959609 then this name is fine - otherwise this needs to be renamed to highlight it\u0027s use as a MixIn per Tim\u0027s \"at the very least\" comment.","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"805f976a86ea467ad88c21f296b734692c19d1f9","unresolved":true,"context_lines":[{"line_number":200,"context_line":"        try:"},{"line_number":201,"context_line":"            path \u003d broker.path"},{"line_number":202,"context_line":"        except Exception:  # noqa"},{"line_number":203,"context_line":"            path \u003d \u0027\u0027"},{"line_number":204,"context_line":"        return db_file, path"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"    def _format_log_msg(self, broker, msg, *args):"}],"source_content_type":"text/x-python","patch_set":22,"id":"87680225_a4357b79","line":203,"updated":"2025-08-25 21:57:38.000000000","message":"so this is somewhat insidious: \n\n```\n\u003e\u003e\u003e from swift.container.backend import ContainerBroker\n\u003e\u003e\u003e b \u003d ContainerBroker(\u0027/srv/node2/sdb2/containers/951/444/edd5d160a3b17bd826711f454c869444/edd5d160a3b17bd826711f454c869444.db\u0027)\n\u003e\u003e\u003e b.path\n\u0027AUTH_dev/test\u0027\n\u003e\u003e\u003e b.db_file\n\u0027/srv/node2/sdb2/containers/951/444/edd5d160a3b17bd826711f454c869444/edd5d160a3b17bd826711f454c869444.db\u0027\n\u003e\u003e\u003e from swift.account.backend import AccountBroker\n\u003e\u003e\u003e b \u003d AccountBroker(\u0027/srv/node2/sdb2/accounts/920/1a4/e618c667e502cc80575f2c4952b4d1a4/e618c667e502cc80575f2c4952b4d1a4.db\u0027)\n\u003e\u003e\u003e b.path\nTraceback (most recent call last):\n  File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\nAttributeError: \u0027AccountBroker\u0027 object has no attribute \u0027path\u0027\n\u003e\u003e\u003e b.db_file\n\u0027/srv/node2/sdb2/accounts/920/1a4/e618c667e502cc80575f2c4952b4d1a4/e618c667e502cc80575f2c4952b4d1a4.db\u0027\n```\n\nAFAICT the path property is only defined on a ContainerBroker\n\nhttps://github.com/NVIDIA/swift/blob/master/swift/container/backend.py#L527-L530\n\nSo it\u0027s a little non-obvious (disingenuous?  misleading?) to make this a *common* db_replicator behavior.\n\nAlthough I assume since our FakeAccountBroker is defining a path - it might be reasonable if *real* AccountBroker\u0027s grew a path property as well.","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"2662e5bdf68826fff4013a7e20d52c4e0e970ad5","unresolved":true,"context_lines":[{"line_number":200,"context_line":"        try:"},{"line_number":201,"context_line":"            path \u003d broker.path"},{"line_number":202,"context_line":"        except Exception:  # noqa"},{"line_number":203,"context_line":"            path \u003d \u0027\u0027"},{"line_number":204,"context_line":"        return db_file, path"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"    def _format_log_msg(self, broker, msg, *args):"}],"source_content_type":"text/x-python","patch_set":22,"id":"aa5982ac_7e28068a","line":203,"in_reply_to":"87680225_a4357b79","updated":"2025-09-05 17:46:36.000000000","message":"Addressed in a follow-on, ref: https://review.opendev.org/c/openstack/swift/+/959609/6/swift/account/backend.py","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"52ca9c375a1e4bab812dff27396c9be37b08b0b4","unresolved":false,"context_lines":[{"line_number":200,"context_line":"        try:"},{"line_number":201,"context_line":"            path \u003d broker.path"},{"line_number":202,"context_line":"        except Exception:  # noqa"},{"line_number":203,"context_line":"            path \u003d \u0027\u0027"},{"line_number":204,"context_line":"        return db_file, path"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"    def _format_log_msg(self, broker, msg, *args):"}],"source_content_type":"text/x-python","patch_set":22,"id":"cbb93759_4396c982","line":203,"in_reply_to":"aa5982ac_7e28068a","updated":"2025-09-25 17:49:52.000000000","message":"Done","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"805f976a86ea467ad88c21f296b734692c19d1f9","unresolved":true,"context_lines":[{"line_number":207,"context_line":"        # make best effort to include broker properties..."},{"line_number":208,"context_line":"        db_file, path \u003d self._get_broker_details(broker)"},{"line_number":209,"context_line":"        if args:"},{"line_number":210,"context_line":"            msg \u003d msg % args"},{"line_number":211,"context_line":"        return \u0027%s, path: %s, db: %s\u0027 % (msg, quote(path), db_file)"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"    def _log(self, level, broker, msg, *args, **kwargs):"}],"source_content_type":"text/x-python","patch_set":22,"id":"68f81694_b8534cf8","line":210,"updated":"2025-08-25 21:57:38.000000000","message":"we probably *could* support logging \"named argument\" format templates:\n\n```\n\u003e\u003e\u003e logging.debug(\u0027error %s\u0027, {\u0027ip\u0027: \u00271.2.3.4\u0027})\nDEBUG:root:error {\u0027ip\u0027: \u00271.2.3.4\u0027}\n\u003e\u003e\u003e logging.debug(\u0027error %(ip)s\u0027, {\u0027ip\u0027: \u00271.2.3.4\u0027})\nDEBUG:root:error 1.2.3.4\n```\n\nI came up with:\n\n```\ndiff --git a/swift/common/db_replicator.py b/swift/common/db_replicator.py\nindex 2e4ba5852..4651f23cd 100644\n--- a/swift/common/db_replicator.py\n+++ b/swift/common/db_replicator.py\n@@ -207,6 +207,8 @@ class BrokerAnnotatedLogger:\n         # make best effort to include broker properties...\n         db_file, path \u003d self._get_broker_details(broker)\n         if args:\n+            if len(args) \u003d\u003d 1 and isinstance(args[0], dict):\n+                args \u003d args[0]\n             msg \u003d msg % args\n         return \u0027%s, path: %s, db: %s\u0027 % (msg, quote(path), db_file)\n \n```\n\nI\u0027m not sure it\u0027s *that* helpful:\n\n```\n@@ -564,7 +566,7 @@ class Replicator(Daemon, BrokerAnnotatedLogger):\n         if self._in_sync(rinfo, info, broker, local_sync):\n             self.debug(broker,\n                        \u0027in sync with %(ip)s:%(port)s/%(device)s, \u0027\n-                       \u0027nothing to do\u0027 % node)\n+                       \u0027nothing to do\u0027, node)\n             return True\n \n         # if the difference in rowids between the two differs by\n```\n\n... but it\u0027d make `self.debug` slightly more compatible with `self.logger.debug`","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"f5207fa686518e0dcff155462e2e4bea61d53ab4","unresolved":false,"context_lines":[{"line_number":207,"context_line":"        # make best effort to include broker properties..."},{"line_number":208,"context_line":"        db_file, path \u003d self._get_broker_details(broker)"},{"line_number":209,"context_line":"        if args:"},{"line_number":210,"context_line":"            msg \u003d msg % args"},{"line_number":211,"context_line":"        return \u0027%s, path: %s, db: %s\u0027 % (msg, quote(path), db_file)"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"    def _log(self, level, broker, msg, *args, **kwargs):"}],"source_content_type":"text/x-python","patch_set":22,"id":"bcdeb960_58a3c9ce","line":210,"in_reply_to":"68f81694_b8534cf8","updated":"2025-09-05 17:43:05.000000000","message":"Done","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"23fe7c793eaaff27ab9346ac8366684bc051aad2","unresolved":true,"context_lines":[{"line_number":233,"context_line":"        self.logger.exception(self._format_log_msg(broker, msg, *args))"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"class Replicator(Daemon, BrokerAnnotatedLogger):"},{"line_number":237,"context_line":"    \"\"\""},{"line_number":238,"context_line":"    Implements the logic for directing db replication."},{"line_number":239,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":22,"id":"be7ad685_e4708c93","line":236,"updated":"2025-08-25 16:22:47.000000000","message":"Why does the `Replicator` need to be both a `Daemon` and a `BrokerAnnotatedLogger`? Feels weird that we do this instead of `self.logger \u003d BrokerAnnotatedLogger(conf, logger)` down at L243. At it is, I\u0027m not sure `BrokerAnnotatedLogger.__init__` gets run outside of tests...","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"5d33b59db4d781fa7db0060473433c9232d91421","unresolved":false,"context_lines":[{"line_number":233,"context_line":"        self.logger.exception(self._format_log_msg(broker, msg, *args))"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"class Replicator(Daemon, BrokerAnnotatedLogger):"},{"line_number":237,"context_line":"    \"\"\""},{"line_number":238,"context_line":"    Implements the logic for directing db replication."},{"line_number":239,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":22,"id":"e4799e76_d4189afb","line":236,"in_reply_to":"729698c9_f7f33d3a","updated":"2025-09-29 23:35:22.000000000","message":"Acknowledged","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"805f976a86ea467ad88c21f296b734692c19d1f9","unresolved":true,"context_lines":[{"line_number":233,"context_line":"        self.logger.exception(self._format_log_msg(broker, msg, *args))"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"class Replicator(Daemon, BrokerAnnotatedLogger):"},{"line_number":237,"context_line":"    \"\"\""},{"line_number":238,"context_line":"    Implements the logic for directing db replication."},{"line_number":239,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":22,"id":"729698c9_f7f33d3a","line":236,"in_reply_to":"be7ad685_e4708c93","updated":"2025-08-25 21:57:38.000000000","message":"\u003e Composition over inheritance\n\n^ good advice!\n\nThe practical reason that self.logger can\u0027t just *be* a `BrokerAnnotatedLogger` probably has something to do with `self.logger.increment`\n\n... which is maybe unfortunate, but that\u0027s where we\u0027re at.","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"805f976a86ea467ad88c21f296b734692c19d1f9","unresolved":true,"context_lines":[{"line_number":449,"context_line":"        self.debug("},{"line_number":450,"context_line":"            broker,"},{"line_number":451,"context_line":"            \u0027usyncing chunks to %s, finished at row %s (%gs)\u0027,"},{"line_number":452,"context_line":"            \u0027%(ip)s:%(port)s/%(device)s\u0027 % http.node, point,"},{"line_number":453,"context_line":"            time.time() - start"},{"line_number":454,"context_line":"        )"},{"line_number":455,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"6e06a6fc_5c4a5e70","line":452,"updated":"2025-08-25 21:57:38.000000000","message":"the formatting difference here is subtle, consider:\n\n```\nnode_string \u003d \u0027...\u0027 % http.node\nself.debug(broker, \u0027usync ...\u0027, node_string, point, delta_t)\n```\n\nor maybe just:\n\n```\nself.debug(\n    broker,\n    \u0027usync ...\u0027,\n    \u0027...\u0027 % http.node,\n    point,\n    delta_t,\n)\n```\n\nfor added clarity.","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"f5207fa686518e0dcff155462e2e4bea61d53ab4","unresolved":false,"context_lines":[{"line_number":449,"context_line":"        self.debug("},{"line_number":450,"context_line":"            broker,"},{"line_number":451,"context_line":"            \u0027usyncing chunks to %s, finished at row %s (%gs)\u0027,"},{"line_number":452,"context_line":"            \u0027%(ip)s:%(port)s/%(device)s\u0027 % http.node, point,"},{"line_number":453,"context_line":"            time.time() - start"},{"line_number":454,"context_line":"        )"},{"line_number":455,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"7a266dbb_1b4ddd33","line":452,"in_reply_to":"6e06a6fc_5c4a5e70","updated":"2025-09-05 17:43:05.000000000","message":"Done","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"23fe7c793eaaff27ab9346ac8366684bc051aad2","unresolved":true,"context_lines":[{"line_number":631,"context_line":"        if not self.delete_db(broker):"},{"line_number":632,"context_line":"            self.debug(broker, \u0027Failed to delete db\u0027)"},{"line_number":633,"context_line":"            return False"},{"line_number":634,"context_line":"        self.debug(broker, \u0027Successfully deleted db\u0027)"},{"line_number":635,"context_line":"        return True"},{"line_number":636,"context_line":""},{"line_number":637,"context_line":"    def _reclaim(self, broker, now\u003dNone):"}],"source_content_type":"text/x-python","patch_set":22,"id":"5de2eef2_35a2e634","line":634,"updated":"2025-08-25 16:22:47.000000000","message":"OK, so this is one of the places where we expect `path` to just be an empty string, right?","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"805f976a86ea467ad88c21f296b734692c19d1f9","unresolved":true,"context_lines":[{"line_number":631,"context_line":"        if not self.delete_db(broker):"},{"line_number":632,"context_line":"            self.debug(broker, \u0027Failed to delete db\u0027)"},{"line_number":633,"context_line":"            return False"},{"line_number":634,"context_line":"        self.debug(broker, \u0027Successfully deleted db\u0027)"},{"line_number":635,"context_line":"        return True"},{"line_number":636,"context_line":""},{"line_number":637,"context_line":"    def _reclaim(self, broker, now\u003dNone):"}],"source_content_type":"text/x-python","patch_set":22,"id":"d2174090_18cb3efb","line":634,"in_reply_to":"5de2eef2_35a2e634","updated":"2025-08-25 21:57:38.000000000","message":"what do you mean?\n\n```\ntest DEBUG: Successfully deleted db, path: a%20c%20t/c%20o%20n, db: /path/to/file\n```\n\n^ from:\n\n```\ndiff --git a/test/unit/common/test_db_replicator.py b/test/unit/common/test_db_replicator.py\nindex fef08c0ea..7ee1d1bc1 100644\n--- a/test/unit/common/test_db_replicator.py\n+++ b/test/unit/common/test_db_replicator.py\n@@ -988,7 +988,7 @@ class TestDBReplicator(unittest.TestCase):\n     def test_handoff_delete(self):\n         def do_test(config, repl_to_node_results, expect_delete):\n             self.delete_db_calls \u003d []\n-            replicator \u003d ConcreteReplicator(config)\n+            replicator \u003d ConcreteReplicator(config, logger\u003ddebug_logger())\n             replicator.ring \u003d FakeRingWithNodes().Ring(\u0027path\u0027)\n             replicator.brokerclass \u003d FakeAccountBroker\n             mock_repl_to_node \u003d mock.Mock()\n@@ -1032,6 +1032,7 @@ class TestDBReplicator(unittest.TestCase):\n                 ({\u0027handoff_delete\u0027: 5}, [True] * 3, True),\n         ):\n             do_test(cfg, repl_results, expected_delete)\n+        asdf\n \n     def test_replicate_object_delete_delegated_to_cleanup_post_replicate(self):\n         replicator \u003d ConcreteReplicator({})\n```\n\nI do see a lot of:\n\n```\ntest DEBUG: Replicating db /path/to/file\n```\n\n... presumably b/c we don\u0027t have a broker yet?","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"8e50f4ef2b61b5e102e71be8347c7f6f4d5fc043","unresolved":false,"context_lines":[{"line_number":631,"context_line":"        if not self.delete_db(broker):"},{"line_number":632,"context_line":"            self.debug(broker, \u0027Failed to delete db\u0027)"},{"line_number":633,"context_line":"            return False"},{"line_number":634,"context_line":"        self.debug(broker, \u0027Successfully deleted db\u0027)"},{"line_number":635,"context_line":"        return True"},{"line_number":636,"context_line":""},{"line_number":637,"context_line":"    def _reclaim(self, broker, now\u003dNone):"}],"source_content_type":"text/x-python","patch_set":22,"id":"c943c3c2_e0a91bb2","line":634,"in_reply_to":"d2174090_18cb3efb","updated":"2025-08-26 14:40:32.000000000","message":"We just deleted the thing! I guess we still have some metadata loaded...","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"805f976a86ea467ad88c21f296b734692c19d1f9","unresolved":true,"context_lines":[{"line_number":657,"context_line":"            or False."},{"line_number":658,"context_line":"        \"\"\""},{"line_number":659,"context_line":"        start_time \u003d now \u003d time.time()"},{"line_number":660,"context_line":"        self.logger.debug(\u0027Replicating db %s\u0027, object_file)"},{"line_number":661,"context_line":"        self.stats[\u0027attempted\u0027] +\u003d 1"},{"line_number":662,"context_line":"        self.logger.increment(\u0027attempts\u0027)"},{"line_number":663,"context_line":"        shouldbehere \u003d True"}],"source_content_type":"text/x-python","patch_set":22,"id":"5ae03b18_ec5facbd","line":660,"updated":"2025-08-25 21:57:38.000000000","message":"right, so here - this is one of the places we don\u0027t have a broker (yet)","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"52ca9c375a1e4bab812dff27396c9be37b08b0b4","unresolved":false,"context_lines":[{"line_number":657,"context_line":"            or False."},{"line_number":658,"context_line":"        \"\"\""},{"line_number":659,"context_line":"        start_time \u003d now \u003d time.time()"},{"line_number":660,"context_line":"        self.logger.debug(\u0027Replicating db %s\u0027, object_file)"},{"line_number":661,"context_line":"        self.stats[\u0027attempted\u0027] +\u003d 1"},{"line_number":662,"context_line":"        self.logger.increment(\u0027attempts\u0027)"},{"line_number":663,"context_line":"        shouldbehere \u003d True"}],"source_content_type":"text/x-python","patch_set":22,"id":"be5ba610_04bfc9eb","line":660,"in_reply_to":"5ae03b18_ec5facbd","updated":"2025-09-25 17:49:52.000000000","message":"Done","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"23fe7c793eaaff27ab9346ac8366684bc051aad2","unresolved":true,"context_lines":[{"line_number":923,"context_line":"                sleep(self.interval - elapsed)"},{"line_number":924,"context_line":""},{"line_number":925,"context_line":""},{"line_number":926,"context_line":"class ReplicatorRpc(BrokerAnnotatedLogger):"},{"line_number":927,"context_line":"    \"\"\"Handle Replication RPC calls.  TODO(redbo): document please :)\"\"\""},{"line_number":928,"context_line":""},{"line_number":929,"context_line":"    def __init__(self, root, datadir, broker_class, mount_check\u003dTrue,"}],"source_content_type":"text/x-python","patch_set":22,"id":"ae4adf97_f9a203dc","line":926,"updated":"2025-08-25 16:22:47.000000000","message":"Again we\u0027ve got something *subclassing* `BrokerAnnotatedLogger` when I would\u0027ve expected it to instead just *have* one.\n\nFWIW, it looks like the account and container servers always pass in a logger, so I\u0027m not convinced the `log_route` difference matters -- I think L935 could just be `self.logger \u003d BrokerAnnotatedLogger({}, logger)`","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"52ca9c375a1e4bab812dff27396c9be37b08b0b4","unresolved":false,"context_lines":[{"line_number":923,"context_line":"                sleep(self.interval - elapsed)"},{"line_number":924,"context_line":""},{"line_number":925,"context_line":""},{"line_number":926,"context_line":"class ReplicatorRpc(BrokerAnnotatedLogger):"},{"line_number":927,"context_line":"    \"\"\"Handle Replication RPC calls.  TODO(redbo): document please :)\"\"\""},{"line_number":928,"context_line":""},{"line_number":929,"context_line":"    def __init__(self, root, datadir, broker_class, mount_check\u003dTrue,"}],"source_content_type":"text/x-python","patch_set":22,"id":"47b79beb_0980ba68","line":926,"in_reply_to":"401020b2_f2cb1230","updated":"2025-09-25 17:49:52.000000000","message":"Done","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"0c1e51d034d9c1401e9e1b67fbb07d9dfb925ee4","unresolved":false,"context_lines":[{"line_number":923,"context_line":"                sleep(self.interval - elapsed)"},{"line_number":924,"context_line":""},{"line_number":925,"context_line":""},{"line_number":926,"context_line":"class ReplicatorRpc(BrokerAnnotatedLogger):"},{"line_number":927,"context_line":"    \"\"\"Handle Replication RPC calls.  TODO(redbo): document please :)\"\"\""},{"line_number":928,"context_line":""},{"line_number":929,"context_line":"    def __init__(self, root, datadir, broker_class, mount_check\u003dTrue,"}],"source_content_type":"text/x-python","patch_set":22,"id":"be26328a_a3a294c5","line":926,"in_reply_to":"ae4adf97_f9a203dc","updated":"2025-08-26 16:44:10.000000000","message":"Done","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"805f976a86ea467ad88c21f296b734692c19d1f9","unresolved":true,"context_lines":[{"line_number":923,"context_line":"                sleep(self.interval - elapsed)"},{"line_number":924,"context_line":""},{"line_number":925,"context_line":""},{"line_number":926,"context_line":"class ReplicatorRpc(BrokerAnnotatedLogger):"},{"line_number":927,"context_line":"    \"\"\"Handle Replication RPC calls.  TODO(redbo): document please :)\"\"\""},{"line_number":928,"context_line":""},{"line_number":929,"context_line":"    def __init__(self, root, datadir, broker_class, mount_check\u003dTrue,"}],"source_content_type":"text/x-python","patch_set":22,"id":"fc73fb9f_a7147229","line":926,"in_reply_to":"ae4adf97_f9a203dc","updated":"2025-08-25 21:57:38.000000000","message":"if you\u0027re expecting it\u0027s super trivial for the author to do it some way differently than they have, you can always try changing it and see if your expectations change?\n\n```\nvagrant@saio:~$ pytest swift/test/unit/common/test_db_replicator.py::TestDBReplicator::test_replicator_sync_with_broker_replication_missing_table\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d test session starts \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\nplatform linux -- Python 3.10.12, pytest-8.4.1, pluggy-1.6.0 -- /usr/bin/python3\ncachedir: .pytest_cache\nrootdir: /home/vagrant/swift\nconfigfile: tox.ini\nplugins: subtests-0.14.2, cov-6.2.1\ncollected 1 item                                                                                                                                                                                                                                       \n\nswift/test/unit/common/test_db_replicator.py::TestDBReplicator::test_replicator_sync_with_broker_replication_missing_table FAILED                                                                                                                [100%]\n\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d FAILURES \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n_____________________________________________________________________________________ TestDBReplicator.test_replicator_sync_with_broker_replication_missing_table ______________________________________________________________________________________\n\nself \u003d \u003ctest.unit.common.test_db_replicator.TestDBReplicator testMethod\u003dtest_replicator_sync_with_broker_replication_missing_table\u003e\n\n    def test_replicator_sync_with_broker_replication_missing_table(self):\n        rpc \u003d db_replicator.ReplicatorRpc(\u0027/\u0027, \u0027/\u0027, FakeBroker,\n                                          mount_check\u003dFalse,\n                                          logger\u003dself.logger)\n        broker \u003d FakeBroker()\n        broker.get_repl_missing_table \u003d True\n    \n        called \u003d []\n    \n        def mock_quarantine_db(object_file, server_type):\n            called.append(True)\n            self.assertEqual(broker.db_file, object_file)\n            self.assertEqual(broker.db_type, server_type)\n    \n        self._patch(patch.object, db_replicator, \u0027quarantine_db\u0027,\n                    mock_quarantine_db)\n    \n        with unit.mock_check_drive(isdir\u003dTrue):\n            response \u003d rpc.sync(broker, (\u0027remote_sync\u0027, \u0027hash_\u0027, \u0027id_\u0027,\n                                         \u0027created_at\u0027, \u0027put_timestamp\u0027,\n                                         \u0027delete_timestamp\u0027, \u0027metadata\u0027))\n    \n        self.assertEqual(\u0027404 Not Found\u0027, response.status)\n        self.assertEqual(404, response.status_int)\n        self.assertEqual(called, [True])\n\u003e       errors \u003d rpc.logger.get_lines_for_level(\u0027error\u0027)\nE       AttributeError: \u0027BrokerAnnotatedLogger\u0027 object has no attribute \u0027get_lines_for_level\u0027\n\nswift/test/unit/common/test_db_replicator.py:1609: AttributeError\n----------------------------------------------------------------------------------------------------------------- Captured stdout call -----------------------------------------------------------------------------------------------------------------\ntest-replicator ERROR: metadata, path: , db: \ntest-replicator ERROR: Quarantining DB, path: a%20c%20t/c%20o%20n, db: /home/vagrant/swift/test/unit/common/test_db_replicator.py\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d short test summary info \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\nFAILED swift/test/unit/common/test_db_replicator.py::TestDBReplicator::test_replicator_sync_with_broker_replication_missing_table - AttributeError: \u0027BrokerAnnotatedLogger\u0027 object has no attribute \u0027get_lines_for_level\u0027\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d 1 failed in 0.32s \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n```\n\nIME it\u0027s not so trivial to swap out a SwiftAdaptedLogger (or it\u0027s debug equivilent) for some other object.\n\nAnd honestly I\u0027m not sure I\u0027d want to have a bunch of `self.logger.debug(None, \u0027there is no broker yet\u0027)` calls.\n\nI wouldn\u0027t be opposed to:\n\n```\nself.logger \u003d ...\nself.broker_logger \u003d BrokerAdaptedLogger(self.logger)\n```\n\n... and \n\n```\nself.logger.debug(\u0027no broker yet!\u0027)\nbroker \u003d ...\nself.broker_logger.debug(broker, \u0027we have a broker!\u0027)\n```\n\nbut then `self.debug(broker, \u0027...\u0027)` does start to look a bit more terse.\n\nMaybe `self.blogger.debug(broker, \u0027...\u0027)` ???  `self.log_shim` or just `self.b_log.debug` ???","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"2662e5bdf68826fff4013a7e20d52c4e0e970ad5","unresolved":true,"context_lines":[{"line_number":923,"context_line":"                sleep(self.interval - elapsed)"},{"line_number":924,"context_line":""},{"line_number":925,"context_line":""},{"line_number":926,"context_line":"class ReplicatorRpc(BrokerAnnotatedLogger):"},{"line_number":927,"context_line":"    \"\"\"Handle Replication RPC calls.  TODO(redbo): document please :)\"\"\""},{"line_number":928,"context_line":""},{"line_number":929,"context_line":"    def __init__(self, root, datadir, broker_class, mount_check\u003dTrue,"}],"source_content_type":"text/x-python","patch_set":22,"id":"401020b2_f2cb1230","line":926,"in_reply_to":"bd00bc9f_15eb5f19","updated":"2025-09-05 17:46:36.000000000","message":"Addressed in a follow-on suggestopm/draft here, ref: https://review.opendev.org/c/openstack/swift/+/959609/6/swift/common/db_replicator.py","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"5e35f75848e087150d1927be02a397e941bab5e0","unresolved":true,"context_lines":[{"line_number":923,"context_line":"                sleep(self.interval - elapsed)"},{"line_number":924,"context_line":""},{"line_number":925,"context_line":""},{"line_number":926,"context_line":"class ReplicatorRpc(BrokerAnnotatedLogger):"},{"line_number":927,"context_line":"    \"\"\"Handle Replication RPC calls.  TODO(redbo): document please :)\"\"\""},{"line_number":928,"context_line":""},{"line_number":929,"context_line":"    def __init__(self, root, datadir, broker_class, mount_check\u003dTrue,"}],"source_content_type":"text/x-python","patch_set":22,"id":"bd00bc9f_15eb5f19","line":926,"in_reply_to":"be26328a_a3a294c5","updated":"2025-08-26 16:46:22.000000000","message":"Not Done, still pending disscussion","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4627d5e2d929b3d11a7df8574ddace4541f3eba8","unresolved":true,"context_lines":[{"line_number":208,"context_line":"        db_file, path \u003d self._get_broker_details(broker)"},{"line_number":209,"context_line":"        if args:"},{"line_number":210,"context_line":"            msg \u003d msg % args"},{"line_number":211,"context_line":"        return \u0027%s, path: %s, db: %s\u0027 % (msg, quote(path), db_file)"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"    def _log(self, level, broker, msg, *args, **kwargs):"},{"line_number":214,"context_line":"        if not self.logger.isEnabledFor(level):"}],"source_content_type":"text/x-python","patch_set":35,"id":"796d418a_092bf2fe","line":211,"updated":"2025-09-26 18:02:47.000000000","message":"like, it\u0027s a nit - and I\u0027m sure it\u0027s just OCD - but why would an entirely green diff go out of it\u0027s way to add return the arguments from _get_broker_details in the opposite order we want to use them?\n\n```\ndiff --git a/swift/common/db_replicator.py b/swift/common/db_replicator.py\nindex 2e4ba5852..be9015bc3 100644\n--- a/swift/common/db_replicator.py\n+++ b/swift/common/db_replicator.py\n@@ -193,19 +193,19 @@ class BrokerAnnotatedLogger:\n         self.logger \u003d logger or get_logger(conf, log_route\u003d\u0027replicator\u0027)\n \n     def _get_broker_details(self, broker):\n-        try:\n-            db_file \u003d broker.db_file\n-        except Exception:  # noqa\n-            db_file \u003d \u0027\u0027\n         try:\n             path \u003d broker.path\n         except Exception:  # noqa\n             path \u003d \u0027\u0027\n-        return db_file, path\n+        try:\n+            db_file \u003d broker.db_file\n+        except Exception:  # noqa\n+            db_file \u003d \u0027\u0027\n+        return path, db_file\n \n     def _format_log_msg(self, broker, msg, *args):\n         # make best effort to include broker properties...\n-        db_file, path \u003d self._get_broker_details(broker)\n+        path, db_file \u003d self._get_broker_details(broker)\n         if args:\n             msg \u003d msg % args\n         return \u0027%s, path: %s, db: %s\u0027 % (msg, quote(path), db_file)\n```\n\n^ why is this so hard?","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"9b0d69985dc5c3c7d690ef07053d39653318d961","unresolved":false,"context_lines":[{"line_number":208,"context_line":"        db_file, path \u003d self._get_broker_details(broker)"},{"line_number":209,"context_line":"        if args:"},{"line_number":210,"context_line":"            msg \u003d msg % args"},{"line_number":211,"context_line":"        return \u0027%s, path: %s, db: %s\u0027 % (msg, quote(path), db_file)"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"    def _log(self, level, broker, msg, *args, **kwargs):"},{"line_number":214,"context_line":"        if not self.logger.isEnabledFor(level):"}],"source_content_type":"text/x-python","patch_set":35,"id":"c1410e52_cd59d75d","line":211,"in_reply_to":"624143d6_3c467345","updated":"2025-10-08 15:43:05.000000000","message":"Done","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"69538febbf5e32cff6f528440ff0fd543b9a85f1","unresolved":true,"context_lines":[{"line_number":208,"context_line":"        db_file, path \u003d self._get_broker_details(broker)"},{"line_number":209,"context_line":"        if args:"},{"line_number":210,"context_line":"            msg \u003d msg % args"},{"line_number":211,"context_line":"        return \u0027%s, path: %s, db: %s\u0027 % (msg, quote(path), db_file)"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"    def _log(self, level, broker, msg, *args, **kwargs):"},{"line_number":214,"context_line":"        if not self.logger.isEnabledFor(level):"}],"source_content_type":"text/x-python","patch_set":35,"id":"9046a51a_759c6198","line":211,"in_reply_to":"796d418a_092bf2fe","updated":"2025-09-29 01:21:41.000000000","message":"I demonstrated the why aspect of it in a previous revision a while back, will need to go back and check my revision history i guess,\n\nref: https://review.opendev.org/c/openstack/swift/+/933379/comments/d5d620af_52813144, this commment by @alistairncoles@gmail.com was i reverted it again","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"51befc999641047129f8a7691c4bafe1c4d24b3f","unresolved":true,"context_lines":[{"line_number":208,"context_line":"        db_file, path \u003d self._get_broker_details(broker)"},{"line_number":209,"context_line":"        if args:"},{"line_number":210,"context_line":"            msg \u003d msg % args"},{"line_number":211,"context_line":"        return \u0027%s, path: %s, db: %s\u0027 % (msg, quote(path), db_file)"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"    def _log(self, level, broker, msg, *args, **kwargs):"},{"line_number":214,"context_line":"        if not self.logger.isEnabledFor(level):"}],"source_content_type":"text/x-python","patch_set":35,"id":"624143d6_3c467345","line":211,"in_reply_to":"9046a51a_759c6198","updated":"2025-10-03 18:21:35.000000000","message":"I said \"the order should be consistent\" (reasonable) - Al said \"you shouldn\u0027t change the log message arbitrarily for internal consistency\" (obviously!  SRE *literally* has regex that would fail if we flipped this order)\n\nThe way to solve both requirements is of COURSE: change the internal `_get_broker_details` return tuple order - which only maintainers reading the code would care about and notice was (confusingly?) \"backwards\" from the order we *actually* want the attributes to consistently get logged!","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4627d5e2d929b3d11a7df8574ddace4541f3eba8","unresolved":true,"context_lines":[{"line_number":684,"context_line":"                if broker is None:"},{"line_number":685,"context_line":"                    self.logger.error(\u0027Quarantining DB %s\u0027, object_file)"},{"line_number":686,"context_line":"                else:"},{"line_number":687,"context_line":"                    self.error(broker, \u0027Quarantining DB\u0027)"},{"line_number":688,"context_line":"                quarantine_db(broker.db_file, broker.db_type)"},{"line_number":689,"context_line":"            else:"},{"line_number":690,"context_line":"                if broker is None:"}],"source_content_type":"text/x-python","patch_set":35,"id":"87c590b4_4011cb99","line":687,"updated":"2025-09-26 18:02:47.000000000","message":"I think it would be cool if `self.db_log.log(maybe_broker_or_path, ...)` was just more flexible to this use-case?\n\nI think if the \"broker\" doesn\u0027t have a `broker.db_file` attribute we can assume it\u0027s just a path/string - and if we don\u0027t have a `broker.path` value simply skip that part of the annotation?\n\n```\nself.db_log.error(broker or object_file, \u0027Quarantining DB\u0027)\n```\n\nyou could even just:\n```\n# we can fall back to object_file if we blow up\nbroker \u003d object_file\n...\nexcept:\n   self.error(broker, \u0027blew up maybe before creating real broker; but that\u0027s ok\u0027)\n```","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"51befc999641047129f8a7691c4bafe1c4d24b3f","unresolved":false,"context_lines":[{"line_number":684,"context_line":"                if broker is None:"},{"line_number":685,"context_line":"                    self.logger.error(\u0027Quarantining DB %s\u0027, object_file)"},{"line_number":686,"context_line":"                else:"},{"line_number":687,"context_line":"                    self.error(broker, \u0027Quarantining DB\u0027)"},{"line_number":688,"context_line":"                quarantine_db(broker.db_file, broker.db_type)"},{"line_number":689,"context_line":"            else:"},{"line_number":690,"context_line":"                if broker is None:"}],"source_content_type":"text/x-python","patch_set":35,"id":"d0a2c1e7_f32cb4c5","line":687,"in_reply_to":"097e3353_8b68dea6","updated":"2025-10-03 18:21:35.000000000","message":"Acknowledged","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"1b8dfd167b01c5148c1ded37fb2d62590e7cd581","unresolved":true,"context_lines":[{"line_number":684,"context_line":"                if broker is None:"},{"line_number":685,"context_line":"                    self.logger.error(\u0027Quarantining DB %s\u0027, object_file)"},{"line_number":686,"context_line":"                else:"},{"line_number":687,"context_line":"                    self.error(broker, \u0027Quarantining DB\u0027)"},{"line_number":688,"context_line":"                quarantine_db(broker.db_file, broker.db_type)"},{"line_number":689,"context_line":"            else:"},{"line_number":690,"context_line":"                if broker is None:"}],"source_content_type":"text/x-python","patch_set":35,"id":"097e3353_8b68dea6","line":687,"in_reply_to":"87c590b4_4011cb99","updated":"2025-10-02 20:01:09.000000000","message":"This is unaddrressed","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"51befc999641047129f8a7691c4bafe1c4d24b3f","unresolved":true,"context_lines":[{"line_number":187,"context_line":"    This class augments messages with the broker\u0027s container path and DB"},{"line_number":188,"context_line":"    file path so that logs are easier to correlate during replication"},{"line_number":189,"context_line":"    and sharding workflows."},{"line_number":190,"context_line":"    \"\"\""},{"line_number":191,"context_line":"    def __init__(self, logger):"},{"line_number":192,"context_line":"        self.logger \u003d logger"},{"line_number":193,"context_line":""}],"source_content_type":"text/x-python","patch_set":42,"id":"2efb3bcb_239bb40b","line":190,"updated":"2025-10-03 18:21:35.000000000","message":"this class is really helpful.  I think we should consider moving it to swift.common.db - i imagine it will very likely make it\u0027s way into the container-updater and container-reconciler at some point.\n\nI also really like the pattern and expect we\u0027ll see a\n\n`self.req_log \u003d swift.common.requst_helper.RequestAnnotatedLogger(self.logger)`\n\nor \n\n`self.df_log \u003d swift.obj.diskfile.DiskFileAnnotatedLogger()`\n\n... at somepoint.","commit_id":"cbe3c88083dfe0d96e7ae33bacbdc6aca811f8f8"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"9b0d69985dc5c3c7d690ef07053d39653318d961","unresolved":true,"context_lines":[{"line_number":187,"context_line":"    This class augments messages with the broker\u0027s container path and DB"},{"line_number":188,"context_line":"    file path so that logs are easier to correlate during replication"},{"line_number":189,"context_line":"    and sharding workflows."},{"line_number":190,"context_line":"    \"\"\""},{"line_number":191,"context_line":"    def __init__(self, logger):"},{"line_number":192,"context_line":"        self.logger \u003d logger"},{"line_number":193,"context_line":""}],"source_content_type":"text/x-python","patch_set":42,"id":"d4659d3a_c542b213","line":190,"in_reply_to":"2efb3bcb_239bb40b","updated":"2025-10-08 15:43:05.000000000","message":"Could this rather be addressed in a follow-on ?","commit_id":"cbe3c88083dfe0d96e7ae33bacbdc6aca811f8f8"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"c6fef9dc091ced427d65aab64fe3b6a37f2bf7ec","unresolved":true,"context_lines":[{"line_number":301,"context_line":"                \u0027with replica count %d. Disabling.\u0027,"},{"line_number":302,"context_line":"                self.handoff_delete, self.ring.replica_count)"},{"line_number":303,"context_line":"            self.handoff_delete \u003d 0"},{"line_number":304,"context_line":"        self.db_log \u003d BrokerAnnotatedLogger(logger\u003dself.logger)"},{"line_number":305,"context_line":""},{"line_number":306,"context_line":"    def _zero_stats(self):"},{"line_number":307,"context_line":"        \"\"\"Zero out the stats.\"\"\""}],"source_content_type":"text/x-python","patch_set":42,"id":"f8ef4939_bdc86056","line":304,"range":{"start_line":304,"start_character":8,"end_line":304,"end_character":19},"updated":"2025-10-06 01:10:52.000000000","message":"Not super important so probably doesn\u0027t need to change. But this could be called `self.db_logger` so it matches the `self.logger` its adapting and indicates it has a similar interface.","commit_id":"cbe3c88083dfe0d96e7ae33bacbdc6aca811f8f8"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"9b0d69985dc5c3c7d690ef07053d39653318d961","unresolved":false,"context_lines":[{"line_number":301,"context_line":"                \u0027with replica count %d. Disabling.\u0027,"},{"line_number":302,"context_line":"                self.handoff_delete, self.ring.replica_count)"},{"line_number":303,"context_line":"            self.handoff_delete \u003d 0"},{"line_number":304,"context_line":"        self.db_log \u003d BrokerAnnotatedLogger(logger\u003dself.logger)"},{"line_number":305,"context_line":""},{"line_number":306,"context_line":"    def _zero_stats(self):"},{"line_number":307,"context_line":"        \"\"\"Zero out the stats.\"\"\""}],"source_content_type":"text/x-python","patch_set":42,"id":"1cb60967_14704557","line":304,"range":{"start_line":304,"start_character":8,"end_line":304,"end_character":19},"in_reply_to":"f8ef4939_bdc86056","updated":"2025-10-08 15:43:05.000000000","message":"Not the name that was suggested in a previous comment by @clay.gerrard@gmail.com here, ref: [swift/+/933379/comment](https://review.opendev.org/c/openstack/swift/+/933379/comment/69b8c939_eb2df461/)","commit_id":"cbe3c88083dfe0d96e7ae33bacbdc6aca811f8f8"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"44d16c35e3628fb4c843b1586e43f74eb435db61","unresolved":true,"context_lines":[{"line_number":437,"context_line":"        self.db_log.debug("},{"line_number":438,"context_line":"            broker,"},{"line_number":439,"context_line":"            \u0027usyncing chunks to %s, starting at row %s\u0027,"},{"line_number":440,"context_line":"            \u0027%(ip)s:%(port)s/%(device)s\u0027 % http.node, point)"},{"line_number":441,"context_line":"        start \u003d time.time()"},{"line_number":442,"context_line":"        sync_table \u003d broker.get_syncs()"},{"line_number":443,"context_line":"        objects \u003d broker.get_items_since(point, self.per_diff)"}],"source_content_type":"text/x-python","patch_set":44,"id":"11c2c9ed_9dfd64dc","line":440,"updated":"2025-10-09 14:53:29.000000000","message":"off-topic: these log messages ought to be logging the *replication* ip \u0026 port","commit_id":"f8607fbc8b0dd7898fc224dfc6d2dd231957ae0c"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"187adedb6cfd0da586b6778c6dc008077a240e81","unresolved":true,"context_lines":[{"line_number":437,"context_line":"        self.db_log.debug("},{"line_number":438,"context_line":"            broker,"},{"line_number":439,"context_line":"            \u0027usyncing chunks to %s, starting at row %s\u0027,"},{"line_number":440,"context_line":"            \u0027%(ip)s:%(port)s/%(device)s\u0027 % http.node, point)"},{"line_number":441,"context_line":"        start \u003d time.time()"},{"line_number":442,"context_line":"        sync_table \u003d broker.get_syncs()"},{"line_number":443,"context_line":"        objects \u003d broker.get_items_since(point, self.per_diff)"}],"source_content_type":"text/x-python","patch_set":44,"id":"8f09f11d_6a8d60e3","line":440,"in_reply_to":"11c2c9ed_9dfd64dc","updated":"2025-10-11 22:14:28.000000000","message":"Part of a follow-on ? (Since this is a logging change)","commit_id":"f8607fbc8b0dd7898fc224dfc6d2dd231957ae0c"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"4632feca85c2ad3e542881be2ef9c24a2f2a2424","unresolved":true,"context_lines":[{"line_number":437,"context_line":"        self.db_log.debug("},{"line_number":438,"context_line":"            broker,"},{"line_number":439,"context_line":"            \u0027usyncing chunks to %s, starting at row %s\u0027,"},{"line_number":440,"context_line":"            \u0027%(ip)s:%(port)s/%(device)s\u0027 % http.node, point)"},{"line_number":441,"context_line":"        start \u003d time.time()"},{"line_number":442,"context_line":"        sync_table \u003d broker.get_syncs()"},{"line_number":443,"context_line":"        objects \u003d broker.get_items_since(point, self.per_diff)"}],"source_content_type":"text/x-python","patch_set":44,"id":"cb7b7c9d_bedd9aad","line":440,"in_reply_to":"8f09f11d_6a8d60e3","updated":"2025-10-13 12:23:50.000000000","message":"I think a follow-on  would be good to audit all of the node logging, use the helper to format, and select correct ip/port","commit_id":"f8607fbc8b0dd7898fc224dfc6d2dd231957ae0c"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"44d16c35e3628fb4c843b1586e43f74eb435db61","unresolved":true,"context_lines":[{"line_number":808,"context_line":"                else:"},{"line_number":809,"context_line":"                    self.db_log.exception("},{"line_number":810,"context_line":"                        broker,"},{"line_number":811,"context_line":"                        \u0027ERROR while trying to clean up\u0027)"},{"line_number":812,"context_line":"                    return False"},{"line_number":813,"context_line":"        return True"},{"line_number":814,"context_line":""}],"source_content_type":"text/x-python","patch_set":44,"id":"80f79660_d27f957e","line":811,"updated":"2025-10-09 14:53:29.000000000","message":"``parent_dir`` has been lost from the error message. Sadly, AFAICT there is no test coverage for this clause.","commit_id":"f8607fbc8b0dd7898fc224dfc6d2dd231957ae0c"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"187adedb6cfd0da586b6778c6dc008077a240e81","unresolved":true,"context_lines":[{"line_number":808,"context_line":"                else:"},{"line_number":809,"context_line":"                    self.db_log.exception("},{"line_number":810,"context_line":"                        broker,"},{"line_number":811,"context_line":"                        \u0027ERROR while trying to clean up\u0027)"},{"line_number":812,"context_line":"                    return False"},{"line_number":813,"context_line":"        return True"},{"line_number":814,"context_line":""}],"source_content_type":"text/x-python","patch_set":44,"id":"bf31984c_a53e3733","line":811,"in_reply_to":"80f79660_d27f957e","updated":"2025-10-11 22:14:28.000000000","message":"I just noticed that, i put it back in the message and also introduce a test that will help us cover this log change","commit_id":"f8607fbc8b0dd7898fc224dfc6d2dd231957ae0c"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"4632feca85c2ad3e542881be2ef9c24a2f2a2424","unresolved":false,"context_lines":[{"line_number":808,"context_line":"                else:"},{"line_number":809,"context_line":"                    self.db_log.exception("},{"line_number":810,"context_line":"                        broker,"},{"line_number":811,"context_line":"                        \u0027ERROR while trying to clean up\u0027)"},{"line_number":812,"context_line":"                    return False"},{"line_number":813,"context_line":"        return True"},{"line_number":814,"context_line":""}],"source_content_type":"text/x-python","patch_set":44,"id":"6e4a9df1_754839f2","line":811,"in_reply_to":"bf31984c_a53e3733","updated":"2025-10-13 12:23:50.000000000","message":"Done","commit_id":"f8607fbc8b0dd7898fc224dfc6d2dd231957ae0c"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"44d16c35e3628fb4c843b1586e43f74eb435db61","unresolved":true,"context_lines":[{"line_number":944,"context_line":"        self.broker_class \u003d broker_class"},{"line_number":945,"context_line":"        self.mount_check \u003d mount_check"},{"line_number":946,"context_line":"        self.logger \u003d logger or get_logger({}, log_route\u003d\u0027replicator-rpc\u0027)"},{"line_number":947,"context_line":"        self.broker_logger \u003d BrokerAnnotatedLogger(logger\u003dself.logger)"},{"line_number":948,"context_line":""},{"line_number":949,"context_line":"    def _db_file_exists(self, db_path):"},{"line_number":950,"context_line":"        return os.path.exists(db_path)"}],"source_content_type":"text/x-python","patch_set":44,"id":"d4a59dd4_9c7314ea","line":947,"updated":"2025-10-09 14:53:29.000000000","message":"I *much prefer* ``broker_logger`` (here) over ``db_log`` (elsewhere in this patch) as a variable name. The class is a ``BrokerAnnotatedLogger``, and we pass it a broker - why call the instance anything else?\n\nAnd I think that Matt has already commented that our other loggers are called ``logger``, not ``log``. So at least ``db_logger`` would be better.\n\nBut, above all else, *please* use consistent naming. Naming preferences may sound petty, but the cognitive burden of dealing with inconsistent conventions is significant.","commit_id":"f8607fbc8b0dd7898fc224dfc6d2dd231957ae0c"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"187adedb6cfd0da586b6778c6dc008077a240e81","unresolved":false,"context_lines":[{"line_number":944,"context_line":"        self.broker_class \u003d broker_class"},{"line_number":945,"context_line":"        self.mount_check \u003d mount_check"},{"line_number":946,"context_line":"        self.logger \u003d logger or get_logger({}, log_route\u003d\u0027replicator-rpc\u0027)"},{"line_number":947,"context_line":"        self.broker_logger \u003d BrokerAnnotatedLogger(logger\u003dself.logger)"},{"line_number":948,"context_line":""},{"line_number":949,"context_line":"    def _db_file_exists(self, db_path):"},{"line_number":950,"context_line":"        return os.path.exists(db_path)"}],"source_content_type":"text/x-python","patch_set":44,"id":"54f56c4d_457d8068","line":947,"in_reply_to":"d4a59dd4_9c7314ea","updated":"2025-10-11 22:14:28.000000000","message":"\u003e And I think that Matt has already commented that our other loggers are called logger, not log. So at least db_logger would be better\n\nI think `db_logger` would be the best name. \n\n\u003e I much prefer broker_logger (here) over db_log (elsewhere in this patch) \n\nApologies for not being consistent, when i last did a grep before i refactored from broker_logger -\u003e db_log, i had done a grep (post-refactor and it failed to pop up) and hence i missed it","commit_id":"f8607fbc8b0dd7898fc224dfc6d2dd231957ae0c"}],"swift/container/replicator.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4627d5e2d929b3d11a7df8574ddace4541f3eba8","unresolved":true,"context_lines":[{"line_number":124,"context_line":"        # syncing so that only new shard range rows are sync\u0027d."},{"line_number":125,"context_line":"        shard_range_data \u003d broker.get_all_shard_range_data()"},{"line_number":126,"context_line":"        if shard_range_data:"},{"line_number":127,"context_line":"            node_str \u003d \u0027%(ip)s:%(port)s/%(device)s\u0027 % http.node"},{"line_number":128,"context_line":"            if not self._send_replicate_request("},{"line_number":129,"context_line":"                    http, \u0027merge_shard_ranges\u0027, shard_range_data, local_id):"},{"line_number":130,"context_line":"                return False"}],"source_content_type":"text/x-python","patch_set":35,"id":"720c5a4a_ca956da0","line":127,"updated":"2025-09-26 18:02:47.000000000","message":"I don\u0027t think I understand the justification for doing this string formatting un-conditionally...\n\n```\ndiff --git a/swift/container/replicator.py b/swift/container/replicator.py\nindex 11d85a232..93a2452bc 100644\n--- a/swift/container/replicator.py\n+++ b/swift/container/replicator.py\n@@ -124,10 +124,10 @@ class ContainerReplicator(db_replicator.Replicator):\n         # syncing so that only new shard range rows are sync\u0027d.\n         shard_range_data \u003d broker.get_all_shard_range_data()\n         if shard_range_data:\n-            node_str \u003d \u0027%(ip)s:%(port)s/%(device)s\u0027 % http.node\n             if not self._send_replicate_request(\n                     http, \u0027merge_shard_ranges\u0027, shard_range_data, local_id):\n                 return False\n+            node_str \u003d \u0027%(ip)s:%(port)s/%(device)s\u0027 % http.node\n             self.debug(broker, \u0027synced %s shard ranges to %s\u0027,\n                        len(shard_range_data), node_str)\n         return True\n```\n\n^ seems to work equally well, has the benifit of only doing string formatting when it\u0027s needed, and .. I think it even reads slightly *better* to define the logging var right before we log as opposed to two lines back above some conditional block?","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"69538febbf5e32cff6f528440ff0fd543b9a85f1","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        # syncing so that only new shard range rows are sync\u0027d."},{"line_number":125,"context_line":"        shard_range_data \u003d broker.get_all_shard_range_data()"},{"line_number":126,"context_line":"        if shard_range_data:"},{"line_number":127,"context_line":"            node_str \u003d \u0027%(ip)s:%(port)s/%(device)s\u0027 % http.node"},{"line_number":128,"context_line":"            if not self._send_replicate_request("},{"line_number":129,"context_line":"                    http, \u0027merge_shard_ranges\u0027, shard_range_data, local_id):"},{"line_number":130,"context_line":"                return False"}],"source_content_type":"text/x-python","patch_set":35,"id":"aa65e421_23b17e9e","line":127,"in_reply_to":"720c5a4a_ca956da0","updated":"2025-09-29 01:21:41.000000000","message":"Done","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4627d5e2d929b3d11a7df8574ddace4541f3eba8","unresolved":true,"context_lines":[{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def _choose_replication_mode(self, node, rinfo, info, local_sync, broker,"},{"line_number":136,"context_line":"                                 http, different_region):"},{"line_number":137,"context_line":"        node_str \u003d \u0027%(ip)s:%(port)s/%(device)s\u0027 % node"},{"line_number":138,"context_line":"        if \u0027shard_max_row\u0027 in rinfo:"},{"line_number":139,"context_line":"            # Always replicate shard ranges to new-enough swift"},{"line_number":140,"context_line":"            shard_range_success \u003d self._sync_shard_ranges("}],"source_content_type":"text/x-python","patch_set":35,"id":"38349a34_7e1d635b","line":137,"updated":"2025-09-26 18:02:47.000000000","message":"FWIW I think it\u0027s justifiable here to do the string formatting unconditionally for consistency; or at least I understand the reasoning\n\nBut the \"at the top of the method\" and \"before the conditionals\" is more of an implementation requirement than a pattern\n\nAs an alternative I might cosider a helper `node_str(node)` would be even MORE DRY, and easy to only call when you actually need to render the log lines; but it\u0027s probably cheaper to format into a string literal than call a whole function.","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"5d33b59db4d781fa7db0060473433c9232d91421","unresolved":true,"context_lines":[{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def _choose_replication_mode(self, node, rinfo, info, local_sync, broker,"},{"line_number":136,"context_line":"                                 http, different_region):"},{"line_number":137,"context_line":"        node_str \u003d \u0027%(ip)s:%(port)s/%(device)s\u0027 % node"},{"line_number":138,"context_line":"        if \u0027shard_max_row\u0027 in rinfo:"},{"line_number":139,"context_line":"            # Always replicate shard ranges to new-enough swift"},{"line_number":140,"context_line":"            shard_range_success \u003d self._sync_shard_ranges("}],"source_content_type":"text/x-python","patch_set":35,"id":"5de69149_33b4f35b","line":137,"in_reply_to":"0a7a4905_205390da","updated":"2025-09-29 23:35:22.000000000","message":"Figured out some existing tests that i could modify to ensure coverage for this case:\n```\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_replication_local_sharding_remote_presharding\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_replication_local_sharding_remote_presharding_large_diff\n```\n\nthere were double nested helpers in the aforwementioned test which is why it took longer to figure out ;)","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"69538febbf5e32cff6f528440ff0fd543b9a85f1","unresolved":true,"context_lines":[{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def _choose_replication_mode(self, node, rinfo, info, local_sync, broker,"},{"line_number":136,"context_line":"                                 http, different_region):"},{"line_number":137,"context_line":"        node_str \u003d \u0027%(ip)s:%(port)s/%(device)s\u0027 % node"},{"line_number":138,"context_line":"        if \u0027shard_max_row\u0027 in rinfo:"},{"line_number":139,"context_line":"            # Always replicate shard ranges to new-enough swift"},{"line_number":140,"context_line":"            shard_range_success \u003d self._sync_shard_ranges("}],"source_content_type":"text/x-python","patch_set":35,"id":"0a7a4905_205390da","line":137,"in_reply_to":"38349a34_7e1d635b","updated":"2025-09-29 01:21:41.000000000","message":"I think top of the method was the best way to ensure i only had to write it once and avoid having to do it again and again under each conditional","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"9b0d69985dc5c3c7d690ef07053d39653318d961","unresolved":false,"context_lines":[{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def _choose_replication_mode(self, node, rinfo, info, local_sync, broker,"},{"line_number":136,"context_line":"                                 http, different_region):"},{"line_number":137,"context_line":"        node_str \u003d \u0027%(ip)s:%(port)s/%(device)s\u0027 % node"},{"line_number":138,"context_line":"        if \u0027shard_max_row\u0027 in rinfo:"},{"line_number":139,"context_line":"            # Always replicate shard ranges to new-enough swift"},{"line_number":140,"context_line":"            shard_range_success \u003d self._sync_shard_ranges("}],"source_content_type":"text/x-python","patch_set":35,"id":"bf552522_f0fb5e70","line":137,"in_reply_to":"45d3b042_5b2193d7","updated":"2025-10-08 15:43:05.000000000","message":"I didn\u0027t feel the need to add an unnecessary helper and leave the code as-is since we are trying to add logging changes!","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"72dc0946f74d70b1f7af9d0e9c13a5f809329ac5","unresolved":true,"context_lines":[{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def _choose_replication_mode(self, node, rinfo, info, local_sync, broker,"},{"line_number":136,"context_line":"                                 http, different_region):"},{"line_number":137,"context_line":"        node_str \u003d \u0027%(ip)s:%(port)s/%(device)s\u0027 % node"},{"line_number":138,"context_line":"        if \u0027shard_max_row\u0027 in rinfo:"},{"line_number":139,"context_line":"            # Always replicate shard ranges to new-enough swift"},{"line_number":140,"context_line":"            shard_range_success \u003d self._sync_shard_ranges("}],"source_content_type":"text/x-python","patch_set":35,"id":"d88c2d55_b2a66cf5","line":137,"in_reply_to":"5de69149_33b4f35b","updated":"2025-09-30 06:40:40.000000000","message":"`swift.common.utils.node_to_string` already exists for this right?","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"c6fef9dc091ced427d65aab64fe3b6a37f2bf7ec","unresolved":true,"context_lines":[{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def _choose_replication_mode(self, node, rinfo, info, local_sync, broker,"},{"line_number":136,"context_line":"                                 http, different_region):"},{"line_number":137,"context_line":"        node_str \u003d \u0027%(ip)s:%(port)s/%(device)s\u0027 % node"},{"line_number":138,"context_line":"        if \u0027shard_max_row\u0027 in rinfo:"},{"line_number":139,"context_line":"            # Always replicate shard ranges to new-enough swift"},{"line_number":140,"context_line":"            shard_range_success \u003d self._sync_shard_ranges("}],"source_content_type":"text/x-python","patch_set":35,"id":"45d3b042_5b2193d7","line":137,"in_reply_to":"943b041c_3245b5ea","updated":"2025-10-06 01:10:52.000000000","message":"Clay suggested to you could use a helper method to make this more DRY, and I was commenting one already exists to turn a node dict into a string for printing. It\u0027s called `swift.common.utils.node_to_string`\n\nSo not talking about tests talkbing about a helper you could use on lines 130 and 137 when you creating node_str.","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"b0ebb2d7820a99e94c90b3c1143870109f08b64b","unresolved":true,"context_lines":[{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def _choose_replication_mode(self, node, rinfo, info, local_sync, broker,"},{"line_number":136,"context_line":"                                 http, different_region):"},{"line_number":137,"context_line":"        node_str \u003d \u0027%(ip)s:%(port)s/%(device)s\u0027 % node"},{"line_number":138,"context_line":"        if \u0027shard_max_row\u0027 in rinfo:"},{"line_number":139,"context_line":"            # Always replicate shard ranges to new-enough swift"},{"line_number":140,"context_line":"            shard_range_success \u003d self._sync_shard_ranges("}],"source_content_type":"text/x-python","patch_set":35,"id":"943b041c_3245b5ea","line":137,"in_reply_to":"d88c2d55_b2a66cf5","updated":"2025-10-02 19:59:13.000000000","message":"I think you just confused the var name with the helper, unless you\u0027re suggesting i use the helper which i don\u0027t think i need to for this test","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4627d5e2d929b3d11a7df8574ddace4541f3eba8","unresolved":true,"context_lines":[{"line_number":150,"context_line":"                    broker.get_objects(limit\u003d1)) \u003d\u003d 0:"},{"line_number":151,"context_line":"                self.debug(broker,"},{"line_number":152,"context_line":"                           \u0027is sharded and has nothing more to \u0027"},{"line_number":153,"context_line":"                           \u0027replicate to peer %s\u0027, node_str)"},{"line_number":154,"context_line":"            else:"},{"line_number":155,"context_line":"                # Only print the scary warning if there was something that"},{"line_number":156,"context_line":"                # didn\u0027t get replicated"}],"source_content_type":"text/x-python","patch_set":35,"id":"3b991eaa_2aad6bad","line":153,"updated":"2025-09-26 18:02:47.000000000","message":"honestly someone is probably going to have to verify that any of these log messages you\u0027re changing are at LEAST rendered in some test somewhere:\n\n```\n@@ -148,6 +148,7 @@ class ContainerReplicator(db_replicator.Replicator):\n         if broker.sharding_initiated():\n             if info[\u0027db_state\u0027] \u003d\u003d SHARDED and len(\n                     broker.get_objects(limit\u003d1)) \u003d\u003d 0:\n+                asdf\n                 self.debug(broker,\n                            \u0027is sharded and has nothing more to \u0027\n                            \u0027replicate to peer %s\u0027, node_str)\n```\n\n... it\u0027s probably going to to be a big PITA to write tests for some of them 😞\n\n\nmaybe??? \n\n```\ntest_replicator.py::TestReplicatorSync::test_replication_local_sharded_empty\n```\n\nI don\u0027t think I actually know how to get a an empty db sharded, maybe after sharding replace everything with tombstones!?  Honestly this whole condition seems kind of sketch and maybe we should *always* do the warning branch (that\u0027s all that tested anyway!)","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"69538febbf5e32cff6f528440ff0fd543b9a85f1","unresolved":true,"context_lines":[{"line_number":150,"context_line":"                    broker.get_objects(limit\u003d1)) \u003d\u003d 0:"},{"line_number":151,"context_line":"                self.debug(broker,"},{"line_number":152,"context_line":"                           \u0027is sharded and has nothing more to \u0027"},{"line_number":153,"context_line":"                           \u0027replicate to peer %s\u0027, node_str)"},{"line_number":154,"context_line":"            else:"},{"line_number":155,"context_line":"                # Only print the scary warning if there was something that"},{"line_number":156,"context_line":"                # didn\u0027t get replicated"}],"source_content_type":"text/x-python","patch_set":35,"id":"c88e5ef7_89b00199","line":153,"in_reply_to":"3b991eaa_2aad6bad","updated":"2025-09-29 01:21:41.000000000","message":"I know what you mean, this was the hardest one to test for me so i didn\u0027t introduce coverage infact when i was modifying tests, i saw none of the tests reaching this breakpoint.\n\nI attempted at writing a new test, but i am doing something wrong in my test :-/","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"5d33b59db4d781fa7db0060473433c9232d91421","unresolved":false,"context_lines":[{"line_number":150,"context_line":"                    broker.get_objects(limit\u003d1)) \u003d\u003d 0:"},{"line_number":151,"context_line":"                self.debug(broker,"},{"line_number":152,"context_line":"                           \u0027is sharded and has nothing more to \u0027"},{"line_number":153,"context_line":"                           \u0027replicate to peer %s\u0027, node_str)"},{"line_number":154,"context_line":"            else:"},{"line_number":155,"context_line":"                # Only print the scary warning if there was something that"},{"line_number":156,"context_line":"                # didn\u0027t get replicated"}],"source_content_type":"text/x-python","patch_set":35,"id":"763f7644_ca907ad7","line":153,"in_reply_to":"c88e5ef7_89b00199","updated":"2025-09-29 23:35:22.000000000","message":"Figured out some existing tests that i could modify to ensure coverage for this case:\n```\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_replication_local_sharding_remote_presharding\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_replication_local_sharding_remote_presharding_large_diff\n```\n\nthere were double nested helpers in the aforwementioned test which is why it took longer to figure out ;)","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"b0ebb2d7820a99e94c90b3c1143870109f08b64b","unresolved":true,"context_lines":[{"line_number":143,"context_line":"            shard_range_success \u003d False"},{"line_number":144,"context_line":"            self.warning("},{"line_number":145,"context_line":"                broker,"},{"line_number":146,"context_line":"                \u0027is unable to replicate shard ranges to peer %s; \u0027"},{"line_number":147,"context_line":"                \u0027peer may need upgrading\u0027, node_str)"},{"line_number":148,"context_line":"        if broker.sharding_initiated():"},{"line_number":149,"context_line":"            if info[\u0027db_state\u0027] \u003d\u003d SHARDED and len("}],"source_content_type":"text/x-python","patch_set":39,"id":"955d8c12_f39b0b92","line":146,"updated":"2025-10-02 19:59:13.000000000","message":"The new tests in the subsequent revision will have coverage for this change as well","commit_id":"777cc77329b3e38f3632b7d4e6172875c77973b1"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"1b8dfd167b01c5148c1ded37fb2d62590e7cd581","unresolved":false,"context_lines":[{"line_number":143,"context_line":"            shard_range_success \u003d False"},{"line_number":144,"context_line":"            self.warning("},{"line_number":145,"context_line":"                broker,"},{"line_number":146,"context_line":"                \u0027is unable to replicate shard ranges to peer %s; \u0027"},{"line_number":147,"context_line":"                \u0027peer may need upgrading\u0027, node_str)"},{"line_number":148,"context_line":"        if broker.sharding_initiated():"},{"line_number":149,"context_line":"            if info[\u0027db_state\u0027] \u003d\u003d SHARDED and len("}],"source_content_type":"text/x-python","patch_set":39,"id":"11b64f6d_8e5780bf","line":146,"in_reply_to":"955d8c12_f39b0b92","updated":"2025-10-02 20:01:09.000000000","message":"Done","commit_id":"777cc77329b3e38f3632b7d4e6172875c77973b1"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"b0ebb2d7820a99e94c90b3c1143870109f08b64b","unresolved":true,"context_lines":[{"line_number":149,"context_line":"            if info[\u0027db_state\u0027] \u003d\u003d SHARDED and len("},{"line_number":150,"context_line":"                    broker.get_objects(limit\u003d1)) \u003d\u003d 0:"},{"line_number":151,"context_line":"                self.debug(broker,"},{"line_number":152,"context_line":"                           \u0027is sharded and has nothing more to \u0027"},{"line_number":153,"context_line":"                           \u0027replicate to peer %s\u0027, node_str)"},{"line_number":154,"context_line":"            else:"},{"line_number":155,"context_line":"                # Only print the scary warning if there was something that"}],"source_content_type":"text/x-python","patch_set":39,"id":"d50650af_28b5f3eb","line":152,"updated":"2025-10-02 19:59:13.000000000","message":"The new tests in the subsequent revision will have coverage for this change as well","commit_id":"777cc77329b3e38f3632b7d4e6172875c77973b1"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"1b8dfd167b01c5148c1ded37fb2d62590e7cd581","unresolved":false,"context_lines":[{"line_number":149,"context_line":"            if info[\u0027db_state\u0027] \u003d\u003d SHARDED and len("},{"line_number":150,"context_line":"                    broker.get_objects(limit\u003d1)) \u003d\u003d 0:"},{"line_number":151,"context_line":"                self.debug(broker,"},{"line_number":152,"context_line":"                           \u0027is sharded and has nothing more to \u0027"},{"line_number":153,"context_line":"                           \u0027replicate to peer %s\u0027, node_str)"},{"line_number":154,"context_line":"            else:"},{"line_number":155,"context_line":"                # Only print the scary warning if there was something that"}],"source_content_type":"text/x-python","patch_set":39,"id":"448894bc_63ba8365","line":152,"in_reply_to":"d50650af_28b5f3eb","updated":"2025-10-02 20:01:09.000000000","message":"Done","commit_id":"777cc77329b3e38f3632b7d4e6172875c77973b1"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"b0ebb2d7820a99e94c90b3c1143870109f08b64b","unresolved":true,"context_lines":[{"line_number":155,"context_line":"                # Only print the scary warning if there was something that"},{"line_number":156,"context_line":"                # didn\u0027t get replicated"},{"line_number":157,"context_line":"                self.warning("},{"line_number":158,"context_line":"                    broker,"},{"line_number":159,"context_line":"                    \u0027is able to shard -- refusing to replicate objects to\u0027"},{"line_number":160,"context_line":"                    \u0027 peer %s; have shard ranges and will wait for cleaving\u0027,"},{"line_number":161,"context_line":"                    node_str)"}],"source_content_type":"text/x-python","patch_set":39,"id":"4dcefce2_88966f65","line":158,"updated":"2025-10-02 19:59:13.000000000","message":"The new tests in the subsequent revision will have coverage for this change as well","commit_id":"777cc77329b3e38f3632b7d4e6172875c77973b1"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"1b8dfd167b01c5148c1ded37fb2d62590e7cd581","unresolved":false,"context_lines":[{"line_number":155,"context_line":"                # Only print the scary warning if there was something that"},{"line_number":156,"context_line":"                # didn\u0027t get replicated"},{"line_number":157,"context_line":"                self.warning("},{"line_number":158,"context_line":"                    broker,"},{"line_number":159,"context_line":"                    \u0027is able to shard -- refusing to replicate objects to\u0027"},{"line_number":160,"context_line":"                    \u0027 peer %s; have shard ranges and will wait for cleaving\u0027,"},{"line_number":161,"context_line":"                    node_str)"}],"source_content_type":"text/x-python","patch_set":39,"id":"a45ae0fd_e54ca112","line":158,"in_reply_to":"4dcefce2_88966f65","updated":"2025-10-02 20:01:09.000000000","message":"Done","commit_id":"777cc77329b3e38f3632b7d4e6172875c77973b1"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"b0ebb2d7820a99e94c90b3c1143870109f08b64b","unresolved":true,"context_lines":[{"line_number":345,"context_line":"                self.sync_store.remove_synced_container(broker)"},{"line_number":346,"context_line":"            except Exception:"},{"line_number":347,"context_line":"                self.exception(broker,"},{"line_number":348,"context_line":"                               \u0027Failed to remove sync_store entry\u0027)"},{"line_number":349,"context_line":""},{"line_number":350,"context_line":"        return super(ContainerReplicator, self).delete_db(broker)"},{"line_number":351,"context_line":""}],"source_content_type":"text/x-python","patch_set":39,"id":"488bee28_43e01f95","line":348,"updated":"2025-10-02 19:59:13.000000000","message":"The new tests in the subsequent revision will have coverage for this change as well","commit_id":"777cc77329b3e38f3632b7d4e6172875c77973b1"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"1b8dfd167b01c5148c1ded37fb2d62590e7cd581","unresolved":false,"context_lines":[{"line_number":345,"context_line":"                self.sync_store.remove_synced_container(broker)"},{"line_number":346,"context_line":"            except Exception:"},{"line_number":347,"context_line":"                self.exception(broker,"},{"line_number":348,"context_line":"                               \u0027Failed to remove sync_store entry\u0027)"},{"line_number":349,"context_line":""},{"line_number":350,"context_line":"        return super(ContainerReplicator, self).delete_db(broker)"},{"line_number":351,"context_line":""}],"source_content_type":"text/x-python","patch_set":39,"id":"9c44d79b_d89b5f73","line":348,"in_reply_to":"488bee28_43e01f95","updated":"2025-10-02 20:01:09.000000000","message":"Done","commit_id":"777cc77329b3e38f3632b7d4e6172875c77973b1"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"44d16c35e3628fb4c843b1586e43f74eb435db61","unresolved":true,"context_lines":[{"line_number":127,"context_line":"            if not self._send_replicate_request("},{"line_number":128,"context_line":"                    http, \u0027merge_shard_ranges\u0027, shard_range_data, local_id):"},{"line_number":129,"context_line":"                return False"},{"line_number":130,"context_line":"            node_str \u003d \u0027%(ip)s:%(port)s/%(device)s\u0027 % http.node"},{"line_number":131,"context_line":"            self.db_log.debug(broker, \u0027synced %s shard ranges to %s\u0027,"},{"line_number":132,"context_line":"                              len(shard_range_data), node_str)"},{"line_number":133,"context_line":"        return True"}],"source_content_type":"text/x-python","patch_set":44,"id":"bbe4d1f2_38b06996","line":130,"updated":"2025-10-09 14:53:29.000000000","message":"please use the existing helper to format the node string\nhttps://github.com/openstack/swift/blob/d9883d083409baac3db44e1db14bf3c79a75f411/swift/common/utils/__init__.py#L1168-L1181\n\nUsing the helper  ensures that we always log nodes in the same format.\n\nAlso (possibly off-topic) I think we should be logging the *replication* ip \u0026 port","commit_id":"f8607fbc8b0dd7898fc224dfc6d2dd231957ae0c"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"187adedb6cfd0da586b6778c6dc008077a240e81","unresolved":false,"context_lines":[{"line_number":127,"context_line":"            if not self._send_replicate_request("},{"line_number":128,"context_line":"                    http, \u0027merge_shard_ranges\u0027, shard_range_data, local_id):"},{"line_number":129,"context_line":"                return False"},{"line_number":130,"context_line":"            node_str \u003d \u0027%(ip)s:%(port)s/%(device)s\u0027 % http.node"},{"line_number":131,"context_line":"            self.db_log.debug(broker, \u0027synced %s shard ranges to %s\u0027,"},{"line_number":132,"context_line":"                              len(shard_range_data), node_str)"},{"line_number":133,"context_line":"        return True"}],"source_content_type":"text/x-python","patch_set":44,"id":"d97008c5_d413a658","line":130,"in_reply_to":"bbe4d1f2_38b06996","updated":"2025-10-11 22:14:28.000000000","message":"Done","commit_id":"f8607fbc8b0dd7898fc224dfc6d2dd231957ae0c"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"44d16c35e3628fb4c843b1586e43f74eb435db61","unresolved":true,"context_lines":[{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def _choose_replication_mode(self, node, rinfo, info, local_sync, broker,"},{"line_number":136,"context_line":"                                 http, different_region):"},{"line_number":137,"context_line":"        node_str \u003d \u0027%(ip)s:%(port)s/%(device)s\u0027 % node"},{"line_number":138,"context_line":"        if \u0027shard_max_row\u0027 in rinfo:"},{"line_number":139,"context_line":"            # Always replicate shard ranges to new-enough swift"},{"line_number":140,"context_line":"            shard_range_success \u003d self._sync_shard_ranges("}],"source_content_type":"text/x-python","patch_set":44,"id":"dc681b0c_c7642d67","line":137,"updated":"2025-10-09 14:53:29.000000000","message":"please use the existing helper to format the node string\nhttps://github.com/openstack/swift/blob/d9883d083409baac3db44e1db14bf3c79a75f411/swift/common/utils/__init__.py#L1168-L1181\n\nUsing the helper  ensures that we always log nodes in the same format.","commit_id":"f8607fbc8b0dd7898fc224dfc6d2dd231957ae0c"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"187adedb6cfd0da586b6778c6dc008077a240e81","unresolved":false,"context_lines":[{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def _choose_replication_mode(self, node, rinfo, info, local_sync, broker,"},{"line_number":136,"context_line":"                                 http, different_region):"},{"line_number":137,"context_line":"        node_str \u003d \u0027%(ip)s:%(port)s/%(device)s\u0027 % node"},{"line_number":138,"context_line":"        if \u0027shard_max_row\u0027 in rinfo:"},{"line_number":139,"context_line":"            # Always replicate shard ranges to new-enough swift"},{"line_number":140,"context_line":"            shard_range_success \u003d self._sync_shard_ranges("}],"source_content_type":"text/x-python","patch_set":44,"id":"267bc49e_e1e8f172","line":137,"in_reply_to":"dc681b0c_c7642d67","updated":"2025-10-11 22:14:28.000000000","message":"Done","commit_id":"f8607fbc8b0dd7898fc224dfc6d2dd231957ae0c"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"44d16c35e3628fb4c843b1586e43f74eb435db61","unresolved":true,"context_lines":[{"line_number":144,"context_line":"            self.db_log.warning("},{"line_number":145,"context_line":"                broker,"},{"line_number":146,"context_line":"                \u0027is unable to replicate shard ranges to peer %s; \u0027"},{"line_number":147,"context_line":"                \u0027peer may need upgrading\u0027, node_str)"},{"line_number":148,"context_line":"        if broker.sharding_initiated():"},{"line_number":149,"context_line":"            if info[\u0027db_state\u0027] \u003d\u003d SHARDED and len("},{"line_number":150,"context_line":"                    broker.get_objects(limit\u003d1)) \u003d\u003d 0:"}],"source_content_type":"text/x-python","patch_set":44,"id":"e2c3c1be_9eb0b291","line":147,"updated":"2025-10-09 14:53:29.000000000","message":"these log messages have lost the subject of the sentence\n```\nWARNING: is unable to replicate shard ranges to peer\n```\nmight read better as\n```\nWARNING: unable to replicate shard ranges to peer\n```\n\nsee 963570: sq: container replicator: fixups for log messages and tests | https://review.opendev.org/c/openstack/swift/+/963570","commit_id":"f8607fbc8b0dd7898fc224dfc6d2dd231957ae0c"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"187adedb6cfd0da586b6778c6dc008077a240e81","unresolved":false,"context_lines":[{"line_number":144,"context_line":"            self.db_log.warning("},{"line_number":145,"context_line":"                broker,"},{"line_number":146,"context_line":"                \u0027is unable to replicate shard ranges to peer %s; \u0027"},{"line_number":147,"context_line":"                \u0027peer may need upgrading\u0027, node_str)"},{"line_number":148,"context_line":"        if broker.sharding_initiated():"},{"line_number":149,"context_line":"            if info[\u0027db_state\u0027] \u003d\u003d SHARDED and len("},{"line_number":150,"context_line":"                    broker.get_objects(limit\u003d1)) \u003d\u003d 0:"}],"source_content_type":"text/x-python","patch_set":44,"id":"5118c58f_eeb38b40","line":147,"in_reply_to":"e2c3c1be_9eb0b291","updated":"2025-10-11 22:14:28.000000000","message":"Done","commit_id":"f8607fbc8b0dd7898fc224dfc6d2dd231957ae0c"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"44d16c35e3628fb4c843b1586e43f74eb435db61","unresolved":true,"context_lines":[{"line_number":157,"context_line":"                self.db_log.warning("},{"line_number":158,"context_line":"                    broker,"},{"line_number":159,"context_line":"                    \u0027is able to shard -- refusing to replicate objects to\u0027"},{"line_number":160,"context_line":"                    \u0027 peer %s; have shard ranges and will wait for cleaving\u0027,"},{"line_number":161,"context_line":"                    node_str)"},{"line_number":162,"context_line":"            self.stats[\u0027deferred\u0027] +\u003d 1"},{"line_number":163,"context_line":"            return shard_range_success"}],"source_content_type":"text/x-python","patch_set":44,"id":"88f72a4a_f88f20a1","line":160,"updated":"2025-10-09 14:53:29.000000000","message":"ditto re line 147\n\nperhaps ``warning: able to shard -- ...``","commit_id":"f8607fbc8b0dd7898fc224dfc6d2dd231957ae0c"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"187adedb6cfd0da586b6778c6dc008077a240e81","unresolved":false,"context_lines":[{"line_number":157,"context_line":"                self.db_log.warning("},{"line_number":158,"context_line":"                    broker,"},{"line_number":159,"context_line":"                    \u0027is able to shard -- refusing to replicate objects to\u0027"},{"line_number":160,"context_line":"                    \u0027 peer %s; have shard ranges and will wait for cleaving\u0027,"},{"line_number":161,"context_line":"                    node_str)"},{"line_number":162,"context_line":"            self.stats[\u0027deferred\u0027] +\u003d 1"},{"line_number":163,"context_line":"            return shard_range_success"}],"source_content_type":"text/x-python","patch_set":44,"id":"243addc6_9e49bf6f","line":160,"in_reply_to":"88f72a4a_f88f20a1","updated":"2025-10-11 22:14:28.000000000","message":"Done","commit_id":"f8607fbc8b0dd7898fc224dfc6d2dd231957ae0c"}],"swift/container/sharder.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"875e1a38455dd65abd2f2109d74e1f4b4241415d","unresolved":true,"context_lines":[{"line_number":917,"context_line":"        db_file, path \u003d self._get_broker_details(broker)"},{"line_number":918,"context_line":"        if args:"},{"line_number":919,"context_line":"            msg \u003d msg % args"},{"line_number":920,"context_line":"        return \u0027%s, path: %s, db: %s\u0027 % (msg, quote(path), db_file)"},{"line_number":921,"context_line":""},{"line_number":922,"context_line":"    def _log(self, level, broker, msg, *args):"},{"line_number":923,"context_line":"        if not self.logger.isEnabledFor(level):"}],"source_content_type":"text/x-python","patch_set":10,"id":"e9e42280_c5eb6261","side":"PARENT","line":920,"updated":"2025-08-08 20:07:09.000000000","message":"why is this \"switcheroo\" here in the order of file, path \u003d\u003e path, file","commit_id":"c8d00108a61852143569f5f96c601675374ff095"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"5a5835d9ec63412e0296f3eda3e67a216e9eb933","unresolved":false,"context_lines":[{"line_number":917,"context_line":"        db_file, path \u003d self._get_broker_details(broker)"},{"line_number":918,"context_line":"        if args:"},{"line_number":919,"context_line":"            msg \u003d msg % args"},{"line_number":920,"context_line":"        return \u0027%s, path: %s, db: %s\u0027 % (msg, quote(path), db_file)"},{"line_number":921,"context_line":""},{"line_number":922,"context_line":"    def _log(self, level, broker, msg, *args):"},{"line_number":923,"context_line":"        if not self.logger.isEnabledFor(level):"}],"source_content_type":"text/x-python","patch_set":10,"id":"10fc018e_6099c267","side":"PARENT","line":920,"in_reply_to":"e9e42280_c5eb6261","updated":"2025-08-11 17:15:24.000000000","message":"Done","commit_id":"c8d00108a61852143569f5f96c601675374ff095"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ee99bf437df4fe26947fe314236a9cc1d9935536","unresolved":true,"context_lines":[{"line_number":917,"context_line":"        db_file, path \u003d self._get_broker_details(broker)"},{"line_number":918,"context_line":"        if args:"},{"line_number":919,"context_line":"            msg \u003d msg % args"},{"line_number":920,"context_line":"        return \u0027%s, path: %s, db: %s\u0027 % (msg, quote(path), db_file)"},{"line_number":921,"context_line":""},{"line_number":922,"context_line":"    def _log(self, level, broker, msg, *args):"},{"line_number":923,"context_line":"        if not self.logger.isEnabledFor(level):"}],"source_content_type":"text/x-python","patch_set":10,"id":"7817e0be_0362aec5","side":"PARENT","line":920,"in_reply_to":"e9e42280_c5eb6261","updated":"2025-08-11 15:58:26.000000000","message":"N.B. it\u0027d be better to change the order of the return tuple instead of the log message.","commit_id":"c8d00108a61852143569f5f96c601675374ff095"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"875e1a38455dd65abd2f2109d74e1f4b4241415d","unresolved":true,"context_lines":[{"line_number":921,"context_line":""},{"line_number":922,"context_line":"    def _log(self, level, broker, msg, *args):"},{"line_number":923,"context_line":"        if not self.logger.isEnabledFor(level):"},{"line_number":924,"context_line":"            return"},{"line_number":925,"context_line":""},{"line_number":926,"context_line":"        self.logger.log(level, self._format_log_msg(broker, msg, *args))"},{"line_number":927,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"f8905478_3e3b249f","side":"PARENT","line":924,"updated":"2025-08-08 20:07:09.000000000","message":"i don\u0027t understand why `self.logger.log` doesn\u0027t already do this for us... perhaps it\u0027s trying to optimize out the message formatting?  But `self.logger.log` could do that too...","commit_id":"c8d00108a61852143569f5f96c601675374ff095"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"ee99bf437df4fe26947fe314236a9cc1d9935536","unresolved":false,"context_lines":[{"line_number":921,"context_line":""},{"line_number":922,"context_line":"    def _log(self, level, broker, msg, *args):"},{"line_number":923,"context_line":"        if not self.logger.isEnabledFor(level):"},{"line_number":924,"context_line":"            return"},{"line_number":925,"context_line":""},{"line_number":926,"context_line":"        self.logger.log(level, self._format_log_msg(broker, msg, *args))"},{"line_number":927,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"55ac9914_f2d88e54","side":"PARENT","line":924,"in_reply_to":"f8905478_3e3b249f","updated":"2025-08-11 15:58:26.000000000","message":"turns out we\u0027re trying to avoid looking up the attributes on the broker which can trigger a query if not cached.","commit_id":"c8d00108a61852143569f5f96c601675374ff095"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"875e1a38455dd65abd2f2109d74e1f4b4241415d","unresolved":true,"context_lines":[{"line_number":948,"context_line":"            self._log(logging.WARNING, broker, msg, *args, **kwargs)"},{"line_number":949,"context_line":""},{"line_number":950,"context_line":"    def error(self, broker, msg, *args, **kwargs):"},{"line_number":951,"context_line":"        self._log(logging.ERROR, broker, msg, *args, **kwargs)"},{"line_number":952,"context_line":""},{"line_number":953,"context_line":"    def exception(self, broker, msg, *args, **kwargs):"},{"line_number":954,"context_line":"        if not self.logger.isEnabledFor(logging.ERROR):"}],"source_content_type":"text/x-python","patch_set":10,"id":"2dc88eda_2adc63a5","side":"PARENT","line":951,"updated":"2025-08-08 20:07:09.000000000","message":"there seems to be an existing `test_log_broker` in `test.unit.container.test_sharder` that should probably move to `test.unit.common.test_db_replicator` along with this implementation.","commit_id":"c8d00108a61852143569f5f96c601675374ff095"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"f970959920e0cebf9f0936b5240b56e7c8659db8","unresolved":false,"context_lines":[{"line_number":948,"context_line":"            self._log(logging.WARNING, broker, msg, *args, **kwargs)"},{"line_number":949,"context_line":""},{"line_number":950,"context_line":"    def error(self, broker, msg, *args, **kwargs):"},{"line_number":951,"context_line":"        self._log(logging.ERROR, broker, msg, *args, **kwargs)"},{"line_number":952,"context_line":""},{"line_number":953,"context_line":"    def exception(self, broker, msg, *args, **kwargs):"},{"line_number":954,"context_line":"        if not self.logger.isEnabledFor(logging.ERROR):"}],"source_content_type":"text/x-python","patch_set":10,"id":"a522928b_69410ac4","side":"PARENT","line":951,"in_reply_to":"2dc88eda_2adc63a5","updated":"2025-08-21 23:12:53.000000000","message":"Done","commit_id":"c8d00108a61852143569f5f96c601675374ff095"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"51befc999641047129f8a7691c4bafe1c4d24b3f","unresolved":true,"context_lines":[{"line_number":900,"context_line":"                     DEFAULT_PERIODIC_WARNINGS_INTERVAL))"},{"line_number":901,"context_line":"        self.periodic_warnings_start \u003d time.time()"},{"line_number":902,"context_line":"        self.periodic_warnings \u003d set()"},{"line_number":903,"context_line":"        self.broker_logger \u003d BrokerAnnotatedLogger(self.logger)"},{"line_number":904,"context_line":""},{"line_number":905,"context_line":"    def periodic_warning(self, broker, msg, *args, **kwargs):"},{"line_number":906,"context_line":"        now \u003d time.time()"}],"source_content_type":"text/x-python","patch_set":42,"id":"69b8c939_eb2df461","line":903,"updated":"2025-10-03 18:21:35.000000000","message":"why not `self.db_log` like the other classes?","commit_id":"cbe3c88083dfe0d96e7ae33bacbdc6aca811f8f8"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"c6fef9dc091ced427d65aab64fe3b6a37f2bf7ec","unresolved":true,"context_lines":[{"line_number":900,"context_line":"                     DEFAULT_PERIODIC_WARNINGS_INTERVAL))"},{"line_number":901,"context_line":"        self.periodic_warnings_start \u003d time.time()"},{"line_number":902,"context_line":"        self.periodic_warnings \u003d set()"},{"line_number":903,"context_line":"        self.broker_logger \u003d BrokerAnnotatedLogger(self.logger)"},{"line_number":904,"context_line":""},{"line_number":905,"context_line":"    def periodic_warning(self, broker, msg, *args, **kwargs):"},{"line_number":906,"context_line":"        now \u003d time.time()"}],"source_content_type":"text/x-python","patch_set":42,"id":"8798f212_b93e31a6","line":903,"in_reply_to":"69b8c939_eb2df461","updated":"2025-10-06 01:10:52.000000000","message":"oh see its logger here 😊","commit_id":"cbe3c88083dfe0d96e7ae33bacbdc6aca811f8f8"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"9b0d69985dc5c3c7d690ef07053d39653318d961","unresolved":false,"context_lines":[{"line_number":900,"context_line":"                     DEFAULT_PERIODIC_WARNINGS_INTERVAL))"},{"line_number":901,"context_line":"        self.periodic_warnings_start \u003d time.time()"},{"line_number":902,"context_line":"        self.periodic_warnings \u003d set()"},{"line_number":903,"context_line":"        self.broker_logger \u003d BrokerAnnotatedLogger(self.logger)"},{"line_number":904,"context_line":""},{"line_number":905,"context_line":"    def periodic_warning(self, broker, msg, *args, **kwargs):"},{"line_number":906,"context_line":"        now \u003d time.time()"}],"source_content_type":"text/x-python","patch_set":42,"id":"ba7a2609_76d36e07","line":903,"in_reply_to":"8798f212_b93e31a6","updated":"2025-10-08 15:43:05.000000000","message":"Done","commit_id":"cbe3c88083dfe0d96e7ae33bacbdc6aca811f8f8"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"44d16c35e3628fb4c843b1586e43f74eb435db61","unresolved":true,"context_lines":[{"line_number":909,"context_line":"            self.periodic_warnings.clear()"},{"line_number":910,"context_line":"            self.periodic_warnings_start \u003d now"},{"line_number":911,"context_line":""},{"line_number":912,"context_line":"        path, db_file \u003d self.db_log._get_broker_details(broker)"},{"line_number":913,"context_line":"        key \u003d (db_file, msg)"},{"line_number":914,"context_line":"        if key not in self.periodic_warnings:"},{"line_number":915,"context_line":"            self.periodic_warnings.add(key)"}],"source_content_type":"text/x-python","patch_set":44,"id":"b923da9a_623def62","line":912,"range":{"start_line":912,"start_character":36,"end_line":912,"end_character":55},"updated":"2025-10-09 14:53:29.000000000","message":"if you\u0027re going to use this method from another class then it should not be \u0027private\u0027 (i.e. not start with an underscore)\n\nHowever, I\u0027m not sure it is necessary: we need a key for the periodic warnings, and we use the db_file, so it can just be taken directly from ``broker.db_file``. ``path`` isn\u0027t used here.","commit_id":"f8607fbc8b0dd7898fc224dfc6d2dd231957ae0c"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"187adedb6cfd0da586b6778c6dc008077a240e81","unresolved":false,"context_lines":[{"line_number":909,"context_line":"            self.periodic_warnings.clear()"},{"line_number":910,"context_line":"            self.periodic_warnings_start \u003d now"},{"line_number":911,"context_line":""},{"line_number":912,"context_line":"        path, db_file \u003d self.db_log._get_broker_details(broker)"},{"line_number":913,"context_line":"        key \u003d (db_file, msg)"},{"line_number":914,"context_line":"        if key not in self.periodic_warnings:"},{"line_number":915,"context_line":"            self.periodic_warnings.add(key)"}],"source_content_type":"text/x-python","patch_set":44,"id":"6e8d26de_d7ccf150","line":912,"range":{"start_line":912,"start_character":36,"end_line":912,"end_character":55},"in_reply_to":"b923da9a_623def62","updated":"2025-10-11 22:14:28.000000000","message":"Done","commit_id":"f8607fbc8b0dd7898fc224dfc6d2dd231957ae0c"}],"test/unit/common/test_db_replicator.py":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"ab0313a96e4ac8f1e81227c8cd11b3e421c7b347","unresolved":true,"context_lines":[{"line_number":954,"context_line":"        self.assertTrue(res)"},{"line_number":955,"context_line":"        self.assertEqual("},{"line_number":956,"context_line":"            [\u0027Not deleting db %s (0/3 success), path: , db: %s\u0027 %"},{"line_number":957,"context_line":"             (broker.db_file, broker.db_file)],"},{"line_number":958,"context_line":"            replicator.logger.get_lines_for_level(\u0027debug\u0027))"},{"line_number":959,"context_line":""},{"line_number":960,"context_line":"        replicator.logger.clear()"}],"source_content_type":"text/x-python","patch_set":3,"id":"c7b6cb02_9e07bded","line":957,"range":{"start_line":957,"start_character":14,"end_line":957,"end_character":44},"updated":"2024-12-11 16:41:00.000000000","message":"this should be a headsup that the db file is being duplicated in the log lines","commit_id":"e93c0bcc364991ab4758a5cf162f82953f6baf7a"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"c11a5002eae6caf7eb20590a2e06d14db83ce311","unresolved":false,"context_lines":[{"line_number":954,"context_line":"        self.assertTrue(res)"},{"line_number":955,"context_line":"        self.assertEqual("},{"line_number":956,"context_line":"            [\u0027Not deleting db %s (0/3 success), path: , db: %s\u0027 %"},{"line_number":957,"context_line":"             (broker.db_file, broker.db_file)],"},{"line_number":958,"context_line":"            replicator.logger.get_lines_for_level(\u0027debug\u0027))"},{"line_number":959,"context_line":""},{"line_number":960,"context_line":"        replicator.logger.clear()"}],"source_content_type":"text/x-python","patch_set":3,"id":"f2312744_23b44e8b","line":957,"range":{"start_line":957,"start_character":14,"end_line":957,"end_character":44},"in_reply_to":"c7b6cb02_9e07bded","updated":"2025-08-07 22:40:52.000000000","message":"Done","commit_id":"e93c0bcc364991ab4758a5cf162f82953f6baf7a"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"ab0313a96e4ac8f1e81227c8cd11b3e421c7b347","unresolved":true,"context_lines":[{"line_number":966,"context_line":"        self.assertTrue(res)"},{"line_number":967,"context_line":"        self.assertEqual([\u0027Not deleting db %s (2/3 success)\u0027 %"},{"line_number":968,"context_line":"                         broker.db_file],"},{"line_number":969,"context_line":"                         [line.split(\u0027, path: \u0027)[0] for line in"},{"line_number":970,"context_line":"                         replicator.logger.get_lines_for_level(\u0027debug\u0027)])"},{"line_number":971,"context_line":"        replicator.logger.clear()"},{"line_number":972,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"51b12339_47900bb4","line":969,"updated":"2024-12-11 16:41:00.000000000","message":"what is this obscuring? and why? It\u0027s best to avoid truncating the thing that we\u0027re making assertion on\n\nThis seems to work:\n\n```\nself.assertEqual([\u0027Not deleting db %s (2/3 success), path: , db: %s\u0027 %\n                          (broker.db_file, broker.db_file)],\n                         replicator.logger.get_lines_for_level(\u0027debug\u0027))\n                         ```","commit_id":"e93c0bcc364991ab4758a5cf162f82953f6baf7a"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"c11a5002eae6caf7eb20590a2e06d14db83ce311","unresolved":false,"context_lines":[{"line_number":966,"context_line":"        self.assertTrue(res)"},{"line_number":967,"context_line":"        self.assertEqual([\u0027Not deleting db %s (2/3 success)\u0027 %"},{"line_number":968,"context_line":"                         broker.db_file],"},{"line_number":969,"context_line":"                         [line.split(\u0027, path: \u0027)[0] for line in"},{"line_number":970,"context_line":"                         replicator.logger.get_lines_for_level(\u0027debug\u0027)])"},{"line_number":971,"context_line":"        replicator.logger.clear()"},{"line_number":972,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"a5ef2479_4a197d66","line":969,"in_reply_to":"51b12339_47900bb4","updated":"2025-08-07 22:40:52.000000000","message":"Done","commit_id":"e93c0bcc364991ab4758a5cf162f82953f6baf7a"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"ab0313a96e4ac8f1e81227c8cd11b3e421c7b347","unresolved":true,"context_lines":[{"line_number":978,"context_line":"        self.assertTrue(res)"},{"line_number":979,"context_line":"        self.assertEqual([\u0027Not deleting db %s (2 new rows)\u0027 %"},{"line_number":980,"context_line":"                         broker.db_file],"},{"line_number":981,"context_line":"                         [line.split(\u0027, path: \u0027)[0] for line in"},{"line_number":982,"context_line":"                         replicator.logger.get_lines_for_level(\u0027debug\u0027)])"},{"line_number":983,"context_line":"        replicator.logger.clear()"},{"line_number":984,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"83e4f65e_0bf45a19","line":981,"updated":"2024-12-11 16:41:00.000000000","message":"ditto","commit_id":"e93c0bcc364991ab4758a5cf162f82953f6baf7a"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"c11a5002eae6caf7eb20590a2e06d14db83ce311","unresolved":false,"context_lines":[{"line_number":978,"context_line":"        self.assertTrue(res)"},{"line_number":979,"context_line":"        self.assertEqual([\u0027Not deleting db %s (2 new rows)\u0027 %"},{"line_number":980,"context_line":"                         broker.db_file],"},{"line_number":981,"context_line":"                         [line.split(\u0027, path: \u0027)[0] for line in"},{"line_number":982,"context_line":"                         replicator.logger.get_lines_for_level(\u0027debug\u0027)])"},{"line_number":983,"context_line":"        replicator.logger.clear()"},{"line_number":984,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"4e47d4f5_957b0aa9","line":981,"in_reply_to":"83e4f65e_0bf45a19","updated":"2025-08-07 22:40:52.000000000","message":"Done","commit_id":"e93c0bcc364991ab4758a5cf162f82953f6baf7a"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"ab0313a96e4ac8f1e81227c8cd11b3e421c7b347","unresolved":true,"context_lines":[{"line_number":990,"context_line":"        self.assertTrue(res)"},{"line_number":991,"context_line":"        broker.stub_replication_info \u003d None"},{"line_number":992,"context_line":"        self.assertEqual([\u0027Not deleting db %s (negative max_row_delta:\u0027"},{"line_number":993,"context_line":"                          \u0027 -1), path: , db: %s\u0027 %"},{"line_number":994,"context_line":"                          (broker.db_file, broker.db_file)],"},{"line_number":995,"context_line":"                         replicator.logger.get_lines_for_level(\u0027error\u0027))"},{"line_number":996,"context_line":"        replicator.logger.clear()"}],"source_content_type":"text/x-python","patch_set":3,"id":"7857f355_8b9e751b","line":993,"updated":"2024-12-11 16:41:00.000000000","message":"ok this one is more honest and reveals that the FakeBroker has no path attribute. We could fix that? but then and the base DatabaseBroker class has no path attribute (we could maybe fix that?).","commit_id":"e93c0bcc364991ab4758a5cf162f82953f6baf7a"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"c11a5002eae6caf7eb20590a2e06d14db83ce311","unresolved":false,"context_lines":[{"line_number":990,"context_line":"        self.assertTrue(res)"},{"line_number":991,"context_line":"        broker.stub_replication_info \u003d None"},{"line_number":992,"context_line":"        self.assertEqual([\u0027Not deleting db %s (negative max_row_delta:\u0027"},{"line_number":993,"context_line":"                          \u0027 -1), path: , db: %s\u0027 %"},{"line_number":994,"context_line":"                          (broker.db_file, broker.db_file)],"},{"line_number":995,"context_line":"                         replicator.logger.get_lines_for_level(\u0027error\u0027))"},{"line_number":996,"context_line":"        replicator.logger.clear()"}],"source_content_type":"text/x-python","patch_set":3,"id":"74f19ba8_7e79992d","line":993,"in_reply_to":"7857f355_8b9e751b","updated":"2025-08-07 22:40:52.000000000","message":"Done","commit_id":"e93c0bcc364991ab4758a5cf162f82953f6baf7a"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"875e1a38455dd65abd2f2109d74e1f4b4241415d","unresolved":true,"context_lines":[{"line_number":980,"context_line":"        mock_delete_db.assert_not_called()"},{"line_number":981,"context_line":"        self.assertTrue(res)"},{"line_number":982,"context_line":"        broker.stub_replication_info \u003d None"},{"line_number":983,"context_line":"        self.assertEqual([\u0027Not deleting db %s (negative max_row_delta: -1)\u0027 %"},{"line_number":984,"context_line":"                          broker.db_file],"},{"line_number":985,"context_line":"                         replicator.logger.get_lines_for_level(\u0027error\u0027))"},{"line_number":986,"context_line":"        replicator.logger.clear()"}],"source_content_type":"text/x-python","patch_set":10,"id":"7c7ad917_11ad71d4","side":"PARENT","line":983,"updated":"2025-08-08 20:07:09.000000000","message":"problaby the format I would have gone with is:\n\n```\nNot deleting (negative max_row_delta: -1), db: ..., path: ...\nNot deleting (N/3 success), db: ..., path: ...\n```\n\nThat\u0027s two differences from what\u0027s here:\n\n1) `Not deleting db ...` makes more sense when `db` is followed by the db_path and seems redundant once the db_path is moved to the end of the line (and still prefixed by `db: ...`)\n2) the *reason* we\u0027re not deleting was previously provided \"(in parentheses)\" - which seemed to highlight that it was extra information justifying the \"Not deleting\"","commit_id":"c8d00108a61852143569f5f96c601675374ff095"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"a98db65fbf3bf9a8395253a96c00e099a914b4e4","unresolved":false,"context_lines":[{"line_number":980,"context_line":"        mock_delete_db.assert_not_called()"},{"line_number":981,"context_line":"        self.assertTrue(res)"},{"line_number":982,"context_line":"        broker.stub_replication_info \u003d None"},{"line_number":983,"context_line":"        self.assertEqual([\u0027Not deleting db %s (negative max_row_delta: -1)\u0027 %"},{"line_number":984,"context_line":"                          broker.db_file],"},{"line_number":985,"context_line":"                         replicator.logger.get_lines_for_level(\u0027error\u0027))"},{"line_number":986,"context_line":"        replicator.logger.clear()"}],"source_content_type":"text/x-python","patch_set":10,"id":"483c489c_e7b3cb28","side":"PARENT","line":983,"in_reply_to":"7c7ad917_11ad71d4","updated":"2025-08-13 20:33:46.000000000","message":"Done","commit_id":"c8d00108a61852143569f5f96c601675374ff095"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"875e1a38455dd65abd2f2109d74e1f4b4241415d","unresolved":true,"context_lines":[{"line_number":1070,"context_line":"        self.assertEqual([\u0027/path/to/file\u0027], self.delete_db_calls)"},{"line_number":1071,"context_line":"        error_msgs \u003d replicator.logger.get_lines_for_level(\u0027error\u0027)"},{"line_number":1072,"context_line":"        expected \u003d \u0027Found /path/to/file for /a%20c%20t/c%20o%20n when it \u0027 \\"},{"line_number":1073,"context_line":"                   \u0027should be on partition 0; will replicate out and remove.\u0027"},{"line_number":1074,"context_line":"        self.assertEqual(error_msgs, [expected])"},{"line_number":1075,"context_line":""},{"line_number":1076,"context_line":"    def test_replicate_container_out_of_place(self):"}],"source_content_type":"text/x-python","patch_set":10,"id":"b35dcfe9_71eeafe0","line":1073,"updated":"2025-08-08 20:07:09.000000000","message":"this change is interesting - our FakeAccountBroker was apparently providing sufficient context for the previous log message to discover `/a%20c%20t` and yet somehow now it\u0027s decided the \"swift path\" is `/a%20c%20t/c%20o%20n`\n\n... which looks like a *container* path and sort of wrong if this is a FakeACCOUNTBroker","commit_id":"f33c4bb32009261c2e3205a4d8ba495e19da13a9"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"805f976a86ea467ad88c21f296b734692c19d1f9","unresolved":false,"context_lines":[{"line_number":1070,"context_line":"        self.assertEqual([\u0027/path/to/file\u0027], self.delete_db_calls)"},{"line_number":1071,"context_line":"        error_msgs \u003d replicator.logger.get_lines_for_level(\u0027error\u0027)"},{"line_number":1072,"context_line":"        expected \u003d \u0027Found /path/to/file for /a%20c%20t/c%20o%20n when it \u0027 \\"},{"line_number":1073,"context_line":"                   \u0027should be on partition 0; will replicate out and remove.\u0027"},{"line_number":1074,"context_line":"        self.assertEqual(error_msgs, [expected])"},{"line_number":1075,"context_line":""},{"line_number":1076,"context_line":"    def test_replicate_container_out_of_place(self):"}],"source_content_type":"text/x-python","patch_set":10,"id":"0f95ba2f_6bcc368f","line":1073,"in_reply_to":"b35dcfe9_71eeafe0","updated":"2025-08-25 21:57:38.000000000","message":"This issue moved around a little on the latest diff - but I think it\u0027s still there if we want to try and make our Fake\u0027s a little more like the realz.","commit_id":"f33c4bb32009261c2e3205a4d8ba495e19da13a9"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"53a65637ece9d6a83b24aabf6d955dd08c02e43a","unresolved":true,"context_lines":[{"line_number":975,"context_line":"                broker, info, [True] * 3)"},{"line_number":976,"context_line":"        mock_delete_db.assert_not_called()"},{"line_number":977,"context_line":"        self.assertTrue(res)"},{"line_number":978,"context_line":"        self.assertEqual([\u0027Not deleting 2 new rows, db: %s, path: %s\u0027"},{"line_number":979,"context_line":"                          % (broker.db_file, quote(broker.path))],"},{"line_number":980,"context_line":"                         replicator.logger.get_lines_for_level(\u0027debug\u0027))"},{"line_number":981,"context_line":"        replicator.logger.clear()"}],"source_content_type":"text/x-python","patch_set":12,"id":"8cdfc73a_68e9b268","line":978,"range":{"start_line":978,"start_character":31,"end_line":978,"end_character":50},"updated":"2025-08-11 09:22:58.000000000","message":"you\u0027ve lost the parentheses in all these messages, and this one is now particularly misleading. I much preferred the reason being in parentheses. i.e. ``Not deleting (2 new rows)``","commit_id":"c5b89dd4f6090a829d99b27a8f7d99fe06250845"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"a98db65fbf3bf9a8395253a96c00e099a914b4e4","unresolved":false,"context_lines":[{"line_number":975,"context_line":"                broker, info, [True] * 3)"},{"line_number":976,"context_line":"        mock_delete_db.assert_not_called()"},{"line_number":977,"context_line":"        self.assertTrue(res)"},{"line_number":978,"context_line":"        self.assertEqual([\u0027Not deleting 2 new rows, db: %s, path: %s\u0027"},{"line_number":979,"context_line":"                          % (broker.db_file, quote(broker.path))],"},{"line_number":980,"context_line":"                         replicator.logger.get_lines_for_level(\u0027debug\u0027))"},{"line_number":981,"context_line":"        replicator.logger.clear()"}],"source_content_type":"text/x-python","patch_set":12,"id":"bbf79d5d_4caab39f","line":978,"range":{"start_line":978,"start_character":31,"end_line":978,"end_character":50},"in_reply_to":"8cdfc73a_68e9b268","updated":"2025-08-13 20:33:46.000000000","message":"Done","commit_id":"c5b89dd4f6090a829d99b27a8f7d99fe06250845"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"512447750c70d90602b79cdbf33c76dcbf8035d8","unresolved":true,"context_lines":[{"line_number":203,"context_line":"    db_contains_type \u003d \u0027object\u0027"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"    def __init__(self, db_file\u003dNone, **kwargs):"},{"line_number":206,"context_line":"        self.db_file \u003d db_file or FakeBroker.db_file"},{"line_number":207,"context_line":"        self.locked \u003d False"},{"line_number":208,"context_line":"        self.metadata \u003d {}"},{"line_number":209,"context_line":"        account \u003d kwargs.get(\u0027account\u0027, TEST_ACCOUNT_NAME)"}],"source_content_type":"text/x-python","patch_set":18,"id":"bbc47a37_2cbe42ee","line":206,"range":{"start_line":206,"start_character":34,"end_line":206,"end_character":52},"updated":"2025-08-20 13:40:09.000000000","message":"is ``FakeBroker.__db_file__`` still needed or can this just say\n\n```\nself.db_file \u003d db_file or __file__\n```","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"01b45c5494fa8905e6a1eb517e55132e4a18c792","unresolved":false,"context_lines":[{"line_number":203,"context_line":"    db_contains_type \u003d \u0027object\u0027"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"    def __init__(self, db_file\u003dNone, **kwargs):"},{"line_number":206,"context_line":"        self.db_file \u003d db_file or FakeBroker.db_file"},{"line_number":207,"context_line":"        self.locked \u003d False"},{"line_number":208,"context_line":"        self.metadata \u003d {}"},{"line_number":209,"context_line":"        account \u003d kwargs.get(\u0027account\u0027, TEST_ACCOUNT_NAME)"}],"source_content_type":"text/x-python","patch_set":18,"id":"c39c70ea_88483082","line":206,"range":{"start_line":206,"start_character":34,"end_line":206,"end_character":52},"in_reply_to":"bbc47a37_2cbe42ee","updated":"2025-08-21 01:09:16.000000000","message":"Done","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"512447750c70d90602b79cdbf33c76dcbf8035d8","unresolved":true,"context_lines":[{"line_number":206,"context_line":"        self.db_file \u003d db_file or FakeBroker.db_file"},{"line_number":207,"context_line":"        self.locked \u003d False"},{"line_number":208,"context_line":"        self.metadata \u003d {}"},{"line_number":209,"context_line":"        account \u003d kwargs.get(\u0027account\u0027, TEST_ACCOUNT_NAME)"},{"line_number":210,"context_line":"        container \u003d kwargs.get(\u0027container\u0027, TEST_CONTAINER_NAME)"},{"line_number":211,"context_line":"        self.info \u003d {\u0027account\u0027: account, \u0027container\u0027: container}"},{"line_number":212,"context_line":"        self.path \u003d \u0027%s/%s\u0027 % (account, container)"}],"source_content_type":"text/x-python","patch_set":18,"id":"b62d7938_c118d0f9","line":209,"range":{"start_line":209,"start_character":17,"end_line":209,"end_character":38},"updated":"2025-08-20 13:40:09.000000000","message":"can these just be spelt out in the ``__init__`` signature?","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"01b45c5494fa8905e6a1eb517e55132e4a18c792","unresolved":false,"context_lines":[{"line_number":206,"context_line":"        self.db_file \u003d db_file or FakeBroker.db_file"},{"line_number":207,"context_line":"        self.locked \u003d False"},{"line_number":208,"context_line":"        self.metadata \u003d {}"},{"line_number":209,"context_line":"        account \u003d kwargs.get(\u0027account\u0027, TEST_ACCOUNT_NAME)"},{"line_number":210,"context_line":"        container \u003d kwargs.get(\u0027container\u0027, TEST_CONTAINER_NAME)"},{"line_number":211,"context_line":"        self.info \u003d {\u0027account\u0027: account, \u0027container\u0027: container}"},{"line_number":212,"context_line":"        self.path \u003d \u0027%s/%s\u0027 % (account, container)"}],"source_content_type":"text/x-python","patch_set":18,"id":"520a6d80_9128a537","line":209,"range":{"start_line":209,"start_character":17,"end_line":209,"end_character":38},"in_reply_to":"b62d7938_c118d0f9","updated":"2025-08-21 01:09:16.000000000","message":"Acknowledged","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"01b45c5494fa8905e6a1eb517e55132e4a18c792","unresolved":false,"context_lines":[{"line_number":206,"context_line":"        self.db_file \u003d db_file or FakeBroker.db_file"},{"line_number":207,"context_line":"        self.locked \u003d False"},{"line_number":208,"context_line":"        self.metadata \u003d {}"},{"line_number":209,"context_line":"        account \u003d kwargs.get(\u0027account\u0027, TEST_ACCOUNT_NAME)"},{"line_number":210,"context_line":"        container \u003d kwargs.get(\u0027container\u0027, TEST_CONTAINER_NAME)"},{"line_number":211,"context_line":"        self.info \u003d {\u0027account\u0027: account, \u0027container\u0027: container}"},{"line_number":212,"context_line":"        self.path \u003d \u0027%s/%s\u0027 % (account, container)"}],"source_content_type":"text/x-python","patch_set":18,"id":"dbd71e6b_e65ebc43","line":209,"range":{"start_line":209,"start_character":17,"end_line":209,"end_character":38},"in_reply_to":"b62d7938_c118d0f9","updated":"2025-08-21 01:09:16.000000000","message":"Done","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"512447750c70d90602b79cdbf33c76dcbf8035d8","unresolved":true,"context_lines":[{"line_number":431,"context_line":"        fake_device \u003d {\u0027replication_ip\u0027: \u0027127.0.0.1\u0027, \u0027device\u0027: \u0027sda1\u0027}"},{"line_number":432,"context_line":""},{"line_number":433,"context_line":"        def _rsync_file_stub(broker_arg, remote_file, *args, **kwargs):"},{"line_number":434,"context_line":"            # we just need it to return True; add assertions if you want"},{"line_number":435,"context_line":"            self.assertIsInstance(broker_arg, FakeBroker)"},{"line_number":436,"context_line":"            return True"},{"line_number":437,"context_line":"        replicator._rsync_file \u003d _rsync_file_stub"}],"source_content_type":"text/x-python","patch_set":18,"id":"67b0cea0_9edc8d97","line":434,"range":{"start_line":434,"start_character":44,"end_line":434,"end_character":72},"updated":"2025-08-20 13:40:09.000000000","message":"not sure I understand this second part of the comment - the very next line *is* an assertion","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"01b45c5494fa8905e6a1eb517e55132e4a18c792","unresolved":false,"context_lines":[{"line_number":431,"context_line":"        fake_device \u003d {\u0027replication_ip\u0027: \u0027127.0.0.1\u0027, \u0027device\u0027: \u0027sda1\u0027}"},{"line_number":432,"context_line":""},{"line_number":433,"context_line":"        def _rsync_file_stub(broker_arg, remote_file, *args, **kwargs):"},{"line_number":434,"context_line":"            # we just need it to return True; add assertions if you want"},{"line_number":435,"context_line":"            self.assertIsInstance(broker_arg, FakeBroker)"},{"line_number":436,"context_line":"            return True"},{"line_number":437,"context_line":"        replicator._rsync_file \u003d _rsync_file_stub"}],"source_content_type":"text/x-python","patch_set":18,"id":"529507d8_f543838f","line":434,"range":{"start_line":434,"start_character":44,"end_line":434,"end_character":72},"in_reply_to":"67b0cea0_9edc8d97","updated":"2025-08-21 01:09:16.000000000","message":"Acknowledged","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"01b45c5494fa8905e6a1eb517e55132e4a18c792","unresolved":false,"context_lines":[{"line_number":431,"context_line":"        fake_device \u003d {\u0027replication_ip\u0027: \u0027127.0.0.1\u0027, \u0027device\u0027: \u0027sda1\u0027}"},{"line_number":432,"context_line":""},{"line_number":433,"context_line":"        def _rsync_file_stub(broker_arg, remote_file, *args, **kwargs):"},{"line_number":434,"context_line":"            # we just need it to return True; add assertions if you want"},{"line_number":435,"context_line":"            self.assertIsInstance(broker_arg, FakeBroker)"},{"line_number":436,"context_line":"            return True"},{"line_number":437,"context_line":"        replicator._rsync_file \u003d _rsync_file_stub"}],"source_content_type":"text/x-python","patch_set":18,"id":"2a1319ff_8a6a6657","line":434,"range":{"start_line":434,"start_character":44,"end_line":434,"end_character":72},"in_reply_to":"67b0cea0_9edc8d97","updated":"2025-08-21 01:09:16.000000000","message":"Done","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"512447750c70d90602b79cdbf33c76dcbf8035d8","unresolved":true,"context_lines":[{"line_number":484,"context_line":"            self.assertEqual(True, replicator._rsync_file_called)"},{"line_number":485,"context_line":""},{"line_number":486,"context_line":"    def test_rsync_db_change_after_sync(self):"},{"line_number":487,"context_line":"        case \u003d self"},{"line_number":488,"context_line":""},{"line_number":489,"context_line":"        class MyTestReplicator(ConcreteReplicator):"},{"line_number":490,"context_line":"            def __init__(self, broker):"}],"source_content_type":"text/x-python","patch_set":18,"id":"4fc3cff3_b5f12e6f","line":487,"range":{"start_line":487,"start_character":8,"end_line":487,"end_character":12},"updated":"2025-08-20 13:40:09.000000000","message":"``case`` is a python keyword since 3.10, please don\u0027t re-use it \nhttps://docs.python.org/3/tutorial/controlflow.html#match-statements\n\nIMHO the existing code with ``self_`` was fine","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"01b45c5494fa8905e6a1eb517e55132e4a18c792","unresolved":false,"context_lines":[{"line_number":484,"context_line":"            self.assertEqual(True, replicator._rsync_file_called)"},{"line_number":485,"context_line":""},{"line_number":486,"context_line":"    def test_rsync_db_change_after_sync(self):"},{"line_number":487,"context_line":"        case \u003d self"},{"line_number":488,"context_line":""},{"line_number":489,"context_line":"        class MyTestReplicator(ConcreteReplicator):"},{"line_number":490,"context_line":"            def __init__(self, broker):"}],"source_content_type":"text/x-python","patch_set":18,"id":"04a8b81b_b1babf61","line":487,"range":{"start_line":487,"start_character":8,"end_line":487,"end_character":12},"in_reply_to":"4fc3cff3_b5f12e6f","updated":"2025-08-21 01:09:16.000000000","message":"Acknowledged","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"512447750c70d90602b79cdbf33c76dcbf8035d8","unresolved":true,"context_lines":[{"line_number":969,"context_line":"                broker, info, [False] * 3)"},{"line_number":970,"context_line":"        mock_delete_db.assert_not_called()"},{"line_number":971,"context_line":"        self.assertTrue(res)"},{"line_number":972,"context_line":"        self.assertEqual([\u0027Not deleting (0/3 success), path: %s, db: %s\u0027"},{"line_number":973,"context_line":"                          % (quote(broker.path), broker.db_file)],"},{"line_number":974,"context_line":"                         replicator.logger.get_lines_for_level(\u0027debug\u0027))"},{"line_number":975,"context_line":"        replicator.logger.clear()"}],"source_content_type":"text/x-python","patch_set":18,"id":"693b6985_20c28107","line":972,"range":{"start_line":972,"start_character":27,"end_line":972,"end_character":40},"updated":"2025-08-20 13:40:09.000000000","message":"I think it would be better to still have the \u0027Not deleting _db_\u0027 so the message makes it really obvious what hasn\u0027t been deleted\n\nDitto other cases","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"01b45c5494fa8905e6a1eb517e55132e4a18c792","unresolved":false,"context_lines":[{"line_number":969,"context_line":"                broker, info, [False] * 3)"},{"line_number":970,"context_line":"        mock_delete_db.assert_not_called()"},{"line_number":971,"context_line":"        self.assertTrue(res)"},{"line_number":972,"context_line":"        self.assertEqual([\u0027Not deleting (0/3 success), path: %s, db: %s\u0027"},{"line_number":973,"context_line":"                          % (quote(broker.path), broker.db_file)],"},{"line_number":974,"context_line":"                         replicator.logger.get_lines_for_level(\u0027debug\u0027))"},{"line_number":975,"context_line":"        replicator.logger.clear()"}],"source_content_type":"text/x-python","patch_set":18,"id":"d2d73d88_d8977c0c","line":972,"range":{"start_line":972,"start_character":27,"end_line":972,"end_character":40},"in_reply_to":"693b6985_20c28107","updated":"2025-08-21 01:09:16.000000000","message":"Done","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"512447750c70d90602b79cdbf33c76dcbf8035d8","unresolved":true,"context_lines":[{"line_number":1366,"context_line":""},{"line_number":1367,"context_line":"        def mock_renamer(old, new):"},{"line_number":1368,"context_line":"            self.assertEqual(\u0027/drive/tmp/arg1\u0027, old)"},{"line_number":1369,"context_line":"            # With the new FakeBroker, broker.db_file \u003d\u003d target_db (passed in)"},{"line_number":1370,"context_line":"            self.assertEqual(target_db, new)"},{"line_number":1371,"context_line":""},{"line_number":1372,"context_line":"        self._patch(patch.object, db_replicator, \u0027renamer\u0027, mock_renamer)"}],"source_content_type":"text/x-python","patch_set":18,"id":"3db3377b_9376ef16","line":1369,"updated":"2025-08-20 13:40:09.000000000","message":"IIUC this is side-effect of the improved FakeBroker; I\u0027m not sure the comment is necessary and the relevance of \u0027new\u0027 will be lost in time","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"01b45c5494fa8905e6a1eb517e55132e4a18c792","unresolved":false,"context_lines":[{"line_number":1366,"context_line":""},{"line_number":1367,"context_line":"        def mock_renamer(old, new):"},{"line_number":1368,"context_line":"            self.assertEqual(\u0027/drive/tmp/arg1\u0027, old)"},{"line_number":1369,"context_line":"            # With the new FakeBroker, broker.db_file \u003d\u003d target_db (passed in)"},{"line_number":1370,"context_line":"            self.assertEqual(target_db, new)"},{"line_number":1371,"context_line":""},{"line_number":1372,"context_line":"        self._patch(patch.object, db_replicator, \u0027renamer\u0027, mock_renamer)"}],"source_content_type":"text/x-python","patch_set":18,"id":"13a35d56_be66d9c9","line":1369,"in_reply_to":"3db3377b_9376ef16","updated":"2025-08-21 01:09:16.000000000","message":"Acknowledged","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"01b45c5494fa8905e6a1eb517e55132e4a18c792","unresolved":false,"context_lines":[{"line_number":1366,"context_line":""},{"line_number":1367,"context_line":"        def mock_renamer(old, new):"},{"line_number":1368,"context_line":"            self.assertEqual(\u0027/drive/tmp/arg1\u0027, old)"},{"line_number":1369,"context_line":"            # With the new FakeBroker, broker.db_file \u003d\u003d target_db (passed in)"},{"line_number":1370,"context_line":"            self.assertEqual(target_db, new)"},{"line_number":1371,"context_line":""},{"line_number":1372,"context_line":"        self._patch(patch.object, db_replicator, \u0027renamer\u0027, mock_renamer)"}],"source_content_type":"text/x-python","patch_set":18,"id":"89d1d644_0324b1c0","line":1369,"in_reply_to":"3db3377b_9376ef16","updated":"2025-08-21 01:09:16.000000000","message":"Acknowledged","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"512447750c70d90602b79cdbf33c76dcbf8035d8","unresolved":true,"context_lines":[{"line_number":1493,"context_line":"        self.assertEqual(errors,"},{"line_number":1494,"context_line":"                         [\"Unable to decode remote metadata \u0027metadata\u0027\","},{"line_number":1495,"context_line":"                          \"Quarantining DB, db: %s, path: %s\" %"},{"line_number":1496,"context_line":"                          (broker.db_file, quote(broker.path))])"},{"line_number":1497,"context_line":""},{"line_number":1498,"context_line":"    def test_replicator_sync(self):"},{"line_number":1499,"context_line":"        rpc \u003d db_replicator.ReplicatorRpc(\u0027/\u0027, \u0027/\u0027, FakeBroker,"}],"source_content_type":"text/x-python","patch_set":18,"id":"cb5404f7_abb134af","line":1496,"range":{"start_line":1496,"start_character":27,"end_line":1496,"end_character":61},"updated":"2025-08-20 13:40:09.000000000","message":"this is still ``db, path`` not ``path, db``","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"01b45c5494fa8905e6a1eb517e55132e4a18c792","unresolved":false,"context_lines":[{"line_number":1493,"context_line":"        self.assertEqual(errors,"},{"line_number":1494,"context_line":"                         [\"Unable to decode remote metadata \u0027metadata\u0027\","},{"line_number":1495,"context_line":"                          \"Quarantining DB, db: %s, path: %s\" %"},{"line_number":1496,"context_line":"                          (broker.db_file, quote(broker.path))])"},{"line_number":1497,"context_line":""},{"line_number":1498,"context_line":"    def test_replicator_sync(self):"},{"line_number":1499,"context_line":"        rpc \u003d db_replicator.ReplicatorRpc(\u0027/\u0027, \u0027/\u0027, FakeBroker,"}],"source_content_type":"text/x-python","patch_set":18,"id":"33f5ea28_23331e4a","line":1496,"range":{"start_line":1496,"start_character":27,"end_line":1496,"end_character":61},"in_reply_to":"cb5404f7_abb134af","updated":"2025-08-21 01:09:16.000000000","message":"Done","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"01b45c5494fa8905e6a1eb517e55132e4a18c792","unresolved":false,"context_lines":[{"line_number":1493,"context_line":"        self.assertEqual(errors,"},{"line_number":1494,"context_line":"                         [\"Unable to decode remote metadata \u0027metadata\u0027\","},{"line_number":1495,"context_line":"                          \"Quarantining DB, db: %s, path: %s\" %"},{"line_number":1496,"context_line":"                          (broker.db_file, quote(broker.path))])"},{"line_number":1497,"context_line":""},{"line_number":1498,"context_line":"    def test_replicator_sync(self):"},{"line_number":1499,"context_line":"        rpc \u003d db_replicator.ReplicatorRpc(\u0027/\u0027, \u0027/\u0027, FakeBroker,"}],"source_content_type":"text/x-python","patch_set":18,"id":"aa87145b_9756ad76","line":1496,"range":{"start_line":1496,"start_character":27,"end_line":1496,"end_character":61},"in_reply_to":"cb5404f7_abb134af","updated":"2025-08-21 01:09:16.000000000","message":"Done","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"512447750c70d90602b79cdbf33c76dcbf8035d8","unresolved":true,"context_lines":[{"line_number":2092,"context_line":"        self.assertEqual(self.replicator._repl_to_node("},{"line_number":2093,"context_line":"            self.fake_node, self.broker, \u00270\u0027, self.fake_info), True)"},{"line_number":2094,"context_line":"        self.assertEqual(self.replicator._rsync_db.call_count, 0)"},{"line_number":2095,"context_line":"        self.assertEqual(self.replicator._usync_db.call_count, 0)"},{"line_number":2096,"context_line":""},{"line_number":2097,"context_line":"    def test_repl_to_node_metadata_update(self):"},{"line_number":2098,"context_line":"        now \u003d Timestamp(time.time()).internal"}],"source_content_type":"text/x-python","patch_set":18,"id":"8fdf6e73_1b21980e","line":2095,"updated":"2025-08-20 13:40:09.000000000","message":"we don\u0027t always make assertions about debug lines, but since it has been changed by this patch I decided a check might be useful:\n\n```\ndiff --git a/test/unit/common/test_db_replicator.py b/test/unit/common/test_db_replicator.py\nindex 0ba8d6b3d..3a0554ad6 100644\n--- a/test/unit/common/test_db_replicator.py\n+++ b/test/unit/common/test_db_replicator.py\n@@ -1492,8 +1492,8 @@ class TestDBReplicator(unittest.TestCase):\n         errors \u003d rpc.logger.get_lines_for_level(\u0027error\u0027)\n         self.assertEqual(errors,\n                          [\"Unable to decode remote metadata \u0027metadata\u0027\",\n-                          \"Quarantining DB, db: %s, path: %s\" %\n-                          (broker.db_file, quote(broker.path))])\n+                          \"Quarantining DB, path: %s, db: %s\" %\n+                          (quote(broker.path), broker.db_file)])\n \n     def test_replicator_sync(self):\n         rpc \u003d db_replicator.ReplicatorRpc(\u0027/\u0027, \u0027/\u0027, FakeBroker,\n@@ -2044,14 +2044,14 @@ class TestReplToNode(unittest.TestCase):\n         db_replicator.ring \u003d FakeRing()\n         self.delete_db_calls \u003d []\n         self.broker \u003d FakeBroker()\n-        self.replicator \u003d ConcreteReplicator({\u0027per_diff\u0027: 10})\n+        self.replicator \u003d ConcreteReplicator({\u0027per_diff\u0027: 10},\n+                                             logger\u003ddebug_logger())\n         self.fake_node \u003d {\u0027ip\u0027: \u0027127.0.0.1\u0027, \u0027device\u0027: \u0027sda1\u0027, \u0027port\u0027: 1000}\n         self.fake_info \u003d {\u0027id\u0027: \u0027a\u0027, \u0027point\u0027: -1, \u0027max_row\u0027: 20, \u0027hash\u0027: \u0027b\u0027,\n                           \u0027created_at\u0027: 100, \u0027put_timestamp\u0027: 0,\n                           \u0027delete_timestamp\u0027: 0, \u0027count\u0027: 0,\n                           \u0027metadata\u0027: json.dumps({\n                               \u0027Test\u0027: (\u0027Value\u0027, normalize_timestamp(1))})}\n-        self.replicator.logger \u003d mock.Mock()\n         self.replicator._rsync_db \u003d mock.Mock(return_value\u003dTrue)\n         self.replicator._usync_db \u003d mock.Mock(return_value\u003dTrue)\n         self.http \u003d ReplHttp(\u0027{\"id\": 3, \"point\": -1}\u0027)\n@@ -2093,6 +2093,10 @@ class TestReplToNode(unittest.TestCase):\n             self.fake_node, self.broker, \u00270\u0027, self.fake_info), True)\n         self.assertEqual(self.replicator._rsync_db.call_count, 0)\n         self.assertEqual(self.replicator._usync_db.call_count, 0)\n+        lines \u003d self.replicator.logger.get_lines_for_level(\u0027debug\u0027)\n+        self.assertIn(\u0027in sync with 127.0.0.1:1000/sda1, nothing to do,\u0027\n+                      \u0027 path: %s, db: %s\u0027\n+                      % (quote(self.broker.path), self.broker.db_file), lines)\n \n     def test_repl_to_node_metadata_update(self):\n         now \u003d Timestamp(time.time()).internal\n\n```","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"01b45c5494fa8905e6a1eb517e55132e4a18c792","unresolved":false,"context_lines":[{"line_number":2092,"context_line":"        self.assertEqual(self.replicator._repl_to_node("},{"line_number":2093,"context_line":"            self.fake_node, self.broker, \u00270\u0027, self.fake_info), True)"},{"line_number":2094,"context_line":"        self.assertEqual(self.replicator._rsync_db.call_count, 0)"},{"line_number":2095,"context_line":"        self.assertEqual(self.replicator._usync_db.call_count, 0)"},{"line_number":2096,"context_line":""},{"line_number":2097,"context_line":"    def test_repl_to_node_metadata_update(self):"},{"line_number":2098,"context_line":"        now \u003d Timestamp(time.time()).internal"}],"source_content_type":"text/x-python","patch_set":18,"id":"5c780e06_53cb278c","line":2095,"in_reply_to":"8fdf6e73_1b21980e","updated":"2025-08-21 01:09:16.000000000","message":"Done","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"512447750c70d90602b79cdbf33c76dcbf8035d8","unresolved":true,"context_lines":[{"line_number":2225,"context_line":""},{"line_number":2226,"context_line":"    def _install_fake_rsync_file(self, daemon, captured_calls\u003dNone):"},{"line_number":2227,"context_line":"        def _rsync_file(src, remote_file, **kwargs):"},{"line_number":2228,"context_line":"            src_path \u003d getattr(src, \u0027db_file\u0027, src)"},{"line_number":2229,"context_line":"            if captured_calls is not None:"},{"line_number":2230,"context_line":"                captured_calls.append((src_path, remote_file, kwargs))"},{"line_number":2231,"context_line":"            remote_server, remote_path \u003d remote_file.split(\u0027/\u0027, 1)"}],"source_content_type":"text/x-python","patch_set":18,"id":"70222623_63e57ee9","line":2228,"updated":"2025-08-20 13:40:09.000000000","message":"nit: path is being used here to mean path to the db file, as opposed to in the logging where it is path in the namespace to the container resource","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"01b45c5494fa8905e6a1eb517e55132e4a18c792","unresolved":false,"context_lines":[{"line_number":2225,"context_line":""},{"line_number":2226,"context_line":"    def _install_fake_rsync_file(self, daemon, captured_calls\u003dNone):"},{"line_number":2227,"context_line":"        def _rsync_file(src, remote_file, **kwargs):"},{"line_number":2228,"context_line":"            src_path \u003d getattr(src, \u0027db_file\u0027, src)"},{"line_number":2229,"context_line":"            if captured_calls is not None:"},{"line_number":2230,"context_line":"                captured_calls.append((src_path, remote_file, kwargs))"},{"line_number":2231,"context_line":"            remote_server, remote_path \u003d remote_file.split(\u0027/\u0027, 1)"}],"source_content_type":"text/x-python","patch_set":18,"id":"51f08593_21e7b6e6","line":2228,"in_reply_to":"70222623_63e57ee9","updated":"2025-08-21 01:09:16.000000000","message":"Done","commit_id":"f009241071350438ebc9f7b854771d22024f0b48"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"14e47fa60709eafa0767c22348848bbca5561b22","unresolved":true,"context_lines":[{"line_number":440,"context_line":"        fake_device \u003d {\u0027ip\u0027: \u0027127.0.0.1\u0027, \u0027port\u0027: \u00270\u0027,"},{"line_number":441,"context_line":"                       \u0027replication_ip\u0027: \u0027127.0.0.1\u0027, \u0027replication_port\u0027: \u00270\u0027,"},{"line_number":442,"context_line":"                       \u0027device\u0027: \u0027sda1\u0027}"},{"line_number":443,"context_line":"        case \u003d self"},{"line_number":444,"context_line":""},{"line_number":445,"context_line":"        class MyTestReplicator(ConcreteReplicator):"},{"line_number":446,"context_line":"            def __init__(self, db_file, remote_file):"}],"source_content_type":"text/x-python","patch_set":21,"id":"ae49e99b_f1e35894","line":443,"range":{"start_line":443,"start_character":8,"end_line":443,"end_character":19},"updated":"2025-08-21 09:19:42.000000000","message":"``case`` keyword re-used: pls revert to using ``self_``","commit_id":"941e41427c390d407c85fe5f033dcc42aa367527"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"f970959920e0cebf9f0936b5240b56e7c8659db8","unresolved":false,"context_lines":[{"line_number":440,"context_line":"        fake_device \u003d {\u0027ip\u0027: \u0027127.0.0.1\u0027, \u0027port\u0027: \u00270\u0027,"},{"line_number":441,"context_line":"                       \u0027replication_ip\u0027: \u0027127.0.0.1\u0027, \u0027replication_port\u0027: \u00270\u0027,"},{"line_number":442,"context_line":"                       \u0027device\u0027: \u0027sda1\u0027}"},{"line_number":443,"context_line":"        case \u003d self"},{"line_number":444,"context_line":""},{"line_number":445,"context_line":"        class MyTestReplicator(ConcreteReplicator):"},{"line_number":446,"context_line":"            def __init__(self, db_file, remote_file):"}],"source_content_type":"text/x-python","patch_set":21,"id":"beedcd40_3498d932","line":443,"range":{"start_line":443,"start_character":8,"end_line":443,"end_character":19},"in_reply_to":"ae49e99b_f1e35894","updated":"2025-08-21 23:12:53.000000000","message":"Done","commit_id":"941e41427c390d407c85fe5f033dcc42aa367527"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"14e47fa60709eafa0767c22348848bbca5561b22","unresolved":true,"context_lines":[{"line_number":2072,"context_line":"        self.replicator.logger.increment \u003d inc_spy"},{"line_number":2073,"context_line":"        self.assertEqual(self.replicator._repl_to_node("},{"line_number":2074,"context_line":"            self.fake_node, self.broker, \u00270\u0027, self.fake_info), True)"},{"line_number":2075,"context_line":"        inc_spy.assert_called_with(\u0027remote_merges\u0027)"},{"line_number":2076,"context_line":"        self.replicator._rsync_db.assert_has_calls(["},{"line_number":2077,"context_line":"            mock.call(self.broker, self.fake_node, self.http,"},{"line_number":2078,"context_line":"                      self.fake_info[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":21,"id":"2b7e112b_7ca0f8ff","line":2075,"updated":"2025-08-21 09:19:42.000000000","message":"nice work with the mock, but your DebugLogger actually has a FakeStatsdClient that is already capturing the increment calls for you 😄\n\nSo you can write:\n```\n        self.assertEqual(\n            1,\n            self.replicator.logger.logger.statsd_client.counters[\n                \u0027remote_merges\u0027])\n\n```\n\nYou might want to make this less verbose by having the setUp \"dereference\" things:\n\n```\n        self.logger \u003d debug_logger()\n        self.fake_statsd_client \u003d self.logger.logger.statsd_client \n        self.replicator \u003d ConcreteReplicator({\u0027per_diff\u0027: 10},\n                                             logger\u003dself.logger)\n```\n\nthen here you can just have:\n\n```\n        self.assertEqual(1, self.fake_statsd_client.counters[\u0027remote_merges\u0027])\n\n```","commit_id":"941e41427c390d407c85fe5f033dcc42aa367527"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"f970959920e0cebf9f0936b5240b56e7c8659db8","unresolved":false,"context_lines":[{"line_number":2072,"context_line":"        self.replicator.logger.increment \u003d inc_spy"},{"line_number":2073,"context_line":"        self.assertEqual(self.replicator._repl_to_node("},{"line_number":2074,"context_line":"            self.fake_node, self.broker, \u00270\u0027, self.fake_info), True)"},{"line_number":2075,"context_line":"        inc_spy.assert_called_with(\u0027remote_merges\u0027)"},{"line_number":2076,"context_line":"        self.replicator._rsync_db.assert_has_calls(["},{"line_number":2077,"context_line":"            mock.call(self.broker, self.fake_node, self.http,"},{"line_number":2078,"context_line":"                      self.fake_info[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":21,"id":"95169410_fb0e81b5","line":2075,"in_reply_to":"2b7e112b_7ca0f8ff","updated":"2025-08-21 23:12:53.000000000","message":"Done","commit_id":"941e41427c390d407c85fe5f033dcc42aa367527"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"14e47fa60709eafa0767c22348848bbca5561b22","unresolved":true,"context_lines":[{"line_number":2115,"context_line":"    def test_repl_to_node_not_found(self):"},{"line_number":2116,"context_line":"        self.http \u003d ReplHttp(\u0027{\"id\": 3, \"point\": -1}\u0027, set_status\u003d404)"},{"line_number":2117,"context_line":"        inc_spy \u003d mock.Mock(wraps\u003dself.replicator.logger.increment)"},{"line_number":2118,"context_line":"        self.replicator.logger.increment \u003d inc_spy"},{"line_number":2119,"context_line":"        self.assertEqual(self.replicator._repl_to_node("},{"line_number":2120,"context_line":"            self.fake_node, self.broker, \u00270\u0027, self.fake_info, False), True)"},{"line_number":2121,"context_line":"        inc_spy.assert_any_call(\u0027rsyncs\u0027)"}],"source_content_type":"text/x-python","patch_set":21,"id":"7cdeb799_00ec9fb9","line":2118,"updated":"2025-08-21 09:19:42.000000000","message":"see line 2075","commit_id":"941e41427c390d407c85fe5f033dcc42aa367527"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"f970959920e0cebf9f0936b5240b56e7c8659db8","unresolved":false,"context_lines":[{"line_number":2115,"context_line":"    def test_repl_to_node_not_found(self):"},{"line_number":2116,"context_line":"        self.http \u003d ReplHttp(\u0027{\"id\": 3, \"point\": -1}\u0027, set_status\u003d404)"},{"line_number":2117,"context_line":"        inc_spy \u003d mock.Mock(wraps\u003dself.replicator.logger.increment)"},{"line_number":2118,"context_line":"        self.replicator.logger.increment \u003d inc_spy"},{"line_number":2119,"context_line":"        self.assertEqual(self.replicator._repl_to_node("},{"line_number":2120,"context_line":"            self.fake_node, self.broker, \u00270\u0027, self.fake_info, False), True)"},{"line_number":2121,"context_line":"        inc_spy.assert_any_call(\u0027rsyncs\u0027)"}],"source_content_type":"text/x-python","patch_set":21,"id":"616d422d_5f729e5b","line":2118,"in_reply_to":"7cdeb799_00ec9fb9","updated":"2025-08-21 23:12:53.000000000","message":"Done","commit_id":"941e41427c390d407c85fe5f033dcc42aa367527"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"805f976a86ea467ad88c21f296b734692c19d1f9","unresolved":true,"context_lines":[{"line_number":207,"context_line":"        self.db_file \u003d db_file or __file__"},{"line_number":208,"context_line":"        self.locked \u003d False"},{"line_number":209,"context_line":"        self.metadata \u003d {}"},{"line_number":210,"context_line":"        self.info \u003d {\u0027account\u0027: account, \u0027container\u0027: container}"},{"line_number":211,"context_line":"        self.path \u003d \u0027%s/%s\u0027 % (account, container)"},{"line_number":212,"context_line":"        return None"},{"line_number":213,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"100c5aa2_a2a9250d","line":210,"updated":"2025-08-25 21:57:38.000000000","message":"the code in db_replicator that got removed was doing something clever like:\n\n```\n                name \u003d \u0027/\u0027 + quote(info[\u0027account\u0027])\n                if \u0027container\u0027 in info:\n                    name +\u003d \u0027/\u0027 + quote(info[\u0027container\u0027])\n```","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4627d5e2d929b3d11a7df8574ddace4541f3eba8","unresolved":true,"context_lines":[{"line_number":207,"context_line":"        self.db_file \u003d db_file or __file__"},{"line_number":208,"context_line":"        self.locked \u003d False"},{"line_number":209,"context_line":"        self.metadata \u003d {}"},{"line_number":210,"context_line":"        self.info \u003d {\u0027account\u0027: account, \u0027container\u0027: container}"},{"line_number":211,"context_line":"        self.path \u003d \u0027%s/%s\u0027 % (account, container)"},{"line_number":212,"context_line":"        return None"},{"line_number":213,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"73630c8d_0911204e","line":210,"in_reply_to":"100c5aa2_a2a9250d","updated":"2025-09-26 18:02:47.000000000","message":"N.B. the `db_file\u003dNone` is actually really helpful b/c real code will call `self.broker_class(object_file)` and when `broker_class` is a `FakeBroker` (e.g. `ConcreteReplicator`) it\u0027s useful IMHO for the broker instances\u0027 `db_file` attribute to be the `object_file` that was passed into the constructor just like on a real!\n\nYou could make a similar argument for account \u0026 container kwargs; but they should default to None as well so that you can conditionally update `self.info`\n\n```\nif account is not None:\n    self.info[\u0027account\u0027] \u003d account\nif container is not None:\n    self.info[\u0027container\u0027] \u003d container\nself.path \u003d quote(info[\u0027account\u0027])\nif \u0027container\u0027 in info:\n    self.path +\u003d \u0027/\u0027 + quote(info[\u0027container\u0027])\n```","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"5d33b59db4d781fa7db0060473433c9232d91421","unresolved":false,"context_lines":[{"line_number":207,"context_line":"        self.db_file \u003d db_file or __file__"},{"line_number":208,"context_line":"        self.locked \u003d False"},{"line_number":209,"context_line":"        self.metadata \u003d {}"},{"line_number":210,"context_line":"        self.info \u003d {\u0027account\u0027: account, \u0027container\u0027: container}"},{"line_number":211,"context_line":"        self.path \u003d \u0027%s/%s\u0027 % (account, container)"},{"line_number":212,"context_line":"        return None"},{"line_number":213,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"7e352277_3abe01f4","line":210,"in_reply_to":"73630c8d_0911204e","updated":"2025-09-29 23:35:22.000000000","message":"Done","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"805f976a86ea467ad88c21f296b734692c19d1f9","unresolved":true,"context_lines":[{"line_number":288,"context_line":"class FakeAccountBroker(FakeBroker):"},{"line_number":289,"context_line":"    db_type \u003d \u0027account\u0027"},{"line_number":290,"context_line":"    db_contains_type \u003d \u0027container\u0027"},{"line_number":291,"context_line":"    info \u003d {\u0027account\u0027: TEST_ACCOUNT_NAME}"},{"line_number":292,"context_line":""},{"line_number":293,"context_line":""},{"line_number":294,"context_line":"class ConcreteReplicator(db_replicator.Replicator):"}],"source_content_type":"text/x-python","patch_set":22,"id":"2af3942f_19377d5c","line":291,"updated":"2025-08-25 21:57:38.000000000","message":"ah, I see - this instance variable is over-riding this.","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4627d5e2d929b3d11a7df8574ddace4541f3eba8","unresolved":true,"context_lines":[{"line_number":288,"context_line":"class FakeAccountBroker(FakeBroker):"},{"line_number":289,"context_line":"    db_type \u003d \u0027account\u0027"},{"line_number":290,"context_line":"    db_contains_type \u003d \u0027container\u0027"},{"line_number":291,"context_line":"    info \u003d {\u0027account\u0027: TEST_ACCOUNT_NAME}"},{"line_number":292,"context_line":""},{"line_number":293,"context_line":""},{"line_number":294,"context_line":"class ConcreteReplicator(db_replicator.Replicator):"}],"source_content_type":"text/x-python","patch_set":22,"id":"6e3d395d_94c0d304","line":291,"in_reply_to":"2af3942f_19377d5c","updated":"2025-09-26 18:02:47.000000000","message":"that behavior in `__init__` is bad tho right?  `FakeAccountBroker.__init__` is replacing self.info to include `container` and make the path `a/c`","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"5d33b59db4d781fa7db0060473433c9232d91421","unresolved":false,"context_lines":[{"line_number":288,"context_line":"class FakeAccountBroker(FakeBroker):"},{"line_number":289,"context_line":"    db_type \u003d \u0027account\u0027"},{"line_number":290,"context_line":"    db_contains_type \u003d \u0027container\u0027"},{"line_number":291,"context_line":"    info \u003d {\u0027account\u0027: TEST_ACCOUNT_NAME}"},{"line_number":292,"context_line":""},{"line_number":293,"context_line":""},{"line_number":294,"context_line":"class ConcreteReplicator(db_replicator.Replicator):"}],"source_content_type":"text/x-python","patch_set":22,"id":"ff4f777e_87b25d02","line":291,"in_reply_to":"6e3d395d_94c0d304","updated":"2025-09-29 23:35:22.000000000","message":"Acknowledged","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"805f976a86ea467ad88c21f296b734692c19d1f9","unresolved":true,"context_lines":[{"line_number":1204,"context_line":"        error_msgs \u003d replicator.logger.get_lines_for_level(\u0027error\u0027)"},{"line_number":1205,"context_line":"        expected \u003d (\u0027Found db that should be on \u0027"},{"line_number":1206,"context_line":"                    \u0027partition 0; will replicate out and remove,\u0027"},{"line_number":1207,"context_line":"                    \u0027 path: a%20c%20t/c%20o%20n, db: /path/to/file\u0027)"},{"line_number":1208,"context_line":"        self.assertEqual(error_msgs, [expected])"},{"line_number":1209,"context_line":""},{"line_number":1210,"context_line":"    def test_replicate_container_out_of_place(self):"}],"source_content_type":"text/x-python","patch_set":22,"id":"6b8b49f7_ac94e5c3","line":1207,"updated":"2025-08-25 21:57:38.000000000","message":"it *is* still interesting that the \"path\" `/a%20c%20t` in this log message \"changed\" to `a%20c%20t/c%20o%20n`","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"35b06d7d2a6b84cf209684fff77c7ebb3abec62c","unresolved":true,"context_lines":[{"line_number":1204,"context_line":"        error_msgs \u003d replicator.logger.get_lines_for_level(\u0027error\u0027)"},{"line_number":1205,"context_line":"        expected \u003d (\u0027Found db that should be on \u0027"},{"line_number":1206,"context_line":"                    \u0027partition 0; will replicate out and remove,\u0027"},{"line_number":1207,"context_line":"                    \u0027 path: a%20c%20t/c%20o%20n, db: /path/to/file\u0027)"},{"line_number":1208,"context_line":"        self.assertEqual(error_msgs, [expected])"},{"line_number":1209,"context_line":""},{"line_number":1210,"context_line":"    def test_replicate_container_out_of_place(self):"}],"source_content_type":"text/x-python","patch_set":22,"id":"aa902f83_d321cbfd","line":1207,"in_reply_to":"6b8b49f7_ac94e5c3","updated":"2025-09-29 16:01:56.000000000","message":"OH!  it\u0027s not the quoting - the path WAS just `a c t` - but now this test is logging `a c t/c o n` because of the test bug in the FakeAccountBroker!","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"5d33b59db4d781fa7db0060473433c9232d91421","unresolved":false,"context_lines":[{"line_number":1204,"context_line":"        error_msgs \u003d replicator.logger.get_lines_for_level(\u0027error\u0027)"},{"line_number":1205,"context_line":"        expected \u003d (\u0027Found db that should be on \u0027"},{"line_number":1206,"context_line":"                    \u0027partition 0; will replicate out and remove,\u0027"},{"line_number":1207,"context_line":"                    \u0027 path: a%20c%20t/c%20o%20n, db: /path/to/file\u0027)"},{"line_number":1208,"context_line":"        self.assertEqual(error_msgs, [expected])"},{"line_number":1209,"context_line":""},{"line_number":1210,"context_line":"    def test_replicate_container_out_of_place(self):"}],"source_content_type":"text/x-python","patch_set":22,"id":"d239e072_18bee8e6","line":1207,"in_reply_to":"aa902f83_d321cbfd","updated":"2025-09-29 23:35:22.000000000","message":"yes i have fixed it since!!!","commit_id":"27db680ae44290d8715f127777def65a76012fd2"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4627d5e2d929b3d11a7df8574ddace4541f3eba8","unresolved":true,"context_lines":[{"line_number":201,"context_line":"    stub_replication_info \u003d None"},{"line_number":202,"context_line":"    db_type \u003d \u0027container\u0027"},{"line_number":203,"context_line":"    db_contains_type \u003d \u0027object\u0027"},{"line_number":204,"context_line":"    info \u003d {\u0027account\u0027: TEST_ACCOUNT_NAME, \u0027container\u0027: TEST_CONTAINER_NAME}"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":207,"context_line":"        self.locked \u003d False"}],"source_content_type":"text/x-python","patch_set":35,"id":"b26c0005_6854cc4e","side":"PARENT","line":204,"updated":"2025-09-26 18:02:47.000000000","message":"you should probably add this back to align with FakeAccountBroker - or figure out a different way to control which fakes have which attributes in info?","commit_id":"07d230a8e8dbf760d35f023806cdda54eb0a399d"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"5d33b59db4d781fa7db0060473433c9232d91421","unresolved":false,"context_lines":[{"line_number":201,"context_line":"    stub_replication_info \u003d None"},{"line_number":202,"context_line":"    db_type \u003d \u0027container\u0027"},{"line_number":203,"context_line":"    db_contains_type \u003d \u0027object\u0027"},{"line_number":204,"context_line":"    info \u003d {\u0027account\u0027: TEST_ACCOUNT_NAME, \u0027container\u0027: TEST_CONTAINER_NAME}"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":207,"context_line":"        self.locked \u003d False"}],"source_content_type":"text/x-python","patch_set":35,"id":"e301ca61_d982eabe","side":"PARENT","line":204,"in_reply_to":"b26c0005_6854cc4e","updated":"2025-09-29 23:35:22.000000000","message":"yes I figured out the \"CORRECT\" way to annotate the info dicts for FakeBroker and FakeAccountBroker","commit_id":"07d230a8e8dbf760d35f023806cdda54eb0a399d"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4627d5e2d929b3d11a7df8574ddace4541f3eba8","unresolved":true,"context_lines":[{"line_number":800,"context_line":"    def test_replicate_object_quarantine(self):"},{"line_number":801,"context_line":"        replicator \u003d ConcreteReplicator({})"},{"line_number":802,"context_line":"        self._patch(patch.object, replicator.brokerclass, \u0027db_file\u0027,"},{"line_number":803,"context_line":"                    \u0027/a/b/c/d/e/hey\u0027)"},{"line_number":804,"context_line":"        self._patch(patch.object, replicator.brokerclass,"},{"line_number":805,"context_line":"                    \u0027get_repl_missing_table\u0027, True)"},{"line_number":806,"context_line":""}],"source_content_type":"text/x-python","patch_set":35,"id":"b6ca8954_82d114c2","side":"PARENT","line":803,"updated":"2025-09-26 18:02:47.000000000","message":"that was such a weird way to even do this?","commit_id":"07d230a8e8dbf760d35f023806cdda54eb0a399d"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"187adedb6cfd0da586b6778c6dc008077a240e81","unresolved":true,"context_lines":[{"line_number":800,"context_line":"    def test_replicate_object_quarantine(self):"},{"line_number":801,"context_line":"        replicator \u003d ConcreteReplicator({})"},{"line_number":802,"context_line":"        self._patch(patch.object, replicator.brokerclass, \u0027db_file\u0027,"},{"line_number":803,"context_line":"                    \u0027/a/b/c/d/e/hey\u0027)"},{"line_number":804,"context_line":"        self._patch(patch.object, replicator.brokerclass,"},{"line_number":805,"context_line":"                    \u0027get_repl_missing_table\u0027, True)"},{"line_number":806,"context_line":""}],"source_content_type":"text/x-python","patch_set":35,"id":"479db586_799e331e","side":"PARENT","line":803,"in_reply_to":"80790566_13462c13","updated":"2025-10-11 22:14:28.000000000","message":"TBD","commit_id":"07d230a8e8dbf760d35f023806cdda54eb0a399d"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"b0ebb2d7820a99e94c90b3c1143870109f08b64b","unresolved":true,"context_lines":[{"line_number":800,"context_line":"    def test_replicate_object_quarantine(self):"},{"line_number":801,"context_line":"        replicator \u003d ConcreteReplicator({})"},{"line_number":802,"context_line":"        self._patch(patch.object, replicator.brokerclass, \u0027db_file\u0027,"},{"line_number":803,"context_line":"                    \u0027/a/b/c/d/e/hey\u0027)"},{"line_number":804,"context_line":"        self._patch(patch.object, replicator.brokerclass,"},{"line_number":805,"context_line":"                    \u0027get_repl_missing_table\u0027, True)"},{"line_number":806,"context_line":""}],"source_content_type":"text/x-python","patch_set":35,"id":"80790566_13462c13","side":"PARENT","line":803,"in_reply_to":"b6ca8954_82d114c2","updated":"2025-10-02 19:59:13.000000000","message":"Should i refactor the test ?","commit_id":"07d230a8e8dbf760d35f023806cdda54eb0a399d"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4627d5e2d929b3d11a7df8574ddace4541f3eba8","unresolved":true,"context_lines":[{"line_number":303,"context_line":"    def setUp(self):"},{"line_number":304,"context_line":"        self.logger \u003d debug_logger(\u0027broker-logger-test\u0027)"},{"line_number":305,"context_line":"        self.broker_logger \u003d BrokerAnnotatedLogger(conf\u003d{},"},{"line_number":306,"context_line":"                                                   logger\u003dself.logger)"},{"line_number":307,"context_line":"        self.tempdir \u003d mkdtemp()"},{"line_number":308,"context_line":""},{"line_number":309,"context_line":"    def tearDown(self):"}],"source_content_type":"text/x-python","patch_set":35,"id":"5a235195_350e4531","line":306,"updated":"2025-09-26 18:02:47.000000000","message":"why can\u0027t the actual daemons/rpc\u0027s use this \"has-a\" `self.db_log` pattern?","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"5d33b59db4d781fa7db0060473433c9232d91421","unresolved":true,"context_lines":[{"line_number":303,"context_line":"    def setUp(self):"},{"line_number":304,"context_line":"        self.logger \u003d debug_logger(\u0027broker-logger-test\u0027)"},{"line_number":305,"context_line":"        self.broker_logger \u003d BrokerAnnotatedLogger(conf\u003d{},"},{"line_number":306,"context_line":"                                                   logger\u003dself.logger)"},{"line_number":307,"context_line":"        self.tempdir \u003d mkdtemp()"},{"line_number":308,"context_line":""},{"line_number":309,"context_line":"    def tearDown(self):"}],"source_content_type":"text/x-python","patch_set":35,"id":"5a842ff9_4bbf994b","line":306,"in_reply_to":"5a235195_350e4531","updated":"2025-09-29 23:35:22.000000000","message":"I do intend on squashing in https://review.opendev.org/c/openstack/swift/+/959609, subsequently i\u0027ll refactor self.broker_logger to self.db_log like you suggested","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"1b8dfd167b01c5148c1ded37fb2d62590e7cd581","unresolved":false,"context_lines":[{"line_number":303,"context_line":"    def setUp(self):"},{"line_number":304,"context_line":"        self.logger \u003d debug_logger(\u0027broker-logger-test\u0027)"},{"line_number":305,"context_line":"        self.broker_logger \u003d BrokerAnnotatedLogger(conf\u003d{},"},{"line_number":306,"context_line":"                                                   logger\u003dself.logger)"},{"line_number":307,"context_line":"        self.tempdir \u003d mkdtemp()"},{"line_number":308,"context_line":""},{"line_number":309,"context_line":"    def tearDown(self):"}],"source_content_type":"text/x-python","patch_set":35,"id":"74db65e9_efb53d85","line":306,"in_reply_to":"5a842ff9_4bbf994b","updated":"2025-10-02 20:01:09.000000000","message":"Done","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4627d5e2d929b3d11a7df8574ddace4541f3eba8","unresolved":true,"context_lines":[{"line_number":369,"context_line":"            self.broker_logger.error(broker, \u0027test\u0027)"},{"line_number":370,"context_line":"            self.broker_logger.exception(broker, \u0027test %s\u0027, \u0027x\u0027)"},{"line_number":371,"context_line":""},{"line_number":372,"context_line":"        self.assertFalse(self.logger.all_log_lines())"},{"line_number":373,"context_line":""},{"line_number":374,"context_line":"    def test_log_broker_exception_while_logging(self):"},{"line_number":375,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":35,"id":"a6621eb2_4a47644e","line":372,"updated":"2025-09-26 18:02:47.000000000","message":"I think the really strong behavioral assertion this is trying to imply is that the path and db_file attributes weren\u0027t accessed - like you might have to replace them with properties that least track access?\n\n```\nclass PropertyTrackingBroker(FakeBroker):\n    calls \u003d 0\n    \n    @property\n    def db_file(self):\n        self.calls +\u003d 1\n```","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"5d33b59db4d781fa7db0060473433c9232d91421","unresolved":false,"context_lines":[{"line_number":369,"context_line":"            self.broker_logger.error(broker, \u0027test\u0027)"},{"line_number":370,"context_line":"            self.broker_logger.exception(broker, \u0027test %s\u0027, \u0027x\u0027)"},{"line_number":371,"context_line":""},{"line_number":372,"context_line":"        self.assertFalse(self.logger.all_log_lines())"},{"line_number":373,"context_line":""},{"line_number":374,"context_line":"    def test_log_broker_exception_while_logging(self):"},{"line_number":375,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":35,"id":"559b969c_3aa48d4a","line":372,"in_reply_to":"a6621eb2_4a47644e","updated":"2025-09-29 23:35:22.000000000","message":"Done","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"5d33b59db4d781fa7db0060473433c9232d91421","unresolved":false,"context_lines":[{"line_number":369,"context_line":"            self.broker_logger.error(broker, \u0027test\u0027)"},{"line_number":370,"context_line":"            self.broker_logger.exception(broker, \u0027test %s\u0027, \u0027x\u0027)"},{"line_number":371,"context_line":""},{"line_number":372,"context_line":"        self.assertFalse(self.logger.all_log_lines())"},{"line_number":373,"context_line":""},{"line_number":374,"context_line":"    def test_log_broker_exception_while_logging(self):"},{"line_number":375,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":35,"id":"8a371ea7_d2e6c221","line":372,"in_reply_to":"a6621eb2_4a47644e","updated":"2025-09-29 23:35:22.000000000","message":"Done","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4627d5e2d929b3d11a7df8574ddace4541f3eba8","unresolved":true,"context_lines":[{"line_number":393,"context_line":"            def path(self):"},{"line_number":394,"context_line":"                if self.raise_path:"},{"line_number":395,"context_line":"                    raise Exception(\u0027boom path\u0027)"},{"line_number":396,"context_line":"                return self._path"},{"line_number":397,"context_line":""},{"line_number":398,"context_line":"        broker \u003d WeirdBroker(\u0027/tmp/abc.db\u0027, \u0027a/c\u0027)"},{"line_number":399,"context_line":""}],"source_content_type":"text/x-python","patch_set":35,"id":"43b642ef_f2b456c0","line":396,"updated":"2025-09-26 18:02:47.000000000","message":"oh perfect you already have this property tracking pattern!","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"69538febbf5e32cff6f528440ff0fd543b9a85f1","unresolved":false,"context_lines":[{"line_number":393,"context_line":"            def path(self):"},{"line_number":394,"context_line":"                if self.raise_path:"},{"line_number":395,"context_line":"                    raise Exception(\u0027boom path\u0027)"},{"line_number":396,"context_line":"                return self._path"},{"line_number":397,"context_line":""},{"line_number":398,"context_line":"        broker \u003d WeirdBroker(\u0027/tmp/abc.db\u0027, \u0027a/c\u0027)"},{"line_number":399,"context_line":""}],"source_content_type":"text/x-python","patch_set":35,"id":"2598e0f5_38c01057","line":396,"in_reply_to":"43b642ef_f2b456c0","updated":"2025-09-29 01:21:41.000000000","message":"Acknowledged","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4627d5e2d929b3d11a7df8574ddace4541f3eba8","unresolved":true,"context_lines":[{"line_number":400,"context_line":"        # Case 1: path access fails -\u003e path: \u0027\u0027 retained, db present"},{"line_number":401,"context_line":"        broker.raise_path \u003d True"},{"line_number":402,"context_line":"        self.broker_logger.info(broker, \u0027bonjour %s %s\u0027, \u0027mes\u0027, \u0027amis\u0027)"},{"line_number":403,"context_line":"        # reset for next case"},{"line_number":404,"context_line":"        broker.raise_path \u003d False"},{"line_number":405,"context_line":""},{"line_number":406,"context_line":"        # Case 2: db_file access fails -\u003e path present, db: \u0027\u0027 retained"}],"source_content_type":"text/x-python","patch_set":35,"id":"f14ee84a_c7ed715c","line":403,"updated":"2025-09-26 18:02:47.000000000","message":"just... create a new instance.","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"5d33b59db4d781fa7db0060473433c9232d91421","unresolved":false,"context_lines":[{"line_number":400,"context_line":"        # Case 1: path access fails -\u003e path: \u0027\u0027 retained, db present"},{"line_number":401,"context_line":"        broker.raise_path \u003d True"},{"line_number":402,"context_line":"        self.broker_logger.info(broker, \u0027bonjour %s %s\u0027, \u0027mes\u0027, \u0027amis\u0027)"},{"line_number":403,"context_line":"        # reset for next case"},{"line_number":404,"context_line":"        broker.raise_path \u003d False"},{"line_number":405,"context_line":""},{"line_number":406,"context_line":"        # Case 2: db_file access fails -\u003e path present, db: \u0027\u0027 retained"}],"source_content_type":"text/x-python","patch_set":35,"id":"666918ca_6c669789","line":403,"in_reply_to":"f14ee84a_c7ed715c","updated":"2025-09-29 23:35:22.000000000","message":"Done","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"5d33b59db4d781fa7db0060473433c9232d91421","unresolved":false,"context_lines":[{"line_number":400,"context_line":"        # Case 1: path access fails -\u003e path: \u0027\u0027 retained, db present"},{"line_number":401,"context_line":"        broker.raise_path \u003d True"},{"line_number":402,"context_line":"        self.broker_logger.info(broker, \u0027bonjour %s %s\u0027, \u0027mes\u0027, \u0027amis\u0027)"},{"line_number":403,"context_line":"        # reset for next case"},{"line_number":404,"context_line":"        broker.raise_path \u003d False"},{"line_number":405,"context_line":""},{"line_number":406,"context_line":"        # Case 2: db_file access fails -\u003e path present, db: \u0027\u0027 retained"}],"source_content_type":"text/x-python","patch_set":35,"id":"ab90ed3f_7d558aac","line":403,"in_reply_to":"f14ee84a_c7ed715c","updated":"2025-09-29 23:35:22.000000000","message":"Done","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4627d5e2d929b3d11a7df8574ddace4541f3eba8","unresolved":true,"context_lines":[{"line_number":552,"context_line":"        def _rsync_file_stub(broker_arg, remote_spec, *args, **kwargs):"},{"line_number":553,"context_line":"            self.assertIsInstance(broker_arg, FakeBroker)"},{"line_number":554,"context_line":"            self.assertTrue(os.path.isabs(broker_arg.db_file))"},{"line_number":555,"context_line":"            self.assertFalse(os.path.isabs(broker_arg.path))"},{"line_number":556,"context_line":"            return True"},{"line_number":557,"context_line":"        replicator._rsync_file \u003d _rsync_file_stub"},{"line_number":558,"context_line":"        replicator._rsync_db(FakeBroker(), fake_device, ReplHttp(), \u0027abcd\u0027)"}],"source_content_type":"text/x-python","patch_set":35,"id":"bfbf60b2_a660acc2","line":555,"updated":"2025-09-26 18:02:47.000000000","message":"don\u0027t do asserts in your fakes - your fakes should capture information and the asserts should happen after the crank turn (not during)\n\nthe reason is b/c if your fake stops getting called during your crank turn you could introduce a bug and your asserts would never catch it.","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"51befc999641047129f8a7691c4bafe1c4d24b3f","unresolved":false,"context_lines":[{"line_number":552,"context_line":"        def _rsync_file_stub(broker_arg, remote_spec, *args, **kwargs):"},{"line_number":553,"context_line":"            self.assertIsInstance(broker_arg, FakeBroker)"},{"line_number":554,"context_line":"            self.assertTrue(os.path.isabs(broker_arg.db_file))"},{"line_number":555,"context_line":"            self.assertFalse(os.path.isabs(broker_arg.path))"},{"line_number":556,"context_line":"            return True"},{"line_number":557,"context_line":"        replicator._rsync_file \u003d _rsync_file_stub"},{"line_number":558,"context_line":"        replicator._rsync_db(FakeBroker(), fake_device, ReplHttp(), \u0027abcd\u0027)"}],"source_content_type":"text/x-python","patch_set":35,"id":"64836c15_096e6598","line":555,"in_reply_to":"5374998d_96bdb409","updated":"2025-10-03 18:21:35.000000000","message":"Done","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"33f050f715f9726aa0adf07eeb6e830746a05bfc","unresolved":true,"context_lines":[{"line_number":552,"context_line":"        def _rsync_file_stub(broker_arg, remote_spec, *args, **kwargs):"},{"line_number":553,"context_line":"            self.assertIsInstance(broker_arg, FakeBroker)"},{"line_number":554,"context_line":"            self.assertTrue(os.path.isabs(broker_arg.db_file))"},{"line_number":555,"context_line":"            self.assertFalse(os.path.isabs(broker_arg.path))"},{"line_number":556,"context_line":"            return True"},{"line_number":557,"context_line":"        replicator._rsync_file \u003d _rsync_file_stub"},{"line_number":558,"context_line":"        replicator._rsync_db(FakeBroker(), fake_device, ReplHttp(), \u0027abcd\u0027)"}],"source_content_type":"text/x-python","patch_set":35,"id":"5374998d_96bdb409","line":555,"in_reply_to":"bfbf60b2_a660acc2","updated":"2025-09-29 23:37:30.000000000","message":"Makes sense. Fixed the test","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4627d5e2d929b3d11a7df8574ddace4541f3eba8","unresolved":true,"context_lines":[{"line_number":2352,"context_line":""},{"line_number":2353,"context_line":"    def _install_fake_rsync_file(self, daemon, captured_calls\u003dNone):"},{"line_number":2354,"context_line":"        def _rsync_file(src, remote_file, **kwargs):"},{"line_number":2355,"context_line":"            src_path \u003d getattr(src, \u0027db_file\u0027, src)"},{"line_number":2356,"context_line":"            if captured_calls is not None:"},{"line_number":2357,"context_line":"                captured_calls.append((src_path, remote_file, kwargs))"},{"line_number":2358,"context_line":"            remote_server, remote_path \u003d remote_file.split(\u0027/\u0027, 1)"}],"source_content_type":"text/x-python","patch_set":35,"id":"c942b345_f73f129c","line":2355,"updated":"2025-09-26 18:02:47.000000000","message":"sketch AF\n\n```\ndiff --git a/test/unit/common/test_db_replicator.py b/test/unit/common/test_db_replicator.py\nindex fef08c0ea..b06aad9e1 100644\n--- a/test/unit/common/test_db_replicator.py\n+++ b/test/unit/common/test_db_replicator.py\n@@ -2352,7 +2352,7 @@ class TestReplicatorSync(unittest.TestCase):\n \n     def _install_fake_rsync_file(self, daemon, captured_calls\u003dNone):\n         def _rsync_file(src, remote_file, **kwargs):\n-            src_path \u003d getattr(src, \u0027db_file\u0027, src)\n+            src_path \u003d src.db_file\n             if captured_calls is not None:\n                 captured_calls.append((src_path, remote_file, kwargs))\n             remote_server, remote_path \u003d remote_file.split(\u0027/\u0027, 1)\n```\n\n^ this passes OMM - just change the arg from `db_file` \u003d\u003e `broker` and have the fake extract `db_file \u003d broker.db_file` (just like the real!)\n\nPlease read every line of your diff as part of your self review process.\n\nIdeally, when you read THIS hunk you\u0027ll hear the voice of an experienced senior dev in your head tell you: \"when I read this it sounds like we don\u0027t know what we\u0027re testing\"\n\nIf the diff said instead, quite bluntly: \"we used to pass in broker_file, but the real changed to pass in broker so the fake must *also* expect the broker object and it WILL have a db_file attribute just like a real!\"\n\n^ THAT would make me MORE confident in the change (as opposed to less)","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"5d33b59db4d781fa7db0060473433c9232d91421","unresolved":false,"context_lines":[{"line_number":2352,"context_line":""},{"line_number":2353,"context_line":"    def _install_fake_rsync_file(self, daemon, captured_calls\u003dNone):"},{"line_number":2354,"context_line":"        def _rsync_file(src, remote_file, **kwargs):"},{"line_number":2355,"context_line":"            src_path \u003d getattr(src, \u0027db_file\u0027, src)"},{"line_number":2356,"context_line":"            if captured_calls is not None:"},{"line_number":2357,"context_line":"                captured_calls.append((src_path, remote_file, kwargs))"},{"line_number":2358,"context_line":"            remote_server, remote_path \u003d remote_file.split(\u0027/\u0027, 1)"}],"source_content_type":"text/x-python","patch_set":35,"id":"9a28880c_88432568","line":2355,"in_reply_to":"c942b345_f73f129c","updated":"2025-09-29 23:35:22.000000000","message":"Acknowledged","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"72dc0946f74d70b1f7af9d0e9c13a5f809329ac5","unresolved":true,"context_lines":[{"line_number":419,"context_line":""},{"line_number":420,"context_line":"        # Case 2: db_file access fails -\u003e path present, db: \u0027\u0027 retained"},{"line_number":421,"context_line":"        broker_db_boom \u003d WeirdBroker(\u0027/tmp/abc.db\u0027, \u0027a/c\u0027, raise_db\u003dTrue)"},{"line_number":422,"context_line":"        self.broker_logger.info(broker_db_boom, \u0027bonjour %s %s\u0027, \u0027mes\u0027, \u0027amis\u0027)"},{"line_number":423,"context_line":""},{"line_number":424,"context_line":"        self.assertEqual("},{"line_number":425,"context_line":"            ["}],"source_content_type":"text/x-python","patch_set":39,"id":"bd12f63e_4a387969","line":422,"updated":"2025-09-30 06:40:40.000000000","message":"And case 3, raise_db\u003dTrue and raise_path\u003dTrue?","commit_id":"777cc77329b3e38f3632b7d4e6172875c77973b1"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"b0ebb2d7820a99e94c90b3c1143870109f08b64b","unresolved":false,"context_lines":[{"line_number":419,"context_line":""},{"line_number":420,"context_line":"        # Case 2: db_file access fails -\u003e path present, db: \u0027\u0027 retained"},{"line_number":421,"context_line":"        broker_db_boom \u003d WeirdBroker(\u0027/tmp/abc.db\u0027, \u0027a/c\u0027, raise_db\u003dTrue)"},{"line_number":422,"context_line":"        self.broker_logger.info(broker_db_boom, \u0027bonjour %s %s\u0027, \u0027mes\u0027, \u0027amis\u0027)"},{"line_number":423,"context_line":""},{"line_number":424,"context_line":"        self.assertEqual("},{"line_number":425,"context_line":"            ["}],"source_content_type":"text/x-python","patch_set":39,"id":"7d2a9f6f_a208597e","line":422,"in_reply_to":"bd12f63e_4a387969","updated":"2025-10-02 19:59:13.000000000","message":"Done","commit_id":"777cc77329b3e38f3632b7d4e6172875c77973b1"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"72dc0946f74d70b1f7af9d0e9c13a5f809329ac5","unresolved":true,"context_lines":[{"line_number":580,"context_line":"        self.assertEqual(1, len(calls), \"single rsync call\")"},{"line_number":581,"context_line":"        broker_arg \u003d calls[0][\u0027broker\u0027]"},{"line_number":582,"context_line":"        self.assertTrue(os.path.isabs(broker_arg.db_file))"},{"line_number":583,"context_line":"        self.assertFalse(os.path.isabs(broker_arg.path))"},{"line_number":584,"context_line":""},{"line_number":585,"context_line":"    def test_rsync_db_rsync_file_call(self):"},{"line_number":586,"context_line":"        fake_device \u003d {\u0027ip\u0027: \u0027127.0.0.1\u0027, \u0027port\u0027: \u00270\u0027,"}],"source_content_type":"text/x-python","patch_set":39,"id":"8cb028be_47957c58","line":583,"updated":"2025-09-30 06:40:40.000000000","message":"Nice on Ash! making this test better! \n\nWe normally use mock or something in other areas of testing, maybe some of this pre-dates that. anyway yay for monkey-patching! The replicator object is only called once and cleaned up so this works!","commit_id":"777cc77329b3e38f3632b7d4e6172875c77973b1"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"b0ebb2d7820a99e94c90b3c1143870109f08b64b","unresolved":false,"context_lines":[{"line_number":580,"context_line":"        self.assertEqual(1, len(calls), \"single rsync call\")"},{"line_number":581,"context_line":"        broker_arg \u003d calls[0][\u0027broker\u0027]"},{"line_number":582,"context_line":"        self.assertTrue(os.path.isabs(broker_arg.db_file))"},{"line_number":583,"context_line":"        self.assertFalse(os.path.isabs(broker_arg.path))"},{"line_number":584,"context_line":""},{"line_number":585,"context_line":"    def test_rsync_db_rsync_file_call(self):"},{"line_number":586,"context_line":"        fake_device \u003d {\u0027ip\u0027: \u0027127.0.0.1\u0027, \u0027port\u0027: \u00270\u0027,"}],"source_content_type":"text/x-python","patch_set":39,"id":"faf59dc2_33338461","line":583,"in_reply_to":"8cb028be_47957c58","updated":"2025-10-02 19:59:13.000000000","message":"Acknowledged","commit_id":"777cc77329b3e38f3632b7d4e6172875c77973b1"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"51befc999641047129f8a7691c4bafe1c4d24b3f","unresolved":true,"context_lines":[{"line_number":218,"context_line":"            if \u0027container\u0027 in self.info:"},{"line_number":219,"context_line":"                self.path +\u003d \u0027/\u0027 + self.info[\u0027container\u0027]"},{"line_number":220,"context_line":"        else:"},{"line_number":221,"context_line":"            self.path \u003d \u0027\u0027"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"    @contextmanager"},{"line_number":224,"context_line":"    def lock(self):"}],"source_content_type":"text/x-python","patch_set":42,"id":"2441b09f_ce575dff","line":221,"updated":"2025-10-03 18:21:35.000000000","message":"as best I can tell this branch is never used - it should be removed\n\nwhile a FakeAccountBroker will not have a container, not having an account in a FakeBroker probably indicates a test bug.","commit_id":"cbe3c88083dfe0d96e7ae33bacbdc6aca811f8f8"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"9b0d69985dc5c3c7d690ef07053d39653318d961","unresolved":false,"context_lines":[{"line_number":218,"context_line":"            if \u0027container\u0027 in self.info:"},{"line_number":219,"context_line":"                self.path +\u003d \u0027/\u0027 + self.info[\u0027container\u0027]"},{"line_number":220,"context_line":"        else:"},{"line_number":221,"context_line":"            self.path \u003d \u0027\u0027"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"    @contextmanager"},{"line_number":224,"context_line":"    def lock(self):"}],"source_content_type":"text/x-python","patch_set":42,"id":"12aa9dba_d5149659","line":221,"in_reply_to":"2441b09f_ce575dff","updated":"2025-10-08 15:43:05.000000000","message":"Acknowledged","commit_id":"cbe3c88083dfe0d96e7ae33bacbdc6aca811f8f8"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"9b0d69985dc5c3c7d690ef07053d39653318d961","unresolved":false,"context_lines":[{"line_number":218,"context_line":"            if \u0027container\u0027 in self.info:"},{"line_number":219,"context_line":"                self.path +\u003d \u0027/\u0027 + self.info[\u0027container\u0027]"},{"line_number":220,"context_line":"        else:"},{"line_number":221,"context_line":"            self.path \u003d \u0027\u0027"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"    @contextmanager"},{"line_number":224,"context_line":"    def lock(self):"}],"source_content_type":"text/x-python","patch_set":42,"id":"5c3d1feb_039c3e1a","line":221,"in_reply_to":"2441b09f_ce575dff","updated":"2025-10-08 15:43:05.000000000","message":"True, the else condition has been removed!","commit_id":"cbe3c88083dfe0d96e7ae33bacbdc6aca811f8f8"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"51befc999641047129f8a7691c4bafe1c4d24b3f","unresolved":true,"context_lines":[{"line_number":299,"context_line":"    db_contains_type \u003d \u0027container\u0027"},{"line_number":300,"context_line":""},{"line_number":301,"context_line":"    def __init__(self, db_file\u003dNone, account\u003dNone, **kwargs):"},{"line_number":302,"context_line":"        # Account-only shape: no container by default"},{"line_number":303,"context_line":"        super(FakeAccountBroker, self).__init__("},{"line_number":304,"context_line":"            db_file\u003ddb_file, account\u003dTEST_ACCOUNT_NAME, container\u003dNone,"},{"line_number":305,"context_line":"            **kwargs"}],"source_content_type":"text/x-python","patch_set":42,"id":"b7203507_565d2e30","line":302,"updated":"2025-10-03 18:21:35.000000000","message":"no container \"by default\" - or no container \"allowed\"???\n\n```\n\u003e\u003e\u003e from test.unit.common.test_db_replicator import FakeAccountBroker\n\u003e\u003e\u003e FakeAccountBroker(container\u003d\u0027foo\u0027)\nTraceback (most recent call last):\n  File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\n  File \"/vagrant/swift/test/unit/common/test_db_replicator.py\", line 303, in __init__\n    super(FakeAccountBroker, self).__init__(\nTypeError: test.unit.common.test_db_replicator.FakeBroker.__init__() got multiple values for keyword argument \u0027container\u0027\n```","commit_id":"cbe3c88083dfe0d96e7ae33bacbdc6aca811f8f8"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"9b0d69985dc5c3c7d690ef07053d39653318d961","unresolved":false,"context_lines":[{"line_number":299,"context_line":"    db_contains_type \u003d \u0027container\u0027"},{"line_number":300,"context_line":""},{"line_number":301,"context_line":"    def __init__(self, db_file\u003dNone, account\u003dNone, **kwargs):"},{"line_number":302,"context_line":"        # Account-only shape: no container by default"},{"line_number":303,"context_line":"        super(FakeAccountBroker, self).__init__("},{"line_number":304,"context_line":"            db_file\u003ddb_file, account\u003dTEST_ACCOUNT_NAME, container\u003dNone,"},{"line_number":305,"context_line":"            **kwargs"}],"source_content_type":"text/x-python","patch_set":42,"id":"85babe67_fdd69e81","line":302,"in_reply_to":"b7203507_565d2e30","updated":"2025-10-08 15:43:05.000000000","message":"Fixed since my last changes:\n```\n\u003e\u003e\u003e from test.unit.common.test_db_replicator import FakeAccountBroker\n\u003e\u003e\u003e FakeAccountBroker(container\u003d\u0027foo\u0027)\nTraceback (most recent call last):\n  File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\n  File \"/vagrant/swift/test/unit/common/test_db_replicator.py\", line 305, in __init__\n    raise TypeError(\"FakeAccountBroker does not support a container\")\nTypeError: FakeAccountBroker: no container allowed\n```\n\nWe will go by having \u0027no container allowed\u0027","commit_id":"cbe3c88083dfe0d96e7ae33bacbdc6aca811f8f8"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"51befc999641047129f8a7691c4bafe1c4d24b3f","unresolved":true,"context_lines":[{"line_number":301,"context_line":"    def __init__(self, db_file\u003dNone, account\u003dNone, **kwargs):"},{"line_number":302,"context_line":"        # Account-only shape: no container by default"},{"line_number":303,"context_line":"        super(FakeAccountBroker, self).__init__("},{"line_number":304,"context_line":"            db_file\u003ddb_file, account\u003dTEST_ACCOUNT_NAME, container\u003dNone,"},{"line_number":305,"context_line":"            **kwargs"},{"line_number":306,"context_line":"        )"},{"line_number":307,"context_line":""}],"source_content_type":"text/x-python","patch_set":42,"id":"a98d2516_d9653bd4","line":304,"updated":"2025-10-03 18:21:35.000000000","message":"hrm... this isn\u0027t the behavior I expected:\n\n```\n\u003e\u003e\u003e FakeAccountBroker(account\u003d\u0027AUTH_test\u0027).path\n\u0027a c t\u0027\n```\n\ndid you intend to deal with the `if account is not None` case?  Or just pass it through transparently with a default - sort of like `db_file`","commit_id":"cbe3c88083dfe0d96e7ae33bacbdc6aca811f8f8"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"9b0d69985dc5c3c7d690ef07053d39653318d961","unresolved":false,"context_lines":[{"line_number":301,"context_line":"    def __init__(self, db_file\u003dNone, account\u003dNone, **kwargs):"},{"line_number":302,"context_line":"        # Account-only shape: no container by default"},{"line_number":303,"context_line":"        super(FakeAccountBroker, self).__init__("},{"line_number":304,"context_line":"            db_file\u003ddb_file, account\u003dTEST_ACCOUNT_NAME, container\u003dNone,"},{"line_number":305,"context_line":"            **kwargs"},{"line_number":306,"context_line":"        )"},{"line_number":307,"context_line":""}],"source_content_type":"text/x-python","patch_set":42,"id":"69be8f2f_9e3f2e85","line":304,"in_reply_to":"a98d2516_d9653bd4","updated":"2025-10-08 15:43:05.000000000","message":"Fixed as well:\n```\n\u003e\u003e\u003e from test.unit.common.test_db_replicator import FakeAccountBroker\n\u003e\u003e\u003e FakeAccountBroker(account\u003d\u0027AUTH_test\u0027).path\n\u0027AUTH_test\u0027\n\u003e\u003e\u003e FakeAccountBroker(container\u003d\u0027foo\u0027)\nTraceback (most recent call last):\n  File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\n  File \"/vagrant/swift/test/unit/common/test_db_replicator.py\", line 303, in __init__\n    raise TypeError(\"FakeAccountBroker: no container allowed\")\nTypeError: FakeAccountBroker: no container allowed\n```","commit_id":"cbe3c88083dfe0d96e7ae33bacbdc6aca811f8f8"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"51befc999641047129f8a7691c4bafe1c4d24b3f","unresolved":true,"context_lines":[{"line_number":437,"context_line":"            ["},{"line_number":438,"context_line":"                \u0027bonjour mes amis, path: , db: /tmp/abc.db\u0027,"},{"line_number":439,"context_line":"                \u0027bonjour mes amis, path: a/c, db: \u0027,"},{"line_number":440,"context_line":"                \u0027bonjour mes amis, path: , db: \u0027"},{"line_number":441,"context_line":"            ],"},{"line_number":442,"context_line":"            info_lines"},{"line_number":443,"context_line":"        )"}],"source_content_type":"text/x-python","patch_set":42,"id":"4f21d02a_654bb9cd","line":440,"updated":"2025-10-03 18:21:35.000000000","message":"probably more clear with a `self.logger.clear()` between asserts\n\nOr you could even create a new `debug_logger`!?  Or make each crank turn use it\u0027s own test so it\u0027s gets setup to create a fresh debug_logger for each turn of the crank and assertion.  Or you could create a list of brokers and use a loop!","commit_id":"cbe3c88083dfe0d96e7ae33bacbdc6aca811f8f8"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"9b0d69985dc5c3c7d690ef07053d39653318d961","unresolved":false,"context_lines":[{"line_number":437,"context_line":"            ["},{"line_number":438,"context_line":"                \u0027bonjour mes amis, path: , db: /tmp/abc.db\u0027,"},{"line_number":439,"context_line":"                \u0027bonjour mes amis, path: a/c, db: \u0027,"},{"line_number":440,"context_line":"                \u0027bonjour mes amis, path: , db: \u0027"},{"line_number":441,"context_line":"            ],"},{"line_number":442,"context_line":"            info_lines"},{"line_number":443,"context_line":"        )"}],"source_content_type":"text/x-python","patch_set":42,"id":"9506fb42_f6d96c6f","line":440,"in_reply_to":"4f21d02a_654bb9cd","updated":"2025-10-08 15:43:05.000000000","message":"Done","commit_id":"cbe3c88083dfe0d96e7ae33bacbdc6aca811f8f8"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"4632feca85c2ad3e542881be2ef9c24a2f2a2424","unresolved":true,"context_lines":[{"line_number":1477,"context_line":"            self.assertEqual(\u0027204 No Content\u0027, response.status)"},{"line_number":1478,"context_line":"            self.assertEqual(204, response.status_int)"},{"line_number":1479,"context_line":""},{"line_number":1480,"context_line":"    def test_delete_db_exception_log_includes_parent_directory(self):"},{"line_number":1481,"context_line":"        replicator \u003d ConcreteReplicator({}, logger\u003dself.logger)"},{"line_number":1482,"context_line":"        replicator._zero_stats()"},{"line_number":1483,"context_line":"        db_replicator.lock_parent_directory \u003d lock_parent_directory"}],"source_content_type":"text/x-python","patch_set":45,"id":"db909ec8_c4825c15","line":1480,"updated":"2025-10-13 12:23:50.000000000","message":"thanks for adding the test !","commit_id":"41bf72a5cc5dbda1192732930c78a1fd91282f98"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"2709dd5aadbc71db1d03dd166e6b2a886ad17690","unresolved":false,"context_lines":[{"line_number":1477,"context_line":"            self.assertEqual(\u0027204 No Content\u0027, response.status)"},{"line_number":1478,"context_line":"            self.assertEqual(204, response.status_int)"},{"line_number":1479,"context_line":""},{"line_number":1480,"context_line":"    def test_delete_db_exception_log_includes_parent_directory(self):"},{"line_number":1481,"context_line":"        replicator \u003d ConcreteReplicator({}, logger\u003dself.logger)"},{"line_number":1482,"context_line":"        replicator._zero_stats()"},{"line_number":1483,"context_line":"        db_replicator.lock_parent_directory \u003d lock_parent_directory"}],"source_content_type":"text/x-python","patch_set":45,"id":"4e7c684c_40d3fed2","line":1480,"in_reply_to":"db909ec8_c4825c15","updated":"2025-10-13 19:42:04.000000000","message":"Acknowledged","commit_id":"41bf72a5cc5dbda1192732930c78a1fd91282f98"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"4632feca85c2ad3e542881be2ef9c24a2f2a2424","unresolved":true,"context_lines":[{"line_number":1482,"context_line":"        replicator._zero_stats()"},{"line_number":1483,"context_line":"        db_replicator.lock_parent_directory \u003d lock_parent_directory"},{"line_number":1484,"context_line":""},{"line_number":1485,"context_line":"        temp_dir \u003d mkdtemp()"},{"line_number":1486,"context_line":"        try:"},{"line_number":1487,"context_line":"            temp_part_dir \u003d os.path.join(temp_dir, \u0027140\u0027)"},{"line_number":1488,"context_line":"            os.mkdir(temp_part_dir)"}],"source_content_type":"text/x-python","patch_set":45,"id":"bac1ef33_bdc07b4d","line":1485,"updated":"2025-10-13 12:23:50.000000000","message":"this is the 3rd mkdtemp/try/except/rmtree in this class - time to add ``self.temp_dir \u003d mkdtemp()`` in the setUp and ``rmtree`` in the tearDown","commit_id":"41bf72a5cc5dbda1192732930c78a1fd91282f98"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"4632feca85c2ad3e542881be2ef9c24a2f2a2424","unresolved":true,"context_lines":[{"line_number":1505,"context_line":"                return os.rmdir(path)"},{"line_number":1506,"context_line":""},{"line_number":1507,"context_line":"            with mock.patch(\u0027swift.common.db_replicator.os\u0027,"},{"line_number":1508,"context_line":"                            new\u003dmock.MagicMock(wraps\u003dos)) as mock_os:"},{"line_number":1509,"context_line":"                mock_os.rmdir.side_effect \u003d rmdir_side_effect"},{"line_number":1510,"context_line":"                result \u003d replicator.delete_db(broker)"},{"line_number":1511,"context_line":"            self.assertFalse(result)"}],"source_content_type":"text/x-python","patch_set":45,"id":"d3d7510e_f9b7bd8f","line":1508,"updated":"2025-10-13 12:23:50.000000000","message":"ok, so wrapping the module rather than patching the function avoids recursion at line 1505\n\nI don\u0027t think the ``new\u003dmock.MagicMock`` is necessary:\n\n```\nwith mock.patch(\u0027swift.common.db_replicator.os\u0027,wraps\u003dos) as mock_os\n```","commit_id":"41bf72a5cc5dbda1192732930c78a1fd91282f98"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"4632feca85c2ad3e542881be2ef9c24a2f2a2424","unresolved":true,"context_lines":[{"line_number":1511,"context_line":"            self.assertFalse(result)"},{"line_number":1512,"context_line":""},{"line_number":1513,"context_line":"            lines \u003d [line.rstrip(\u0027: \u0027)"},{"line_number":1514,"context_line":"                     for line in self.logger.get_lines_for_level(\u0027error\u0027)]"},{"line_number":1515,"context_line":"            self.assertEqual("},{"line_number":1516,"context_line":"                [\u0027ERROR while trying to clean up %s, path: %s, db: %s\u0027 %"},{"line_number":1517,"context_line":"                 (parent_dir, db_replicator.quote(broker.path),"}],"source_content_type":"text/x-python","patch_set":45,"id":"98040e30_487dc692","line":1514,"updated":"2025-10-13 12:23:50.000000000","message":"nit: this seems unnecessary, you could have just added ``\u0027: \u0027`` to the expected error line\n\nFWIW the slightly odd \u0027: \u0027 ending to the log line is because the OSError exception doesn\u0027t match any of the special cases in swift.common.utils.logs.SwiftLogAdapter.exception.","commit_id":"41bf72a5cc5dbda1192732930c78a1fd91282f98"}],"test/unit/container/test_replicator.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"4627d5e2d929b3d11a7df8574ddace4541f3eba8","unresolved":true,"context_lines":[{"line_number":2456,"context_line":"                         remote_broker.get_shard_ranges())"},{"line_number":2457,"context_line":""},{"line_number":2458,"context_line":"        # sanity check - in sync"},{"line_number":2459,"context_line":"        self._assert_local_sharded_in_sync(local_broker, local_id)"},{"line_number":2460,"context_line":""},{"line_number":2461,"context_line":"        remote_broker \u003d self._get_broker(\u0027a\u0027, \u0027c\u0027, node_index\u003d1)"},{"line_number":2462,"context_line":"        shard_db \u003d make_db_file_path(remote_broker._db_file, epoch)"}],"source_content_type":"text/x-python","patch_set":35,"id":"3f5c3fdc_eadc62c5","line":2459,"updated":"2025-09-26 18:02:47.000000000","message":"I think there\u0027s some churned on log message format in container/replicator that we should be asserting has the expected db and path attributes:\n\n```\ndiff --git a/test/unit/container/test_replicator.py b/test/unit/container/test_replicator.py\nindex 1c45f3449..cf6ffb257 100644\n--- a/test/unit/container/test_replicator.py\n+++ b/test/unit/container/test_replicator.py\n@@ -1936,7 +1936,7 @@ class TestReplicatorSync(test_db_replicator.TestReplicatorSync):\n             self.rpc, replicate_hook\u003drepl_hook, errors\u003dNone)\n         db_replicator.ReplConnection \u003d fake_repl_connection\n         daemon \u003d replicator.ContainerReplicator(\n-            repl_conf, logger\u003ddebug_logger())\n+            repl_conf, logger\u003dself.logger)\n         self._install_fake_rsync_file(daemon, rsync_calls)\n         part, nodes \u003d self._ring.get_nodes(from_broker.account,\n                                            from_broker.container)\n@@ -2457,6 +2457,14 @@ class TestReplicatorSync(test_db_replicator.TestReplicatorSync):\n \n         # sanity check - in sync\n         self._assert_local_sharded_in_sync(local_broker, local_id)\n+        _, remote_node \u003d self._get_broker_part_node(remote_broker)\n+        node_str \u003d \u0027%(ip)s:%(port)s/%(device)s\u0027 % remote_node\n+        local_broker \u003d local_context[\u0027broker\u0027]\n+        self.assertEqual([\n+            f\u0027synced 2 shard ranges to {node_str}, \u0027\n+            f\u0027path: {local_broker.path}, \u0027\n+            f\u0027db: {local_broker.db_file}\u0027\n+        ], self.logger.get_lines_for_level(\u0027debug\u0027))\n \n         remote_broker \u003d self._get_broker(\u0027a\u0027, \u0027c\u0027, node_index\u003d1)\n         shard_db \u003d make_db_file_path(remote_broker._db_file, epoch)\n```\n\n^ N.B. re-using self.logger in the common test setup should probably `self.logger.clear` to be more in line with the existing behavior of a new daemon getting a fresh debug_logger every instance.","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"5d33b59db4d781fa7db0060473433c9232d91421","unresolved":false,"context_lines":[{"line_number":2456,"context_line":"                         remote_broker.get_shard_ranges())"},{"line_number":2457,"context_line":""},{"line_number":2458,"context_line":"        # sanity check - in sync"},{"line_number":2459,"context_line":"        self._assert_local_sharded_in_sync(local_broker, local_id)"},{"line_number":2460,"context_line":""},{"line_number":2461,"context_line":"        remote_broker \u003d self._get_broker(\u0027a\u0027, \u0027c\u0027, node_index\u003d1)"},{"line_number":2462,"context_line":"        shard_db \u003d make_db_file_path(remote_broker._db_file, epoch)"}],"source_content_type":"text/x-python","patch_set":35,"id":"71a6932b_af20fb87","line":2459,"in_reply_to":"3f5c3fdc_eadc62c5","updated":"2025-09-29 23:35:22.000000000","message":"Done","commit_id":"bf78c5b58deb65b33cb831ff73e1c56beeb6b013"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"44d16c35e3628fb4c843b1586e43f74eb435db61","unresolved":true,"context_lines":[{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def test_sync_shard_ranges_logs_via_db_log_debug(self):"},{"line_number":118,"context_line":"        daemon \u003d replicator.ContainerReplicator({}, logger\u003dself.logger)"},{"line_number":119,"context_line":"        daemon.db_log \u003d mock.Mock()"},{"line_number":120,"context_line":"        broker \u003d mock.Mock()"},{"line_number":121,"context_line":"        broker.db_file \u003d \u0027/path/to/db\u0027"},{"line_number":122,"context_line":"        broker.path \u003d \u0027/v1/AUTH_a/c\u0027"}],"source_content_type":"text/x-python","patch_set":44,"id":"8fa6de68_9e79be74","line":119,"updated":"2025-10-09 14:53:29.000000000","message":"why mock the db_log - the test name suggests the test is trying to cover db_log?\n\nsee suggestion here 963570: sq: container replicator: fixups for log messages and tests | https://review.opendev.org/c/openstack/swift/+/963570","commit_id":"f8607fbc8b0dd7898fc224dfc6d2dd231957ae0c"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"187adedb6cfd0da586b6778c6dc008077a240e81","unresolved":false,"context_lines":[{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def test_sync_shard_ranges_logs_via_db_log_debug(self):"},{"line_number":118,"context_line":"        daemon \u003d replicator.ContainerReplicator({}, logger\u003dself.logger)"},{"line_number":119,"context_line":"        daemon.db_log \u003d mock.Mock()"},{"line_number":120,"context_line":"        broker \u003d mock.Mock()"},{"line_number":121,"context_line":"        broker.db_file \u003d \u0027/path/to/db\u0027"},{"line_number":122,"context_line":"        broker.path \u003d \u0027/v1/AUTH_a/c\u0027"}],"source_content_type":"text/x-python","patch_set":44,"id":"6230bc8f_8c258df3","line":119,"in_reply_to":"8fa6de68_9e79be74","updated":"2025-10-11 22:14:28.000000000","message":"Acknowledged","commit_id":"f8607fbc8b0dd7898fc224dfc6d2dd231957ae0c"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"44d16c35e3628fb4c843b1586e43f74eb435db61","unresolved":true,"context_lines":[{"line_number":181,"context_line":""},{"line_number":182,"context_line":"        broker \u003d mock.Mock()"},{"line_number":183,"context_line":"        broker.sharding_initiated.return_value \u003d True"},{"line_number":184,"context_line":"        broker.get_objects.return_value \u003d []"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"        node \u003d {\u0027ip\u0027: \u002710.0.0.3\u0027, \u0027port\u0027: 6201, \u0027device\u0027: \u0027sdc1\u0027}"},{"line_number":187,"context_line":"        http \u003d mock.Mock()"}],"source_content_type":"text/x-python","patch_set":44,"id":"6970002f_29faff08","line":184,"updated":"2025-10-09 14:53:29.000000000","message":"this mock broker has not path or db_file (unlike tests above) - turns out it doesn\u0027t matter because you also mock db_log, but mocking db_log seems to be losing coverage unnecessarily - why not let the broker logger handle the logging and assert the log lines?\n\n963570: sq: container replicator: fixups for log messages and tests | https://review.opendev.org/c/openstack/swift/+/963570","commit_id":"f8607fbc8b0dd7898fc224dfc6d2dd231957ae0c"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"187adedb6cfd0da586b6778c6dc008077a240e81","unresolved":false,"context_lines":[{"line_number":181,"context_line":""},{"line_number":182,"context_line":"        broker \u003d mock.Mock()"},{"line_number":183,"context_line":"        broker.sharding_initiated.return_value \u003d True"},{"line_number":184,"context_line":"        broker.get_objects.return_value \u003d []"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"        node \u003d {\u0027ip\u0027: \u002710.0.0.3\u0027, \u0027port\u0027: 6201, \u0027device\u0027: \u0027sdc1\u0027}"},{"line_number":187,"context_line":"        http \u003d mock.Mock()"}],"source_content_type":"text/x-python","patch_set":44,"id":"378922af_48bd2820","line":184,"in_reply_to":"6970002f_29faff08","updated":"2025-10-11 22:14:28.000000000","message":"Done","commit_id":"f8607fbc8b0dd7898fc224dfc6d2dd231957ae0c"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"44d16c35e3628fb4c843b1586e43f74eb435db61","unresolved":true,"context_lines":[{"line_number":1331,"context_line":"        info \u003d broker.get_replication_info()"},{"line_number":1332,"context_line":"        daemon._post_replicate_hook(broker, info, [])"},{"line_number":1333,"context_line":"        log_lines \u003d self.logger.get_lines_for_level(\u0027error\u0027)"},{"line_number":1334,"context_line":"        self.assertEqual(1, len(log_lines))"},{"line_number":1335,"context_line":"        expected \u003d \u0027Failed to update sync_store, path: %s, db: %s: \u0027 % ("},{"line_number":1336,"context_line":"            quote(broker.path), broker.db_file"},{"line_number":1337,"context_line":"        )"}],"source_content_type":"text/x-python","patch_set":44,"id":"7f996599_e7615a84","line":1334,"updated":"2025-10-09 14:53:29.000000000","message":"nit: this assertion is unnecessary given the change at line 1338","commit_id":"f8607fbc8b0dd7898fc224dfc6d2dd231957ae0c"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"187adedb6cfd0da586b6778c6dc008077a240e81","unresolved":false,"context_lines":[{"line_number":1331,"context_line":"        info \u003d broker.get_replication_info()"},{"line_number":1332,"context_line":"        daemon._post_replicate_hook(broker, info, [])"},{"line_number":1333,"context_line":"        log_lines \u003d self.logger.get_lines_for_level(\u0027error\u0027)"},{"line_number":1334,"context_line":"        self.assertEqual(1, len(log_lines))"},{"line_number":1335,"context_line":"        expected \u003d \u0027Failed to update sync_store, path: %s, db: %s: \u0027 % ("},{"line_number":1336,"context_line":"            quote(broker.path), broker.db_file"},{"line_number":1337,"context_line":"        )"}],"source_content_type":"text/x-python","patch_set":44,"id":"33cabad8_75b59b60","line":1334,"in_reply_to":"7f996599_e7615a84","updated":"2025-10-11 22:14:28.000000000","message":"Removed","commit_id":"f8607fbc8b0dd7898fc224dfc6d2dd231957ae0c"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"44d16c35e3628fb4c843b1586e43f74eb435db61","unresolved":true,"context_lines":[{"line_number":1336,"context_line":"            quote(broker.path), broker.db_file"},{"line_number":1337,"context_line":"        )"},{"line_number":1338,"context_line":"        self.assertEqual(self.logger.get_lines_for_level(\u0027error\u0027),"},{"line_number":1339,"context_line":"                         [expected])"},{"line_number":1340,"context_line":""},{"line_number":1341,"context_line":"    def test_update_sync_store(self):"},{"line_number":1342,"context_line":"        klass \u003d \u0027swift.container.sync_store.ContainerSyncStore\u0027"}],"source_content_type":"text/x-python","patch_set":44,"id":"2da58547_c0deb099","line":1339,"updated":"2025-10-09 14:53:29.000000000","message":"every other logging assertion I have looked at so far (I haven\u0027t checked exhaustively) in this file has the expected value as the first arg - please  be consistent with the convention in the other tests","commit_id":"f8607fbc8b0dd7898fc224dfc6d2dd231957ae0c"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"187adedb6cfd0da586b6778c6dc008077a240e81","unresolved":false,"context_lines":[{"line_number":1336,"context_line":"            quote(broker.path), broker.db_file"},{"line_number":1337,"context_line":"        )"},{"line_number":1338,"context_line":"        self.assertEqual(self.logger.get_lines_for_level(\u0027error\u0027),"},{"line_number":1339,"context_line":"                         [expected])"},{"line_number":1340,"context_line":""},{"line_number":1341,"context_line":"    def test_update_sync_store(self):"},{"line_number":1342,"context_line":"        klass \u003d \u0027swift.container.sync_store.ContainerSyncStore\u0027"}],"source_content_type":"text/x-python","patch_set":44,"id":"a13e1651_c27255c2","line":1339,"in_reply_to":"2da58547_c0deb099","updated":"2025-10-11 22:14:28.000000000","message":"Done","commit_id":"f8607fbc8b0dd7898fc224dfc6d2dd231957ae0c"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"4632feca85c2ad3e542881be2ef9c24a2f2a2424","unresolved":true,"context_lines":[{"line_number":1336,"context_line":"            quote(broker.path), broker.db_file"},{"line_number":1337,"context_line":"        )"},{"line_number":1338,"context_line":"        self.assertEqual(self.logger.get_lines_for_level(\u0027error\u0027),"},{"line_number":1339,"context_line":"                         [expected])"},{"line_number":1340,"context_line":""},{"line_number":1341,"context_line":"    def test_update_sync_store(self):"},{"line_number":1342,"context_line":"        klass \u003d \u0027swift.container.sync_store.ContainerSyncStore\u0027"}],"source_content_type":"text/x-python","patch_set":44,"id":"ea86460e_806a2d47","line":1339,"in_reply_to":"a13e1651_c27255c2","updated":"2025-10-13 12:23:50.000000000","message":"not done?","commit_id":"f8607fbc8b0dd7898fc224dfc6d2dd231957ae0c"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"44d16c35e3628fb4c843b1586e43f74eb435db61","unresolved":true,"context_lines":[{"line_number":1894,"context_line":"        error_lines \u003d daemon.db_log.logger.get_lines_for_level(\u0027error\u0027)"},{"line_number":1895,"context_line":"        self.assertEqual(error_lines[0], \u0027ERROR syncing with %s, \u0027"},{"line_number":1896,"context_line":"                                         \u0027path: %s, db: %s: Timeout (0.001s)\u0027"},{"line_number":1897,"context_line":"                         % (node, broker.path, broker.db_file))"},{"line_number":1898,"context_line":"        self.assertFalse(error_lines[1:])"},{"line_number":1899,"context_line":"        self.assertEqual(0, daemon.stats[\u0027diff\u0027])"},{"line_number":1900,"context_line":"        self.assertNotIn("}],"source_content_type":"text/x-python","patch_set":44,"id":"a7546605_2954b5ed","line":1897,"updated":"2025-10-09 14:53:29.000000000","message":"ditto re expected value as first arg please","commit_id":"f8607fbc8b0dd7898fc224dfc6d2dd231957ae0c"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"187adedb6cfd0da586b6778c6dc008077a240e81","unresolved":false,"context_lines":[{"line_number":1894,"context_line":"        error_lines \u003d daemon.db_log.logger.get_lines_for_level(\u0027error\u0027)"},{"line_number":1895,"context_line":"        self.assertEqual(error_lines[0], \u0027ERROR syncing with %s, \u0027"},{"line_number":1896,"context_line":"                                         \u0027path: %s, db: %s: Timeout (0.001s)\u0027"},{"line_number":1897,"context_line":"                         % (node, broker.path, broker.db_file))"},{"line_number":1898,"context_line":"        self.assertFalse(error_lines[1:])"},{"line_number":1899,"context_line":"        self.assertEqual(0, daemon.stats[\u0027diff\u0027])"},{"line_number":1900,"context_line":"        self.assertNotIn("}],"source_content_type":"text/x-python","patch_set":44,"id":"6ecda453_bcef27ca","line":1897,"in_reply_to":"a7546605_2954b5ed","updated":"2025-10-11 22:14:28.000000000","message":"Done","commit_id":"f8607fbc8b0dd7898fc224dfc6d2dd231957ae0c"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"44d16c35e3628fb4c843b1586e43f74eb435db61","unresolved":true,"context_lines":[{"line_number":2413,"context_line":"            \u002710.0.0.1:1001/sdb; have shard ranges and will wait for cleaving,\u0027"},{"line_number":2414,"context_line":"            \u0027 path: %s, db: %s\u0027"},{"line_number":2415,"context_line":"            % (quote(local_broker.path), quote(local_broker.db_file)),"},{"line_number":2416,"context_line":"            lines[1])"},{"line_number":2417,"context_line":""},{"line_number":2418,"context_line":"    def _check_replication_local_sharding_remote_presharding(self, repl_conf):"},{"line_number":2419,"context_line":"        local_context \u003d self._setup_replication_test(0)"}],"source_content_type":"text/x-python","patch_set":44,"id":"79dbed11_1ef52864","line":2416,"updated":"2025-10-09 14:53:29.000000000","message":"ok! these new assertions *do* have expected value as first arg","commit_id":"f8607fbc8b0dd7898fc224dfc6d2dd231957ae0c"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"187adedb6cfd0da586b6778c6dc008077a240e81","unresolved":false,"context_lines":[{"line_number":2413,"context_line":"            \u002710.0.0.1:1001/sdb; have shard ranges and will wait for cleaving,\u0027"},{"line_number":2414,"context_line":"            \u0027 path: %s, db: %s\u0027"},{"line_number":2415,"context_line":"            % (quote(local_broker.path), quote(local_broker.db_file)),"},{"line_number":2416,"context_line":"            lines[1])"},{"line_number":2417,"context_line":""},{"line_number":2418,"context_line":"    def _check_replication_local_sharding_remote_presharding(self, repl_conf):"},{"line_number":2419,"context_line":"        local_context \u003d self._setup_replication_test(0)"}],"source_content_type":"text/x-python","patch_set":44,"id":"6f472ed8_e560c31a","line":2416,"in_reply_to":"79dbed11_1ef52864","updated":"2025-10-11 22:14:28.000000000","message":"Acknowledged","commit_id":"f8607fbc8b0dd7898fc224dfc6d2dd231957ae0c"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"44d16c35e3628fb4c843b1586e43f74eb435db61","unresolved":true,"context_lines":[{"line_number":2992,"context_line":""},{"line_number":2993,"context_line":"    def test_delete_db_logs_on_sync_store_error(self):"},{"line_number":2994,"context_line":"        daemon \u003d replicator.ContainerReplicator({}, logger\u003dself.logger)"},{"line_number":2995,"context_line":"        daemon.db_log \u003d mock.Mock()"},{"line_number":2996,"context_line":"        daemon.sync_store \u003d mock.Mock()"},{"line_number":2997,"context_line":""},{"line_number":2998,"context_line":"        broker \u003d self._get_broker(\u0027a\u0027, \u0027c\u0027, node_index\u003d0)"}],"source_content_type":"text/x-python","patch_set":44,"id":"88070491_47ca0d77","line":2995,"updated":"2025-10-09 14:53:29.000000000","message":"as above, seems odd to mock db_log\n\nsee 963570: sq: container replicator: fixups for log messages and tests | https://review.opendev.org/c/openstack/swift/+/963570","commit_id":"f8607fbc8b0dd7898fc224dfc6d2dd231957ae0c"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"187adedb6cfd0da586b6778c6dc008077a240e81","unresolved":false,"context_lines":[{"line_number":2992,"context_line":""},{"line_number":2993,"context_line":"    def test_delete_db_logs_on_sync_store_error(self):"},{"line_number":2994,"context_line":"        daemon \u003d replicator.ContainerReplicator({}, logger\u003dself.logger)"},{"line_number":2995,"context_line":"        daemon.db_log \u003d mock.Mock()"},{"line_number":2996,"context_line":"        daemon.sync_store \u003d mock.Mock()"},{"line_number":2997,"context_line":""},{"line_number":2998,"context_line":"        broker \u003d self._get_broker(\u0027a\u0027, \u0027c\u0027, node_index\u003d0)"}],"source_content_type":"text/x-python","patch_set":44,"id":"405495d5_88121d3a","line":2995,"in_reply_to":"88070491_47ca0d77","updated":"2025-10-11 22:14:28.000000000","message":"Done","commit_id":"f8607fbc8b0dd7898fc224dfc6d2dd231957ae0c"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"44d16c35e3628fb4c843b1586e43f74eb435db61","unresolved":true,"context_lines":[{"line_number":3001,"context_line":"            \u0027Failed to remove sync_store entry\u0027)"},{"line_number":3002,"context_line":""},{"line_number":3003,"context_line":"        with mock.patch.object(db_replicator.Replicator, \u0027delete_db\u0027,"},{"line_number":3004,"context_line":"                               return_value\u003d\u0027ok\u0027) as mock_super:"},{"line_number":3005,"context_line":"            delete_success \u003d daemon.delete_db(broker)"},{"line_number":3006,"context_line":"            daemon.db_log.exception.assert_called_once_with("},{"line_number":3007,"context_line":"                broker, \u0027Failed to remove sync_store entry\u0027"}],"source_content_type":"text/x-python","patch_set":44,"id":"b9925021_87256f8e","line":3004,"range":{"start_line":3004,"start_character":53,"end_line":3004,"end_character":63},"updated":"2025-10-09 14:53:29.000000000","message":"why does this return a string - the mocked method returns a boolean?","commit_id":"f8607fbc8b0dd7898fc224dfc6d2dd231957ae0c"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"187adedb6cfd0da586b6778c6dc008077a240e81","unresolved":false,"context_lines":[{"line_number":3001,"context_line":"            \u0027Failed to remove sync_store entry\u0027)"},{"line_number":3002,"context_line":""},{"line_number":3003,"context_line":"        with mock.patch.object(db_replicator.Replicator, \u0027delete_db\u0027,"},{"line_number":3004,"context_line":"                               return_value\u003d\u0027ok\u0027) as mock_super:"},{"line_number":3005,"context_line":"            delete_success \u003d daemon.delete_db(broker)"},{"line_number":3006,"context_line":"            daemon.db_log.exception.assert_called_once_with("},{"line_number":3007,"context_line":"                broker, \u0027Failed to remove sync_store entry\u0027"}],"source_content_type":"text/x-python","patch_set":44,"id":"517bfc70_dad59bd4","line":3004,"range":{"start_line":3004,"start_character":53,"end_line":3004,"end_character":63},"in_reply_to":"b9925021_87256f8e","updated":"2025-10-11 22:14:28.000000000","message":"Done","commit_id":"f8607fbc8b0dd7898fc224dfc6d2dd231957ae0c"}]}
