Commit 2dbdc90e authored by Grégory Wisniewski's avatar Grégory Wisniewski

Fix "Fix replication when last TID range is empty"

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2499 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 3024298e
...@@ -198,6 +198,9 @@ class ReplicationHandler(EventHandler): ...@@ -198,6 +198,9 @@ class ReplicationHandler(EventHandler):
def _checkRange(self, match, current_boundary, next_boundary, length, def _checkRange(self, match, current_boundary, next_boundary, length,
count): count):
if count == 0:
# Reference storage has no data for this chunk, stop and truncate.
return CHECK_DONE, (current_boundary, )
if match: if match:
# Same data on both sides # Same data on both sides
if length < RANGE_LENGTH and length == count: if length < RANGE_LENGTH and length == count:
...@@ -224,12 +227,7 @@ class ReplicationHandler(EventHandler): ...@@ -224,12 +227,7 @@ class ReplicationHandler(EventHandler):
params = (next_boundary, ) params = (next_boundary, )
else: else:
# We must recheck current chunk. # We must recheck current chunk.
if count == 0: if length <= MIN_RANGE_LENGTH:
# Reference storage has no data for this chunk, stop and
# truncate.
action = CHECK_DONE
params = (current_boundary, )
elif length <= MIN_RANGE_LENGTH:
# We are already at minimum chunk length, replicate. # We are already at minimum chunk length, replicate.
action = CHECK_REPLICATE action = CHECK_REPLICATE
params = (recheck_min_boundary, ) params = (recheck_min_boundary, )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment