diff --git a/swift/container/sharder.py b/swift/container/sharder.py index d20d1d442c..4a243deabd 100644 --- a/swift/container/sharder.py +++ b/swift/container/sharder.py @@ -1894,7 +1894,8 @@ class ContainerSharder(ContainerSharderConf, ContainerReplicator): include_deleted=True) # send everything if self._send_shard_ranges( - broker.root_account, broker.root_container, shard_ranges): + broker.root_account, broker.root_container, shard_ranges, + {'Referer': quote(broker.path)}): # on success, mark ourselves as reported so we don't keep # hammering the root own_shard_range.reported = True diff --git a/test/unit/container/test_sharder.py b/test/unit/container/test_sharder.py index 50030c5229..17120c2b57 100644 --- a/test/unit/container/test_sharder.py +++ b/test/unit/container/test_sharder.py @@ -4755,12 +4755,14 @@ class TestSharder(BaseTestSharder): def check_shard_ranges_sent(self, broker, expected_sent): bodies = [] servers = [] + referers = [] def capture_send(conn, data): bodies.append(data) - def capture_connect(host, port, *a, **kw): + def capture_connect(host, port, _method, _path, headers, *a, **kw): servers.append((host, port)) + referers.append(headers.get('Referer')) self.assertFalse(broker.get_own_shard_range().reported) # sanity with self._mock_sharder() as sharder: @@ -4779,6 +4781,7 @@ class TestSharder(BaseTestSharder): ('10.0.1.1', 1101), ('10.0.1.2', 1102), ]) + self.assertEqual([broker.path] * 3, referers) self.assertTrue(broker.get_own_shard_range().reported) def test_update_root_container_own_range(self):