当前位置:网站首页>Xtrabackup appears' flush no '_ WRITE_ TO_ BINLOG TABLES‘: 1205 (HY000) Lock wait timeout exceeded;
Xtrabackup appears' flush no '_ WRITE_ TO_ BINLOG TABLES‘: 1205 (HY000) Lock wait timeout exceeded;
2022-07-26 08:35:00 【YaoYuan ace】
xtrabackup Backup MySQL when , You may fail to get the lock and timeout , Here is the solution .
List of articles
The phenomenon
xtrabackup Backup MySQL The database has a timeout error :
Error: failed to execute query 'FLUSH NO_WRITE_TO_BINLOG TABLES': 1205 (HY000) Lock wait timeout exceeded; try restarting transaction
...
Error: failed to execute query 'FLUSH NO_WRITE_TO_BINLOG TABLES': 1205 (HY000) Lock wait timeout exceeded; try restarting transaction
resolvent
There are two solutions , One is modification xtrabackup Parameters of , The other is to kill threads that execute for a long time .
Kill long SQL The thread of :
Query threads with long execution time :
mysql> select * from processlist where command not like 'Sleep' order by time desc limit 3;
+-----+-----------------+-----------+--------+---------+--------+-------------------------+-----------------------------------------------+
| ID | USER | HOST | DB | COMMAND | TIME | STATE | INFO |
+-----+-----------------+-----------+--------+---------+--------+-------------------------+-----------------------------------------------+
| 5 | event_scheduler | localhost | NULL | Daemon | 432662 | Waiting on empty queue | NULL |
| 132 | root | localhost | sakila | Query | 632 | User sleep | select * from actor where actor_id=sleep(100) |
| 131 | root | localhost | NULL | Query | 628 | Waiting for table flush | flush table with read lock |
+-----+-----------------+-----------+--------+---------+--------+-------------------------+-----------------------------------------------+
3 rows in set (0.00 sec)
mysql>
mysql> kill 132;
Query OK, 0 rows affected (0.00 sec)
It can also be in sys.processlist、INFORMATION_SCHEMA.PROCESSLIST perhaps performance_schema.threads Found in it for a long time SQL, Just kill them .
modify xtrabackup Parameters of
For long execution time SQL, It can also be solved by modifying relevant parameters :
- Use –ftwrl-wait-* Series parameters , It means ready for execution FLUSH TABLES WITH READ LOCK When encountering a long wait SQL Wait for the set time while executing the statement , Timeout has not been completed , Backup exit announced failure .
- Use –kill-long-query-* Series parameters , It means to encounter a long wait SQL Statement execution time , Overtime is kill Off execution SQL sentence , And you can set SQL Type defaults to all .
- Use –safe-slave-backup-* Series parameters , It means backing up from the Library , Stop the backup first slave sql Threads , Prevent excessive length SQL Statement execution , Start after backup slave sql Threads .
At the bottom of the article is my wechat , Welcome to join me ( toeic 890 Points of Oracle ACE).
边栏推荐
- Mysql8 dual master and dual slave +mycat2 read / write separation
- Flutter upgrade 2.10
- mysql函数汇总之条件判断函数
- Apple's tough new rule: third-party payment also requires a percentage, and developers lose a lot!
- Flutter distribution
- [endnote] detailed explanation of document template layout syntax
- 【EndNote】文献模板编排语法详解
- Shell programming
- Common Oracle functions
- 23.2 customizing the banner control display hidden banner modify banner
猜你喜欢
[time complexity, space complexity]
Maximum common substring & regularity problem
六、品达通用权限系统__pd-tools-log
Kotlin variables and constants
matplotlib学习笔记
BGP routing principle
22-07-16 personal training match 3 competition experience
基于C语言的内存管理-动态分区分配方式模拟
C # get the information of the selected file
NLP (natural language processing) natural language processing learning
随机推荐
Date and time function of MySQL function summary
Super nice navigation page (static page)
Memory management based on C language - Simulation of dynamic partition allocation
BGP routing principle
Common Oracle functions
内存管理-动态分区分配方式模拟
Spark persistence strategy_ Cache optimization
【EndNote】文献模板编排语法详解
mysql函数汇总之日期和时间函数
Kotlin program control
Add in the registry right click to open in vscode
Error handling response: Error: Syntax error, unrecognized expression: .c-container /deep/ .c-contai
第三天作业
Fluent custom popupmenubutton
CV learning notes (optical flow)
基于C#实现的文件管理文件系统
Flex three column layout
On some concepts involved in journal papers compilation + journal query methods
Code cloud change remote warehouse command
File management file system based on C #