使用Xtrabackup遇到以下错误:
191121 07:00:48 Waiting for query 81858758 (duration 2958 sec)
191121 07:00:49 Unable to obtain lock. Please try again later.
这个错误主要跟innobackupex的ftwrl-wait-timeout有关,因为在备份脚本中设置了ftwrl-wait-timeout=180
,备份失败是因为等待慢查询query 81858758超过了180秒,而自动退出。
那么ftwrl-wait-timeout这个参数到底是什么意思呢?看下官方的解释:
--ftwrl-wait-timeout=#
This option specifies time in seconds that innobackupex
should wait for queries that would block FTWRL before
running it. If there are still such queries when the
timeout expires, innobackupex terminates with an error.
Default is 0, in which case innobackupex does not wait
for queries to complete and starts FTWRL immediately.
刚开始看的时候有点一头雾水,有点混淆的感觉。是因为一直以为flush table with read lock是在备份no