summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Kreen2011-11-18 09:55:24 +0000
committerMarko Kreen2011-11-18 09:55:24 +0000
commit872278a277ef0c3cca2e6c72baf624daaa9774c0 (patch)
treed2c8bdb69436098f3de6cbbeb3b980e3c1bc5a9b
parent426b335aac871ffd1d668195f4ffad808b838f45 (diff)
londiste copy: fast exit if table is removed
Old code crashed, which sucks. It can leave constraints/fkeys unapplied, but its to complex to restore here. Better let the trigger-happy admins clean after themselves.
-rw-r--r--python/londiste/table_copy.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/python/londiste/table_copy.py b/python/londiste/table_copy.py
index 5f0f8bc5..6ba0612e 100644
--- a/python/londiste/table_copy.py
+++ b/python/londiste/table_copy.py
@@ -45,6 +45,9 @@ class CopyTable(Replicator):
def reload_table_stat(self, dst_curs, tblname):
self.load_table_state(dst_curs)
+ if tblname not in self.table_map:
+ self.log.warning('Table %s removed from replication', tblname)
+ sys.exit(1)
t = self.table_map[tblname]
return t