Home > Database > Mysql Tutorial > body text

MySQL:同时设置innodb_force_recovery和innodb_purge_thread导致无限loop

WBOY
Release: 2016-06-07 17:10:27
Original
1168 people have browsed it

MySQL:同时设置innodb_force_recovery和innodb_purge_thread导致无限loop

版本:Percona5.5.18

设置参数:

innodb_force_recovery>=2

innodb_purge_thread = 1

观察alert.log,出现大量信息:

InnoDB: Waiting for the background threads to start

我们定位到相应的代码:

在srv_purge_thread里,会判断当前是否以recovery mode启动:

[html]

其中SRV_FORCE_NO_BACKGROUND值为2,,可以看看不同的恢复级别分别代表什么:

[cpp]

也就是说,当恢复级别大于等于2时,将会从while循环中break然后退出线程(os_thread_exit)

但在函数innobase_start_or_create_for_mysql里,由于设置innodb_purge_thread为1,因此这里会等待purge线程起来

[cpp]

FIX:

在创建purge线程前,同时判断recovery值,当>=2时,我们强制将innodb_purge_thread置为0,以防止无限Loop 

[cpp]

linux

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template