diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/londiste/playback.py | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/python/londiste/playback.py b/python/londiste/playback.py index 1c60c97b..73b6d298 100644 --- a/python/londiste/playback.py +++ b/python/londiste/playback.py @@ -201,10 +201,12 @@ class TableState(object): return self.max_parallel_copy and\ self.copy_pos >= self.max_parallel_copy - def interesting(self, ev, tick_id, copy_thread): + def interesting(self, ev, tick_id, copy_thread, copy_table_name): """Check if table wants this event.""" if copy_thread: + if self.name != copy_table_name: + return False if self.state not in (TABLE_CATCHING_UP, TABLE_DO_SYNC): return False else: @@ -651,7 +653,7 @@ class Replicator(CascadedWorker): def handle_data_event(self, ev, dst_curs): """handle one truncate event""" t = self.get_table_by_name(ev.extra1) - if not t or not t.interesting(ev, self.cur_tick, self.copy_thread): + if not t or not t.interesting(ev, self.cur_tick, self.copy_thread, self.copy_table_name): self.stat_increase('ignored_events') return @@ -667,7 +669,7 @@ class Replicator(CascadedWorker): def handle_truncate_event(self, ev, dst_curs): """handle one truncate event""" t = self.get_table_by_name(ev.extra1) - if not t or not t.interesting(ev, self.cur_tick, self.copy_thread): + if not t or not t.interesting(ev, self.cur_tick, self.copy_thread, self.copy_table_name): self.stat_increase('ignored_events') return @@ -754,17 +756,6 @@ class Replicator(CascadedWorker): dst_curs.execute(buf) - def interesting(self, ev): - """See if event is interesting.""" - if ev.type not in ('I', 'U', 'D', 'R'): - raise Exception('bug - bad event type in .interesting') - t = self.get_table_by_name(ev.extra1) - if not t: - return 0 - if not t.interesting(ev, self.cur_tick, self.copy_thread): - return 0 - return 1 - def add_set_table(self, dst_curs, tbl): """There was new table added to root, remember it.""" |
