summaryrefslogtreecommitdiff
path: root/python/londiste
diff options
context:
space:
mode:
authormartinko2013-12-03 14:46:09 +0000
committermartinko2013-12-03 14:46:09 +0000
commitc21ba2092ee8b1b6ed7874f1db445ffebc2d5c3b (patch)
tree2005be8e32a3aff88498f5f3ec3b0587b9f6dc4f /python/londiste
parent287a7c3a2e112d0219b0b6fb08175cd6a7afda81 (diff)
londiste.handlers.dispatch: fixed "ignore events aiming at obsolete partitions" bug
but really :-)
Diffstat (limited to 'python/londiste')
-rw-r--r--python/londiste/handlers/dispatch.py12
-rw-r--r--python/londiste/setup.py2
2 files changed, 8 insertions, 6 deletions
diff --git a/python/londiste/handlers/dispatch.py b/python/londiste/handlers/dispatch.py
index 7590ee73..2a39475a 100644
--- a/python/londiste/handlers/dispatch.py
+++ b/python/londiste/handlers/dispatch.py
@@ -910,11 +910,12 @@ class Dispatcher (ShardHandler):
self.log.info("Created table: %s", dst)
if self.conf.retention_period:
- 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]
+ dropped = self.drop_obsolete_partitions (self.dest_table, self.conf.retention_period, self.conf.period)
+ if self.conf.ignore_old_events and dropped:
+ for tbl in dropped:
+ self.ignored_tables.add(tbl)
+ if tbl in self.row_handler.table_map:
+ del self.row_handler.table_map[tbl]
def drop_obsolete_partitions (self, parent_table, retention_period, partition_period):
""" Drop obsolete partitions of partition-by-date parent table.
@@ -930,6 +931,7 @@ class Dispatcher (ShardHandler):
res.append(row[0])
if res:
self.log.info("Dropped tables: %s", ", ".join(res))
+ return res
def get_copy_condition(self, src_curs, dst_curs):
""" Prepare where condition for copy and replay filtering.
diff --git a/python/londiste/setup.py b/python/londiste/setup.py
index 1ce79598..055be922 100644
--- a/python/londiste/setup.py
+++ b/python/londiste/setup.py
@@ -45,7 +45,7 @@ class LondisteSetup(CascadeAdmin):
londiste.handler.load_handler_modules(self.cf)
def init_optparse(self, parser=None):
- """Add londiste switches to cascadeadmin ones."""
+ """Add londiste switches to CascadeAdmin ones."""
p = CascadeAdmin.init_optparse(self, parser)
p.add_option("--expect-sync", action="store_true", dest="expect_sync",