Merge "Fix for container sync not syncing last rowid"

This commit is contained in:
Jenkins 2012-11-29 20:21:45 +00:00 committed by Gerrit Code Review
commit a830b6ffc9
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)