Comment 2 for bug 1886782

Revision history for this message
Bhaskar Singhal (bhaskarsinghal) wrote :

Thanks Tim.

Yes, https://bugs.launchpad.net/swift/+bug/1862645 looks same.

I agree, for a replicate after failed sync should be fine where atleast few suffixes were synced and we want the remote to re-hash.

Regarding root causing, I am not been able to pinpoint the exact issue. But, yes it could be a concurrency bug.

For now I think we can fix this by making the following changes:

diff --git a/swift/obj/replicator.py b/swift/obj/replicator.py
index e3634bb8f..230b2fc79 100644
--- a/swift/obj/replicator.py
+++ b/swift/obj/replicator.py
@@ -687,6 +687,9 @@ class ObjectReplicator(Daemon):
                     suffixes = [suffix for suffix in local_hash if
                                 local_hash[suffix] !=
                                 remote_hash.get(suffix, -1)]
+ if not suffixes:
+ stats.hashmatch += 1
+ continue
                     stats.rsync += 1
                     success, _junk = self.sync(node, job, suffixes)
                     with Timeout(self.http_timeout):