Skip to content

Commit

Permalink
Fix for container sync not syncing last rowid
Browse files Browse the repository at this point in the history
Bug 1079439

Change-Id: I1985a7176f34931ecb0f24c0289f18df5e934598
  • Loading branch information
Dan Hersam committed Nov 19, 2012
1 parent cb55f0c commit 923b8b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion swift/container/sync.py
Expand Up @@ -291,7 +291,7 @@ def container_sync(self, path):
if not rows:
break
row = rows[0]
if row['ROWID'] >= sync_point1:
if row['ROWID'] > sync_point1:
break
key = hash_path(info['account'], info['container'],
row['name'], raw_digest=True)
Expand Down
4 changes: 2 additions & 2 deletions test/unit/container/test_sync.py
Expand Up @@ -436,7 +436,7 @@ def fake_hash_path(account, container, obj, raw_digest=False):
fcb = FakeContainerBroker('path',
info={'account': 'a', 'container': 'c',
'x_container_sync_point1': 1,
'x_container_sync_point2': -1},
'x_container_sync_point2': 1},
metadata={'x-container-sync-to': ('http://127.0.0.1/a/c', 1),
'x-container-sync-key': ('key', 1)},
items_since=[{'ROWID': 1, 'name': 'o'}])
Expand All @@ -445,7 +445,7 @@ def fake_hash_path(account, container, obj, raw_digest=False):
cs._myport = 1000 # Match
cs.allowed_sync_hosts = ['127.0.0.1']
cs.container_sync('isa.db')
# Succeeds because the two sync points haven't deviated enough yet
# Succeeds because the two sync points haven't deviated yet
self.assertEquals(cs.container_failures, 0)
self.assertEquals(cs.container_skips, 0)
self.assertEquals(fcb.sync_point1, -1)
Expand Down

0 comments on commit 923b8b9

Please sign in to comment.