(self, t1, t2, lock_db, src_db, dst_db, setup_db)
Get transaction to same state, then process.
Get transaction to same state, then process.
Get transaction to same state then process .
def check_table(self, t1, t2, lock_db, src_db, dst_db, setup_db):
        """Get transaction to same state, then process."""

        src_tbl = t1.dest_table
        dst_tbl = t2.dest_table

        lock_curs = lock_db.cursor()
        src_curs = src_db.cursor()
        dst_curs = dst_db.cursor()

        if not skytools.exists_table(src_curs, src_tbl):
            self.log.warning("Table %s does not exist on provider side", src_tbl)
            return
        if not skytools.exists_table(dst_curs, dst_tbl):
            self.log.warning("Table %s does not exist on subscriber side", dst_tbl)
            return

        # lock table against changes
        try:
            if self.provider_info['node_type'] == 'root':
                self.lock_table_root(lock_db, setup_db, dst_db, src_tbl, dst_tbl)
            else:
                self.lock_table_branch(lock_db, setup_db, dst_db, src_tbl, dst_tbl)

            # take snapshot on provider side
            src_db.commit()
            src_curs.execute("SELECT 1")

            # take snapshot on subscriber side
            dst_db.commit()
            dst_curs.execute("SELECT 1")
        finally:
            # release lock
            if self.provider_info['node_type'] == 'root':
                self.unlock_table_root(lock_db, setup_db)
            else:
                self.unlock_table_branch(lock_db, setup_db)

        # do work
        bad = self.process_sync(t1, t2, src_db, dst_db)
        if bad:
            self.bad_tables += 1

        # done
        src_db.commit()
        dst_db.commit()
def check_table ( self , t1 , t2 , lock_db , src_db , dst_db , setup_db ) : src_tbl = t1 . dest_table dst_tbl = t2 . dest_table lock_curs = lock_db . cursor ( ) src_curs = src_db . cursor ( ) dst_curs = dst_db . cursor ( ) if not skytools . exists_table ( src_curs , src_tbl ) : self . log . warning ( "Table %s does not exist on provider side" , src_tbl ) return if not skytools . exists_table ( dst_curs , dst_tbl ) : self . log . warning ( "Table %s does not exist on subscriber side" , dst_tbl ) return # lock table against changes try : if self . provider_info [ 'node_type' ] == 'root' : self . lock_table_root ( lock_db , setup_db , dst_db , src_tbl , dst_tbl ) else : self . lock_table_branch ( lock_db , setup_db , dst_db , src_tbl , dst_tbl ) # take snapshot on provider side src_db . commit ( ) src_curs . execute ( "SELECT 1" ) # take snapshot on subscriber side dst_db . commit ( ) dst_curs . execute ( "SELECT 1" ) finally : # release lock if self . provider_info [ 'node_type' ] == 'root' : self . unlock_table_root ( lock_db , setup_db ) else : self . unlock_table_branch ( lock_db , setup_db ) # do work bad = self . process_sync ( t1 , t2 , src_db , dst_db ) if bad : self . bad_tables += 1 # done src_db . commit ( ) dst_db . commit ( )