summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Kreen2013-10-04 12:37:05 +0000
committerMarko Kreen2013-10-04 12:37:05 +0000
commit5f7309f3183647550072616303c2838593d537e1 (patch)
treea76df183e31b00b51bd941f86feab70455e63a85
parentdde487beaef91e9bb0ae2c5f24a457586f1b7c14 (diff)
parent5ba237397082176373ec700068351e641050e13a (diff)
Merge remote-tracking branch 'gamato/master'
Conflicts: debian/changelog
-rw-r--r--debian/changelog6
-rw-r--r--python/londiste/handlers/dispatch.py2
-rw-r--r--python/londiste/setup.py11
3 files changed, 19 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index 9429b6e3..f15aec6a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+skytools3 (3.1.5.3) experimental; urgency=low
+
+ * v3.1.5.3
+
+ -- martinko <gamato@users.sf.net> Fri, 20 Sep 2013 14:28:56 +0200
+
skytools3 (3.1.5.2) experimental; urgency=low
* v3.1.5.2
diff --git a/python/londiste/handlers/dispatch.py b/python/londiste/handlers/dispatch.py
index 0b02edcd..7590ee73 100644
--- a/python/londiste/handlers/dispatch.py
+++ b/python/londiste/handlers/dispatch.py
@@ -913,6 +913,8 @@ class Dispatcher (ShardHandler):
self.drop_obsolete_partitions (self.dest_table, self.conf.retention_period, self.conf.period)
if self.conf.ignore_old_events and not skytools.exists_table(curs, dst):
self.ignored_tables.add(dst) # must have been just dropped
+ if dst in self.row_handler.table_map:
+ del self.row_handler.table_map[dst]
def drop_obsolete_partitions (self, parent_table, retention_period, partition_period):
""" Drop obsolete partitions of partition-by-date parent table.
diff --git a/python/londiste/setup.py b/python/londiste/setup.py
index 20d3f5c0..1ce79598 100644
--- a/python/londiste/setup.py
+++ b/python/londiste/setup.py
@@ -40,6 +40,8 @@ class LondisteSetup(CascadeAdmin):
self.set_name = self.queue_name
+ self.lock_timeout = self.cf.getfloat('lock_timeout', 10)
+
londiste.handler.load_handler_modules(self.cf)
def init_optparse(self, parser=None):
@@ -117,6 +119,13 @@ class LondisteSetup(CascadeAdmin):
def is_root(self):
return self.queue_info.local_node.type == 'root'
+ def set_lock_timeout(self, curs):
+ ms = int(1000 * self.lock_timeout)
+ if ms > 0:
+ q = "SET LOCAL statement_timeout = %d" % ms
+ self.log.debug(q)
+ curs.execute(q)
+
def cmd_add_table(self, *args):
"""Attach table(s) to local node."""
@@ -198,6 +207,8 @@ class LondisteSetup(CascadeAdmin):
tbl_exists = skytools.exists_table(dst_curs, dest_table)
dst_db.commit()
+ self.set_lock_timeout(dst_curs)
+
if dest_table == tbl:
desc = tbl
else: