記一次Mysql 數據庫遷移後報錯問題

現象說明:老數據庫版本是5.6,新庫版本5.7,數據量不大,備份恢復數據均正常,配置主從使用gtid複製後也是正常的,次日查看新庫的時候,發現新庫複製出現問題,報錯以下:數據庫

2019-10-10T10:15:27.541697+08:00 4256 [Warning] Master server does not support semi-sync, fallback to asynchronous replication
2019-10-10T10:15:29.993985+08:00 4257 [ERROR] Transaction is tagged with inconsistent logical timestamps: sequence_number (3546074770274598260) <= last_committed (8314045271803935669)
2019-10-10T10:15:29.994028+08:00 4257 [Warning] Slave SQL for channel '': Coordinator thread of multi-threaded slave is being stopped in the middle of assigning a group of events; deferring to exit until the group completion ... , Error_code: 0
2019-10-10T10:15:29.994052+08:00 4257 [ERROR] Slave SQL for channel '': Cannot execute the current event group in the parallel mode. Encountered event Gtid, relay-log name ./relay.000002, position 1090573 which prevents execution of this event group in parallel mode. Reason: The master event is logically timestamped incorrectly.. Error_code: 1755
2019-10-10T10:15:29.994066+08:00 4257 [Warning] Slave: Cannot execute the current event group in the parallel mode. Encountered event Gtid, relay-log name ./relay.000002, position 1090573 which prevents execution of this event group in parallel mode. Reason: The master event is logically timestamped incorrectly.. Error_code: 1755
2019-10-10T10:15:29.994070+08:00 4257 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'logbin.000015' position 234960156
2019-10-10T10:16:01.494097+08:00 4256 [Note] Slave I/O thread killed while reading event for channel ''async

查看數據庫的變量參數 slave_parallel_workers ,發現老庫的是0,串行復制,新庫的是4,並行組複製,根據網上查到的內容,也是因爲這個參數致使
修復方法:修改新庫的slave_parallel_workers 參數爲0,清理數據庫,清理binlog 日誌,恢復數據,重建主從關係,主從複製OKide

相關文章
相關標籤/搜索