Why would my MySQL replica server experience an sql integrity constraint error after losing connection and attempting to start again?
2
votes
0
answers
55
views
I have a master-master replication setup between two different servers using MariaDB. One is the primary server (server A) that is connected to my web applications, and the other is a replica that would be used for disaster recovery if the primary one was down (server B). Awhile back I shut down server B rather abruptly for about 5 minutes so that I could resize it, but when I brought it back up, I received an SQL integrity constraint violation error that prevented replication from starting back up.
I ended up rebuilding server B from a backup of server A later down the road and started replication back up successfully.
My question is: Why would this connection issue have caused an integrity constraint error? I thought that it would be able to simply pick up from the log file position that it stopped reading from. I’m trying to figure out so that, in the future, if server B loses connection for whatever reason, that I’m able to recover from it instead of having to rebuild the database.
Asked by Timothy Fisher
(177 rep)
Feb 27, 2022, 06:07 AM
Last activity: Mar 3, 2022, 04:18 PM
Last activity: Mar 3, 2022, 04:18 PM