diff --git a/swift/obj/reconstructor.py b/swift/obj/reconstructor.py index 71ae06e5fc..e95000dc8f 100644 --- a/swift/obj/reconstructor.py +++ b/swift/obj/reconstructor.py @@ -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)) diff --git a/test/unit/obj/test_reconstructor.py b/test/unit/obj/test_reconstructor.py index 6da0ad09ee..b4e1555913 100644 --- a/test/unit/obj/test_reconstructor.py +++ b/test/unit/obj/test_reconstructor.py @@ -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,