)]}'
{"swift/common/db_replicator.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"8a6634d97373566dd42aa0341b8f17f85bd20ce2","unresolved":false,"context_lines":[{"line_number":618,"context_line":"        local_dev \u003d None"},{"line_number":619,"context_line":"        for node in nodes:"},{"line_number":620,"context_line":"            if node[\u0027id\u0027] \u003d\u003d node_id:"},{"line_number":621,"context_line":"                local_dev \u003d node"},{"line_number":622,"context_line":"                break"},{"line_number":623,"context_line":"        if shouldbehere:"},{"line_number":624,"context_line":"            shouldbehere \u003d bool([n for n in nodes if n[\u0027id\u0027] \u003d\u003d node_id])"}],"source_content_type":"text/x-python","patch_set":1,"id":"7faddb67_ef2071b3","line":621,"updated":"2019-07-03 20:27:18.000000000","message":"oic, so node_id really is like the \"local\" node","commit_id":"8980666419d9ede13c5fb27def20c6ecf3673c46"}],"swift/container/replicator.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"8a6634d97373566dd42aa0341b8f17f85bd20ce2","unresolved":false,"context_lines":[{"line_number":137,"context_line":""},{"line_number":138,"context_line":"    def _fetch_and_merge_shard_ranges(self, http, broker):"},{"line_number":139,"context_line":"        with Timeout(self.node_timeout):"},{"line_number":140,"context_line":"            response \u003d http.replicate(\u0027get_shard_ranges\u0027)"},{"line_number":141,"context_line":"        if is_success(response.status):"},{"line_number":142,"context_line":"            broker.merge_shard_ranges(json.loads("},{"line_number":143,"context_line":"                response.data.decode(\u0027ascii\u0027)))"}],"source_content_type":"text/x-python","patch_set":1,"id":"7faddb67_7a2c4199","line":140,"updated":"2019-07-03 20:27:18.000000000","message":"so this is the only http.replicate call in this module, and as best I can tell all of the ones in db_replicator DO get wrapped in self.node_timeout\n\nso that\u0027s kinda scary...","commit_id":"8980666419d9ede13c5fb27def20c6ecf3673c46"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"234676ba9d82fc608a38f8af19fc14d8b766b1e5","unresolved":false,"context_lines":[{"line_number":79,"context_line":"                                          sync_timestamps))"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"            if remote_info.get(\u0027shard_max_row\u0027, -1) \u003e\u003d 0:"},{"line_number":82,"context_line":"                # Grab remote\u0027s shard ranges, too"},{"line_number":83,"context_line":"                self._fetch_and_merge_shard_ranges(http, broker)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"        return super(ContainerReplicator, self)._handle_sync_response("}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_24cc3134","line":82,"updated":"2019-07-08 19:55:55.000000000","message":"this is a pretty significant optimization!\n\n\t\u003e\u003e\u003e from swift.container.backend import ContainerBroker\n\t\u003e\u003e\u003e b \u003d ContainerBroker(\u0027/srv/node3/sdb3/containers/28/afd/7089ab48d955ab0851fc51cc17a34afd/7089ab48d955ab0851fc51cc17a34afd.db\u0027)\n\t\u003e\u003e\u003e b.get_replication_info()[\u0027shard_max_row\u0027]\n\t-1\n\t\u003e\u003e\u003e","commit_id":"4c4bd778ea8fe8d02a2892524c7918da0ca25ea9"}],"test/unit/container/test_replicator.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"8a6634d97373566dd42aa0341b8f17f85bd20ce2","unresolved":false,"context_lines":[{"line_number":1452,"context_line":"        def replicate_hook(op, *args):"},{"line_number":1453,"context_line":"            replicate_calls.append(op)"},{"line_number":1454,"context_line":"            if op \u003d\u003d \u0027get_shard_ranges\u0027:"},{"line_number":1455,"context_line":"                sleep(0.1)"},{"line_number":1456,"context_line":""},{"line_number":1457,"context_line":"        fake_repl_connection \u003d attach_fake_replication_rpc("},{"line_number":1458,"context_line":"            self.rpc, replicate_hook\u003dreplicate_hook)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7faddb67_1a6f4dc6","line":1455,"updated":"2019-07-03 20:27:18.000000000","message":"I think this sleep/timeout is too tight for the gate, and I\u0027m not sure this tests assertions are strong enough to cover regression...\n\nThis change still passes:\n\n\tdiff --git a/swift/container/replicator.py b/swift/container/replicator.py\n\tindex b1c3f165d..a39b6a774 100644\n\t--- a/swift/container/replicator.py\n\t+++ b/swift/container/replicator.py\n\t@@ -136,8 +136,7 @@ class ContainerReplicator(db_replicator.Replicator):\n\t\t return shard_range_success and success\n\t \n\t     def _fetch_and_merge_shard_ranges(self, http, broker):\n\t-        with Timeout(self.node_timeout):\n\t-            response \u003d http.replicate(\u0027get_shard_ranges\u0027)\n\t+        response \u003d http.replicate(\u0027get_shard_ranges\u0027)\n\t\t if is_success(response.status):\n\t\t     broker.merge_shard_ranges(json.loads(\n\t\t\t response.data.decode(\u0027ascii\u0027)))\n\tdiff --git a/test/unit/container/test_replicator.py b/test/unit/container/test_replicator.py\n\tindex 80958d843..f5b6a76bb 100644\n\t--- a/test/unit/container/test_replicator.py\n\t+++ b/test/unit/container/test_replicator.py\n\t@@ -1452,7 +1452,7 @@ class TestReplicatorSync(test_db_replicator.TestReplicatorSync):\n\t\t def replicate_hook(op, *args):\n\t\t     replicate_calls.append(op)\n\t\t     if op \u003d\u003d \u0027get_shard_ranges\u0027:\n\t-                sleep(0.1)\n\t+                raise Exception(\u0027a failure is a failure?\u0027)\n\t \n\t\t fake_repl_connection \u003d attach_fake_replication_rpc(\n\t\t     self.rpc, replicate_hook\u003dreplicate_hook)\n\n\nIt\u0027s not obvious to me how to make this test better tho, so maybe this is better than nothing.  :ashamed:","commit_id":"8980666419d9ede13c5fb27def20c6ecf3673c46"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"5d7449b64d642c24bbce3085f95edf02e21257e8","unresolved":false,"context_lines":[{"line_number":1452,"context_line":"        def replicate_hook(op, *args):"},{"line_number":1453,"context_line":"            replicate_calls.append(op)"},{"line_number":1454,"context_line":"            if op \u003d\u003d \u0027get_shard_ranges\u0027:"},{"line_number":1455,"context_line":"                sleep(0.1)"},{"line_number":1456,"context_line":""},{"line_number":1457,"context_line":"        fake_repl_connection \u003d attach_fake_replication_rpc("},{"line_number":1458,"context_line":"            self.rpc, replicate_hook\u003dreplicate_hook)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7faddb67_50ee0189","line":1455,"in_reply_to":"7faddb67_1a6f4dc6","updated":"2019-07-04 05:29:20.000000000","message":"Gate flakiness is a definite concern -- but I think I\u0027m less worried about it here than a lot of other tests? The main concern would be a suspend that\u0027s more than 0.1s that hits after this call but before our 1ms node_timeout pops, right? I like my odds there -- way better than worrying about making sure some timeout *doesn\u0027t* pop.\n\nI\u0027m not as worried about this covering regressions. Yeah, when you change the test, you change what you\u0027re testing. Given that the name of the thing is test_sync_shard_ranges_timeout_in_fetch I\u0027d hope we\u0027d think twice about changing the timeout for another exception.","commit_id":"8980666419d9ede13c5fb27def20c6ecf3673c46"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"8a6634d97373566dd42aa0341b8f17f85bd20ce2","unresolved":false,"context_lines":[{"line_number":1458,"context_line":"            self.rpc, replicate_hook\u003dreplicate_hook)"},{"line_number":1459,"context_line":"        db_replicator.ReplConnection \u003d fake_repl_connection"},{"line_number":1460,"context_line":"        part, node \u003d self._get_broker_part_node(remote_broker)"},{"line_number":1461,"context_line":"        #info \u003d broker.get_replication_info()"},{"line_number":1462,"context_line":"        daemon \u003d replicator.ContainerReplicator({\u0027node_timeout\u0027: \u00270.001\u0027})"},{"line_number":1463,"context_line":"        daemon.logger \u003d FakeLogger()"},{"line_number":1464,"context_line":"        with mock.patch.object(daemon.ring, \u0027get_part_nodes\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"7faddb67_1a7d0d6e","line":1461,"updated":"2019-07-03 20:27:18.000000000","message":"oops?","commit_id":"8980666419d9ede13c5fb27def20c6ecf3673c46"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"5d7449b64d642c24bbce3085f95edf02e21257e8","unresolved":false,"context_lines":[{"line_number":1458,"context_line":"            self.rpc, replicate_hook\u003dreplicate_hook)"},{"line_number":1459,"context_line":"        db_replicator.ReplConnection \u003d fake_repl_connection"},{"line_number":1460,"context_line":"        part, node \u003d self._get_broker_part_node(remote_broker)"},{"line_number":1461,"context_line":"        #info \u003d broker.get_replication_info()"},{"line_number":1462,"context_line":"        daemon \u003d replicator.ContainerReplicator({\u0027node_timeout\u0027: \u00270.001\u0027})"},{"line_number":1463,"context_line":"        daemon.logger \u003d FakeLogger()"},{"line_number":1464,"context_line":"        with mock.patch.object(daemon.ring, \u0027get_part_nodes\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"7faddb67_f0260d17","line":1461,"in_reply_to":"7faddb67_1a7d0d6e","updated":"2019-07-04 05:29:20.000000000","message":"I cribbed heavily from test_sync_shard_ranges_error -- there might be some other vars/setup that aren\u0027t really needed.","commit_id":"8980666419d9ede13c5fb27def20c6ecf3673c46"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"8a6634d97373566dd42aa0341b8f17f85bd20ce2","unresolved":false,"context_lines":[{"line_number":1470,"context_line":"        self.assertEqual([\u0027sync\u0027, \u0027get_shard_ranges\u0027], replicate_calls)"},{"line_number":1471,"context_line":"        error_lines \u003d daemon.logger.get_lines_for_level(\u0027error\u0027)"},{"line_number":1472,"context_line":"        self.assertIn(\u0027ERROR syncing /\u0027, error_lines[0])"},{"line_number":1473,"context_line":"        self.assertIn(\u0027ERROR syncing /\u0027, error_lines[0])"},{"line_number":1474,"context_line":"        self.assertFalse(error_lines[1:])"},{"line_number":1475,"context_line":"        self.assertEqual(0, daemon.stats[\u0027diff\u0027])"},{"line_number":1476,"context_line":"        self.assertNotIn(\u0027diffs\u0027, daemon.logger.get_increment_counts())"}],"source_content_type":"text/x-python","patch_set":1,"id":"7faddb67_7aed2124","line":1473,"updated":"2019-07-03 20:27:18.000000000","message":"dupe","commit_id":"8980666419d9ede13c5fb27def20c6ecf3673c46"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"5d7449b64d642c24bbce3085f95edf02e21257e8","unresolved":false,"context_lines":[{"line_number":1470,"context_line":"        self.assertEqual([\u0027sync\u0027, \u0027get_shard_ranges\u0027], replicate_calls)"},{"line_number":1471,"context_line":"        error_lines \u003d daemon.logger.get_lines_for_level(\u0027error\u0027)"},{"line_number":1472,"context_line":"        self.assertIn(\u0027ERROR syncing /\u0027, error_lines[0])"},{"line_number":1473,"context_line":"        self.assertIn(\u0027ERROR syncing /\u0027, error_lines[0])"},{"line_number":1474,"context_line":"        self.assertFalse(error_lines[1:])"},{"line_number":1475,"context_line":"        self.assertEqual(0, daemon.stats[\u0027diff\u0027])"},{"line_number":1476,"context_line":"        self.assertNotIn(\u0027diffs\u0027, daemon.logger.get_increment_counts())"}],"source_content_type":"text/x-python","patch_set":1,"id":"7faddb67_300d8590","line":1473,"in_reply_to":"7faddb67_7aed2124","updated":"2019-07-04 05:29:20.000000000","message":"I hadn\u0027t patched _post_replicate_hook originally and there was another log line. I debated about making assertion on it, but decided to just dodge it instead.","commit_id":"8980666419d9ede13c5fb27def20c6ecf3673c46"}]}
