only main thread is allowed to restore fkeys
authorMarko Kreen <markokr@gmail.com>
Mon, 13 Aug 2007 21:37:23 +0000 (21:37 +0000)
committerMarko Kreen <markokr@gmail.com>
Mon, 13 Aug 2007 21:37:23 +0000 (21:37 +0000)
python/londiste/playback.py

index b703cd208298709891c80997c68ebeb635883773..b2f6d1b0c753174362799b2f7611701444f5e750 100644 (file)
@@ -284,7 +284,10 @@ class Replicator(pgq.SerialConsumer):
         self.sync_tables(dst_db)
 
         self.copy_snapshot_cleanup(dst_db)
-        self.restore_fkeys(dst_db)
+
+        # only main thread is allowed to restore fkeys
+        if not self.copy_thread:
+            self.restore_fkeys(dst_db)
 
         # now the actual event processing happens.
         # they must be done all in one tx in dst side