1、此状态表示大量thread正在等待慢查询语句执行完成。

原因:

The thread got a notification that the underlying structure for a table has changed
and it needs to reopen the table to get the new structure.
However, to reopen the table,
it must wait until all other threads have closed the table in question.
This notification takes place if another thread has used FLUSH TABLES
or one of the following statements on the table in question:
FLUSH TABLES tbl_name, ALTER TABLE, RENAME TABLE, REPAIR TABLE, ANALYZE TABLE, orOPTIMIZE TABLE.

翻译

主要是因为有慢查询正在进行的时候 ,执行了类似于flush tables的操作。导致flush tables 阻塞,致使后续查询收到表变更通知,需要等待重新打开表。

即使这个时候停止flush tables操作也不会马上恢复,这些大量的Waiting for table flush 线程会等到之前的慢查询终止才会执行。

2、易引发这种情况的操作

慢查询+FLUSH TABLES tbl_name, ALTER TABLE, RENAME TABLE, REPAIR TABLE, ANALYZE TABLE, orOPTIMIZE TABLE  这些操作。

例如:比如在mysqldump、innobackupex进行备份时就很有可能引发这种情况。

3、解决方案

找出慢查询kill掉,并进行SQL优化防止再次引发。

4、预防措施

在业务高峰期不要对数据库进行FLUSH TABLES tbl_name, ALTER TABLE, RENAME TABLE, REPAIR TABLE, ANALYZE TABLE, orOPTIMIZE TABLE 这些操作。

备份、DDL语句等操作尽量避开业务高峰。

复制来源:https://blog.csdn.net/donghaixiaolongwang/article/details/76099697

最新文章

  1. 《玩转D语言系列》一、通过四个版本的 Hello Word 初识D语言
  2. codeforces 484C Strange Sorting Codeforces Round #276 (Div. 1) C
  3. 想让你的java代码更漂亮,用枚举吧
  4. 微软分布式云计算框架Orleans(1):Hello World
  5. c语言多线程队列读写
  6. directX学习系列8 颜色融合(转)
  7. MVC字符串处理及MVC @RenderSection小计
  8. WebSphere 集群环境下配置 Quartz集群
  9. iOS新上线注意事项
  10. progressbar样式
  11. Spring简单的文件配置
  12. Sublime Text 2安装图解
  13. AngualrJS之自定义指令
  14. PAT 1140 Look-and-say Sequence
  15. Go Example--状态协程
  16. 【iCore4 双核心板_FPGA】例程十四:基于I2C的ARM与FPGA通信实验
  17. Spark项目之电商用户行为分析大数据平台之(十一)JSON及FASTJSON
  18. dedecms在linux上安装提示没权限解决办法
  19. 帕累托分布(Pareto distributions)、马太效应
  20. BZOJ 1283: 序列

热门文章

  1. Shell-03
  2. js解决手机键盘影响定位的问题
  3. [luogu]P2279 [HNOI2003]消防局的设立[贪心]
  4. WPF Microsoft.Practices.Unity 注入大法简单示例
  5. C++ 对象间通信框架 V2.0 ××××××× 之(二)
  6. [BZOJ1478&1488&1815][SGU282]Isomorphism:Polya定理
  7. Spring Cloud架构教程 (五)服务网关(过滤器)
  8. Spring MVC Captcha 验证码
  9. malloc(50) 内存泄露 内存溢出 memory leak会最终会导致out of memory
  10. redux源码浅入浅出