summaryrefslogtreecommitdiff
path: root/swift/obj/ssync_sender.py
diff options
context:
space:
mode:
authorAlistair Coles <alistairncoles@gmail.com>2021-12-03 14:35:09 +0000
committerAlistair Coles <alistairncoles@gmail.com>2021-12-03 14:37:59 +0000
commit1b3879e0da4def66b98ff5735331ab1cef4d365f (patch)
tree4f92bae6b0cad070e47e5c9aa42ef78896964891 /swift/obj/ssync_sender.py
parent8ee631cceeac560cc272693b4a70567a271f2754 (diff)
downloadswift-1b3879e0da4def66b98ff5735331ab1cef4d365f.tar.gz
reconstructor: include partially reverted handoffs in handoffs_remaining
For a reconstructor revert job, if sync'd to sufficient other nodes, the handoff partition is considered done and handoffs_remaining is not incremented. With the new max_objects_per_revert option [1], a ssync job may appear to be complete but not all objects have yet been reverted, so handoffs remaining should be incremented. [1] Related-Change: If81760c80a4692212e3774e73af5ce37c02e8aff Change-Id: I59572f75b9b0ba331369eb7358932943b7935ff0
Diffstat (limited to 'swift/obj/ssync_sender.py')
-rw-r--r--swift/obj/ssync_sender.py22
1 files changed, 13 insertions, 9 deletions
diff --git a/swift/obj/ssync_sender.py b/swift/obj/ssync_sender.py
index 309bcc1b6..efcef6948 100644
--- a/swift/obj/ssync_sender.py
+++ b/swift/obj/ssync_sender.py
@@ -155,6 +155,7 @@ class Sender(object):
self.remote_check_objs = remote_check_objs
self.include_non_durable = include_non_durable
self.max_objects = max_objects
+ self.limited_by_max_objects = False
def __call__(self):
"""
@@ -285,6 +286,7 @@ class Sender(object):
Full documentation of this can be found at
:py:meth:`.Receiver.missing_check`.
"""
+ self.limited_by_max_objects = False
available_map = {}
send_map = {}
# First, send our list.
@@ -307,6 +309,7 @@ class Sender(object):
self.remote_check_objs, hash_gen)
nlines = 0
nbytes = 0
+ object_hash = None
for object_hash, timestamps in hash_gen:
available_map[object_hash] = timestamps
with exceptions.MessageTimeout(
@@ -321,16 +324,17 @@ class Sender(object):
nlines += 1
nbytes += len(msg)
if 0 < self.max_objects <= nlines:
- for _ in hash_gen:
- # only log truncation if there were more hashes to come...
- self.daemon.logger.info(
- 'ssync missing_check truncated after %d objects: '
- 'device: %s, part: %s, policy: %s, last object hash: '
- '%s', nlines, self.job['device'],
- self.job['partition'], int(self.job['policy']),
- object_hash)
- break
break
+ for _ in hash_gen:
+ # only log truncation if there were more hashes to come...
+ self.limited_by_max_objects = True
+ self.daemon.logger.info(
+ 'ssync missing_check truncated after %d objects: '
+ 'device: %s, part: %s, policy: %s, last object hash: '
+ '%s', nlines, self.job['device'],
+ self.job['partition'], int(self.job['policy']),
+ object_hash)
+ break
with exceptions.MessageTimeout(
self.daemon.node_timeout, 'missing_check end'):
msg = b':MISSING_CHECK: END\r\n'