Skip to content

Commit

Permalink
Add comment about ResumingGetter.used_source_etag
Browse files Browse the repository at this point in the history
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
  • Loading branch information
smerritt committed Jul 21, 2015
1 parent 317fa1a commit c3cc98b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions swift/proxy/controllers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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('"')
Expand Down

0 comments on commit c3cc98b

Please sign in to comment.