Merge "Do not sync suffixes when remote rejects reconstructor sync"

This commit is contained in:
Zuul 2019-06-06 01:16:51 +00:00 committed by Gerrit Code Review
commit f7445dda8a
2 changed files with 7 additions and 1 deletions

View File

@ -850,7 +850,8 @@ class ObjectReconstructor(Daemon):
success, _ = ssync_sender(
self, node, job, suffixes)()
# let remote end know to rehash it's suffixes
self.rehash_remote(node, job, suffixes)
if success:
self.rehash_remote(node, job, suffixes)
# update stats for this attempt
self.suffix_sync += len(suffixes)
self.logger.update_stats('suffix.syncs', len(suffixes))

View File

@ -4113,6 +4113,11 @@ class TestObjectReconstructor(BaseTestObjectReconstructor):
(node['replication_ip'], '/%s/0' % node['device']),
(node['replication_ip'], '/%s/0/123-abc' % node['device']),
])
# the first (primary sync_to) node's rehash_remote will be skipped
first_node = part_nodes[0]
expected_suffix_calls.remove(
(first_node['replication_ip'], '/%s/0/123-abc'
% first_node['device']))
ssync_calls = []
with mock_ssync_sender(ssync_calls,