mysql5.6版本,centos7环境,通过xtrabackup全备加应用后续binlog日志还原mysql库,全备还原很顺利,binlog日志用mysqlsqlbinlog转换成sql脚本source执行,3G大的sql脚本跑了6个小时还没结束,执行过程非常缓慢,查看进程经常出现system lock状态,请教各位大神问题出现的可能原因。
sql数量很多,建议先看看iostat,是不是IO真的吃不消了
评论
有用 0为啥要先转成sql脚本呢?
可以试试直接恢复~
评论
有用 0昨晚自己跑了8个小时终于恢复完了,恢复时看过iostat并不高,以为是开了event_scheduler的原因造成system lock,但是关闭之后重新跑sql还是报这个问题,总之谢谢各位专家
评论
有用 0出现system lock很正常,只要有表级锁就会出现,这跟你日志中执行的SQL内容有直接关系,在应用日志时这种信息很常见,通常都是很快的过去了,有的很快就没了,有的很长,你去从库看,通常在复制的时候show slave status结果 这种system lock也很多。
官方文档对system lock说的也不是很详细:
The thread has called mysql_lock_tables() and the thread state has not been updated since. This is a very general state that can occur for many reasons.
For example, the thread is going to request or is waiting for an internal or external system lock for the table. This can occur when InnoDB waits for a table-level lock during execution of LOCK TABLES. If this state is being caused by requests for external locks and you are not using multiple mysqld servers that are accessing the same MyISAM tables, you can disable external system locks with the --skip-external-locking option. However, external locking is disabled by default, so it is likely that this option will have no effect. For SHOW PROFILE, this state means the thread is requesting the lock (not waiting for it).
评论
有用 0
墨值悬赏

