当前位置:网站首页>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).
边栏推荐
猜你喜欢

基于Raft共识协议的KV数据库

日常一记(11)--word公式输入任意矩阵

Memory management based on C language - Simulation of dynamic partition allocation

Lesson 3: gcc compiler

关于期刊论文所涉及的一些概念汇编+期刊查询方法

22-07-12 personal training match 1 competition experience

Kotlin variables and constants

内存管理-动态分区分配方式模拟

Seq2seq and attention model learning notes

苹果强硬新规:用第三方支付也要抽成,开发者亏大了!
随机推荐
Prefix infix suffix expression (written conversion)
Daily Note (11) -- word formula input arbitrary matrix
为什么要在时钟输出上预留电容的工位?
[C language] programmer's basic skill method - "creation and destruction of function stack frames"
Use of room database in kotlin
A little awesome, 130000 a month+
22-07-16 personal training match 3 competition experience
Special lecture 2 dynamic planning learning experience (should be updated for a long time)
Dev gridcontrol captures key events
2022-024ARTS:最长有效括号
Please tell me if there is any way to increase the write out rate when the Flink SQL client is in the sink table. When synchronizing through sink table
Flitter imitates wechat long press pop-up copy recall paste collection and other custom customization
Flutter WebView jitter
【EndNote】文献模板编排语法详解
B title: razlika priority queue approach
File management file system based on C #
If Yi Lijing spits about programmers
Kotlin variables and constants
QSS add resource file of QT
shell编程