londiste replay: skip provider checks if copy_node is used
authorMarko Kreen <markokr@gmail.com>
Fri, 6 Jul 2012 11:23:32 +0000 (14:23 +0300)
committerMarko Kreen <markokr@gmail.com>
Fri, 6 Jul 2012 11:23:32 +0000 (14:23 +0300)
Because the table does not need to exist on current provider then.

Perhaps it would be safer to go and check this new node,
but copy can wait for good state on its own too.

python/londiste/playback.py

index 6742f02d2c7cd9dc4b718cd629041a606f0655fe..328286d6f98fe15d7a82814363a4b9e35c73ceff 100644 (file)
@@ -473,13 +473,18 @@ class Replicator(CascadedWorker):
             pmap = self.get_state_map(src_db.cursor())
             src_db.commit()
             for t in self.get_tables_in_state(TABLE_MISSING):
-                if t.name not in pmap:
-                    self.log.warning("Table %s not available on provider" % t.name)
-                    continue
-                pt = pmap[t.name]
-                if pt.state != TABLE_OK: # or pt.custom_snapshot: # FIXME: does snapsnot matter?
-                    self.log.info("Table %s not OK on provider, waiting" % t.name)
-                    continue
+                if 'copy_node' in t.table_attrs:
+                    # should we go and check this node?
+                    pass
+                else:
+                    # regular provider is used
+                    if t.name not in pmap:
+                        self.log.warning("Table %s not available on provider" % t.name)
+                        continue
+                    pt = pmap[t.name]
+                    if pt.state != TABLE_OK: # or pt.custom_snapshot: # FIXME: does snapsnot matter?
+                        self.log.info("Table %s not OK on provider, waiting" % t.name)
+                        continue
 
                 # dont allow more copies than configured
                 if npossible == 0: