I have a simple master/slave setup involving two 4.1.12-Debian_1ubuntu3.1-log MySQL servers on Linux. The master server crashed a few weeks ago. Today I discovered that the slave had not recovered gracefully in terms of restarting replication. Here is the current slave status:
Slave_IO_State:
Master_Host: cutler
Master_User: repl
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000150
Read_Master_Log_Pos: 28562706
Relay_Log_File: quorles-relay-bin.000112
Relay_Log_Pos: 4
Relay_Master_Log_File: mysql-bin.000150
Slave_IO_Running: No
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 28562706
Relay_Log_Space: 4
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: NULL
And here is the I/O thread in the processlist on the slave:
Command: Connect
Time: 1752954
State: Has read all relay log; waiting for the slave I/O thread to update it
Info: NULL
And here is the master status:
+------------------+----------+--------------+------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+--------------+------------------+
| mysql-bin.000187 | 47501478 | | |
+------------------+----------+--------------+------------------+
Based on this excerpt from the docs
http://dev.mysql.com/doc/refman/4.1/en/replication-features.html: "A crash on the master side can result in the master's binary log having a final position less than the most recent position read by the slave, due to the master's binary log file not being flushed. This can cause the slave not to be able to replicate when the master comes back up."
Is my only recourse to completely rebuild the slave? Or is there some way that I'm not seeing that I can just restart the slave somehow and allow it to catch up?
--
Thomas F. O'Connell
Database Architecture and Programming
Sitening
http://www.sitening.com/
3004B Poston Avenue
Nashville, TN 37203-1314
615-469-5150