mysqlreplicationmysql-5.1

Can't explian MySql Errors after moving log directory


I have a Master - Slave setup with MySql v5.1.39 running ~10 db's on 12 core Linux machine. I had to move the bin-log files to a separate disk for performance issues. So I followed these steps:

First problem! on the slave:

150113 12:21:22 [ERROR] Got fatal error 1236: 'Could not find first log file name in binary log index file' from master when reading data from binary log 150113 12:21:22 [Note] Slave I/O thread exiting, read up to log 'bin-log.005523', position 716864371

Now a quick Google didn't resolve anything and since downtime is an issue. I stopped the Master, changed the configuration back and restarted. Now the second "problem"!

... 150113 13:02:22 InnoDB: Error: page 182380 log sequence number 3407 300161079 InnoDB: is in the future! Current system log sequence number 3407 299353326. InnoDB: Your database may be corrupt or you may have copied the InnoDB InnoDB: tablespace but not the InnoDB log files. See InnoDB: http://dev.mysql.com/doc/refman/5.1/en/forcing-recovery.html InnoDB: for more information. ...

I quote problem because everything works fine. Replication to the slave restarted and worked. I started the applications and those work fine. But when start MySql on the Master, I get the errors above, about 50 of them with different page- and sequence numbers.

How does moving files affect page- and sequence numbers and where do they come from? How big is my problem? everything seems to work fine.

Please ask if you need anymore information and thanks for your help.


Solution

  • First problem was caused by the file /mysql/log/bin-log.index. I forgot to change the contents of this file to point to the new directory of the log files: /mysql/log/bin-log.000028 -> /mysql/newlog/bin-log.000028 /mysql/log/bin-log.000029 -> /mysql/newlog/bin-log.000029 /mysql/log/bin-log.000030 -> /mysql/newlog/bin-log.000030 /mysql/log/bin-log.000031 -> /mysql/newlog/bin-log.000031

    The second problem was caused by the timestamps of some files. I should have preserved the timestamps with cp -p log/* newlog/. or rsync -avrx log/* newlog/..