From c3cc98b2c918476f1b54924e0c54e4c746eba4ac Mon Sep 17 00:00:00 2001 From: Samuel Merritt Date: Mon, 20 Jul 2015 17:03:20 -0700 Subject: [PATCH] Add comment about ResumingGetter.used_source_etag This confused a couple developers and took about ten minutes to unravel in IRC; let's leave a clue for the next person. Change-Id: I356c8c7a44de23f02eaf68d23a39c9eb4c203ff1 --- swift/proxy/controllers/base.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/swift/proxy/controllers/base.py b/swift/proxy/controllers/base.py index 5b7d089559..554469cc06 100644 --- a/swift/proxy/controllers/base.py +++ b/swift/proxy/controllers/base.py @@ -1045,6 +1045,13 @@ def _get_source_and_node(self): src_headers = dict( (k.lower(), v) for k, v in possible_source.getheaders()) + + # Save off the source etag so that, if we lose the connection + # and have to resume from a different node, we can be sure that + # we have the same object (replication) or a fragment archive + # from the same object (EC). Otherwise, if the cluster has two + # versions of the same object, we might end up switching between + # old and new mid-stream and giving garbage to the client. self.used_source_etag = src_headers.get( 'x-object-sysmeta-ec-etag', src_headers.get('etag', '')).strip('"')