Table tempfambal breaks circular replication

For complex topics that regular users would not be interested in. For power users and database administrators.
Post Reply
mimai
Posts: 24
Joined: Wed Aug 01, 2007 3:01 am

Table tempfambal breaks circular replication

Post by mimai » Tue Nov 13, 2007 3:40 pm

Table tempfambal breaks circular replication with the following error in mysqld.log:
071112 9:21:05 [ERROR] Slave: Error 'Table 'tempfambal' already exists' on query. Default database: 'opendental'. Query: 'CREATE TABLE tempfambal(
FamBalNum int NOT NULL auto_increment,
PatNum int NOT NULL,
ProvNum int NOT NULL,
AmtBal double NOT NULL,
PRIMARY KEY (FamBalNum))', Error_code: 1050

Should the table tempfambal be deleted after use? Bug?
I am running version 5.2.14.

User avatar
jordansparks
Site Admin
Posts: 5742
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Post by jordansparks » Wed Nov 14, 2007 9:48 am

Yes, it should be deleted after use. It is becoming more and more common for us to use temporary tables, and sometimes those tables don't get deleted if we don't specifically add it to the query. I didn't think about it breaking your replication. I did add a delete clause in a recent version (not sure which version). I'm going to have to think of a reliable way to get rid of temporary tables. How much of a problem did it create for you? In other words, how much time and hassle does it cause you if a temporary table does cause replication to fail?
Jordan Sparks, DMD
http://www.opendental.com

mimai
Posts: 24
Joined: Wed Aug 01, 2007 3:01 am

Post by mimai » Wed Nov 14, 2007 9:15 pm

I had to look to the log files to see which slave was stopped. Then, I used the global skip-counter / slave start statements until slave is running again (it skipped creating the tempfambal table and 3 records of that table). Now knowing that the table can be deleted, I can simply drop the table and restart the slave, and everything should be perfectly synchronized again, is that right?

Doing the first method may have caused the second database to be different from the first. I may have to copy the first database to the second site and start circular replication over again. Copy the whole database over vpn costs about 1 hour (we have large database) and redo circular replication 5 min. I have not done it yet. Is the output of whatever queries that used tempfambal confined to one table and therefore I can just copy one table over?

Post Reply