summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorMarko Kreen2009-06-04 13:18:03 +0000
committerMarko Kreen2009-06-07 14:57:36 +0000
commitc8b2d68fcd66a94ec748ece7d280d76e5238e752 (patch)
treea2939f3e983f720d24cc2f69796552eaaf5f9034 /python
parent93e7631ac20edd0dcd59f51456c605bd66f1f3d8 (diff)
londiste: replace skip_trunc columns with table attrs
this allows to store more extra data and avoid table struct change for each item. only items that the SQL code does not need to care about can be stored that way.
Diffstat (limited to 'python')
-rw-r--r--python/londiste/playback.py9
-rw-r--r--python/londiste/table_copy.py2
2 files changed, 7 insertions, 4 deletions
diff --git a/python/londiste/playback.py b/python/londiste/playback.py
index d9db6fd1..ea55975a 100644
--- a/python/londiste/playback.py
+++ b/python/londiste/playback.py
@@ -66,7 +66,7 @@ class TableState(object):
self.sync_tick_id = None
self.ok_batch_count = 0
self.last_tick = 0
- self.skip_truncate = False
+ self.table_attrs = {}
self.copy_role = None
self.dropped_ddl = None
# except this
@@ -81,7 +81,7 @@ class TableState(object):
self.sync_tick_id = None
self.ok_batch_count = 0
self.last_tick = 0
- self.skip_truncate = False
+ self.table_attrs = {}
self.changed = 1
def change_snapshot(self, str_snapshot, tag_changed = 1):
@@ -162,7 +162,10 @@ class TableState(object):
self.change_snapshot(row['custom_snapshot'], 0)
self.state = self.parse_state(row['merge_state'])
self.changed = 0
- self.skip_truncate = row['skip_truncate']
+ if row['table_attrs']:
+ self.table_attrs = skytools.db_urldecode(row['table_attrs'])
+ else:
+ self.table_attrs = {}
self.copy_role = row['copy_role']
self.dropped_ddl = row['dropped_ddl']
if row['merge_state'] == "?":
diff --git a/python/londiste/table_copy.py b/python/londiste/table_copy.py
index d90e00ae..75d92f56 100644
--- a/python/londiste/table_copy.py
+++ b/python/londiste/table_copy.py
@@ -121,7 +121,7 @@ class CopyTable(Replicator):
dst_struct.drop(dst_curs, objs, log = self.log)
# drop data
- if tbl_stat.skip_truncate:
+ if tbl_stat.table_attrs.get('skip_truncate'):
self.log.info("%s: skipping truncate" % tbl_stat.name)
else:
self.log.info("%s: truncating" % tbl_stat.name)