From bb202265bee24440ba53ba8a6f208a757f3e9bd8 Mon Sep 17 00:00:00 2001 From: Alexey Bashtanov Date: Tue, 4 Oct 2016 09:11:19 +0100 Subject: [PATCH 1/2] fix branch-to-leaf repair: it used to never sync --- python/londiste/syncer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/londiste/syncer.py b/python/londiste/syncer.py index ae6df092..054778a8 100644 --- a/python/londiste/syncer.py +++ b/python/londiste/syncer.py @@ -325,7 +325,7 @@ def lock_table_branch(self, lock_db, setup_db, dst_db, src_tbl, dst_tbl): q = "select * from pgq_node.get_node_info(%s)" res = self.exec_cmd(dst_db, q, [self.queue_name]) last_tick = res[0]['worker_last_tick'] - if last_tick > tick_id: + if last_tick >= tick_id: break # limit lock time From db350172168bbe8960788156656ec254fe685624 Mon Sep 17 00:00:00 2001 From: Alexey Bashtanov Date: Tue, 4 Oct 2016 11:01:57 +0100 Subject: [PATCH 2/2] fix tests to detect branch->leaf sync problems --- tests/env.sh | 3 ++- tests/londiste/test-compare.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/env.sh b/tests/env.sh index 73125277..f373a15c 100644 --- a/tests/env.sh +++ b/tests/env.sh @@ -18,4 +18,5 @@ export PYTHONPATH PATH LD_LIBRARY_PATH PATH PGHOST=localhost export PGHOST - +# to make tests independent from user environment +PSQLRC=/dev/null diff --git a/tests/londiste/test-compare.sh b/tests/londiste/test-compare.sh index a4a8debc..71301112 100755 --- a/tests/londiste/test-compare.sh +++ b/tests/londiste/test-compare.sh @@ -60,7 +60,7 @@ run londiste3 $v conf/londiste_db1.ini create-root node1 'dbname=db1' run londiste3 $v conf/londiste_db2.ini create-branch node2 'dbname=db2' --provider='dbname=db1' run londiste3 $v conf/londiste_db3.ini create-branch node3 'dbname=db3' --provider='dbname=db2' run londiste3 $v conf/londiste_db4.ini create-branch node4 'dbname=db4' --provider='dbname=db3' -run londiste3 $v conf/londiste_db5.ini create-branch node5 'dbname=db5' --provider='dbname=db4' +run londiste3 $v conf/londiste_db5.ini create-leaf node5 'dbname=db5' --provider='dbname=db4' msg "Run ticker" run pgqd $v -d conf/pgqd.ini