Fix for container sync not syncing last rowid

Bug 1079439

Change-Id: I1985a7176f34931ecb0f24c0289f18df5e934598
This commit is contained in:
Dan Hersam 2012-11-16 18:51:22 +00:00
parent cb55f0c3a8
commit 923b8b95c3
2 changed files with 3 additions and 3 deletions

View File

@ -291,7 +291,7 @@ class ContainerSync(Daemon):
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)

View File

@ -436,7 +436,7 @@ class TestContainerSync(unittest.TestCase):
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'}])
@ -445,7 +445,7 @@ class TestContainerSync(unittest.TestCase):
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)