From 923b8b95c3ea46b5ad017690752a24f4f4e10f8a Mon Sep 17 00:00:00 2001 From: Dan Hersam Date: Fri, 16 Nov 2012 18:51:22 +0000 Subject: [PATCH] Fix for container sync not syncing last rowid Bug 1079439 Change-Id: I1985a7176f34931ecb0f24c0289f18df5e934598 --- swift/container/sync.py | 2 +- test/unit/container/test_sync.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/swift/container/sync.py b/swift/container/sync.py index befa3d417d..e28d2c5160 100644 --- a/swift/container/sync.py +++ b/swift/container/sync.py @@ -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) diff --git a/test/unit/container/test_sync.py b/test/unit/container/test_sync.py index 4f33081449..10173d5d1b 100644 --- a/test/unit/container/test_sync.py +++ b/test/unit/container/test_sync.py @@ -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)