当前位置:网站首页>Who says that PT online schema change does not lock the table, or deadlock
Who says that PT online schema change does not lock the table, or deadlock
2022-07-06 12:11:00 【wx5caecf2ed0645】
background : Online one 3000W Your table needs to be added , Table has 20G size .
evening 11 Start at pt-online-schema-change Add fields
pt-online-schema-change -h $IP -u $user -p $password -P $PORT --alter="$STATEMENT" --charset=utf8 --no-check-replication-filters --execute D=$DATABASE,t=$TABLE
Into the morning 12 The increase is completed around halfpastten , But a deadlock message was reported .
LATEST DETECTED DEADLOCK
------------------------
180125 0:08:28
*** (1) TRANSACTION:
TRANSACTION C591765D9, ACTIVE 0 sec setting auto-inc lock
mysql tables in use 2, locked 2
LOCK WAIT 4 lock struct(s), heap size 1248, 1 row lock(s), undo log entries 2
MySQL thread id 35165134485, query id 636648490142 10.47.132.26 zhs_writer update
REPLACE INTO `DB`.`_Table_new` (`user_id`, `username`, `password`, `mobile`, `kid`, `maintype`, `subtype`, `user_type`, `enabled`, `device_uuid`, `register_time`, `first_login_time`, `last_login_time`, `sandbox`, `origin`, `is_biz`, `uid`, `is_del`) VALUES (NEW.`user_id`, NEW.`username`, NEW.`password`, NEW.`mobile`, NEW.`kid`, NEW.`maintype`, NEW.`subtype`, NEW.`user_type`, NEW.`enabled`, NEW.`device_uuid`, NEW.`register_time`, NEW.`first_login_time`, NEW.`last_login_time`, NEW.`sandbox`, NEW.`origin`, NEW.`is_biz`, NEW.`uid`, NEW.`is_del`)
*** (1) WAITING FOR THIS LOCK TO BE GRANTED:
TABLE LOCK table `DB`.`_Table_new` trx id C591765D9 lock mode AUTO-INC waiting
*** (2) TRANSACTION:
TRANSACTION C591765D3, ACTIVE 0 sec fetching rows, thread declared inside InnoDB 499
mysql tables in use 2, locked 2
46 lock struct(s), heap size 6960, 2483 row lock(s), undo log entries 2418
MySQL thread id 35165133950, query id 636648489679 10.47.109.162 dba_account Sending data
INSERT LOW_PRIORITY IGNORE INTO `DB`.`_Table_new` (`user_id`, `username`, `password`, `mobile`, `kid`, `maintype`, `subtype`, `user_type`, `enabled`, `device_uuid`, `register_time`, `first_login_time`, `last_login_time`, `sandbox`, `origin`, `is_biz`, `uid`, `is_del`) SELECT `user_id`, `username`, `password`, `mobile`, `kid`, `maintype`, `subtype`, `user_type`, `enabled`, `device_uuid`, `register_time`, `first_login_time`, `last_login_time`, `sandbox`, `origin`, `is_biz`, `uid`, `is_del` FROM `DB`.`Table` FORCE INDEX(`PRIMARY`) WHERE ((`user_id` >= '224531025')) AND ((`user_id` <= '224534530')) LOCK IN SHARE MODE /*pt-online-schema-change 15213 copy nibble*/
*** (2) HOLDS THE LOCK(S):
TABLE LOCK table `DB`.`_Table_new` trx id C591765D3 lock mode AUTO-INC
*** (2) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 2689 page no 723971 n bits 144 index `PRIMARY` of table `DB`.`Table` trx id C591765D3 lock mode S waiting
Record lock, heap no 47 PHYSICAL RECORD: n_fields 20; compact format; info bits 0
0: len 4; hex 0d621bd6; asc b ;;
1: len 6; hex 000c591765d9; asc Y e ;;
2: len 7; hex 16000f00160bae; asc ;;
3: len 11; hex 3133363530323230393635; asc 13650220965;;
4: len 30; hex 663762363936323535643939653338306338623733623231303336643838; asc f7b696255d99e380c8b73b21036d88; (total 32 bytes);
5: len 11; hex 3133363530323230393635; asc 13650220965;;
6: len 0; hex ; asc ;;
7: len 1; hex 01; asc ;;
8: len 1; hex 80; asc ;;
9: len 1; hex 82; asc ;;
10: len 1; hex 01; asc ;;
11: len 16; hex 32363838313062346264633836303639; asc 268810b4bdc86069;;
12: len 8; hex 800012586de60fae; asc Xm ;;
13: len 8; hex 800012586de62386; asc Xm # ;;
14: len 8; hex 8000125a8d2ea47c; asc Z . |;;
15: len 1; hex 80; asc ;;
16: len 8; hex 77656978696e7971; asc weixinyq;;
17: len 1; hex 80; asc ;;
18: len 8; hex 8000000000000000; asc ;;
19: len 1; hex 80; asc ;;
*** WE ROLL BACK TRANSACTION (1)
When pt Three triggers are created when adding fields When inserting new table data, you add S lock When the program needs to update this data, it needs to add a X lock There's a deadlock
terms of settlement : Reduce the granularity of data from old table to new table ( To be continued )
边栏推荐
- inline详细讲解【C语言】
- arduino JSON数据信息解析
- Basic operations of databases and tables ----- creating data tables
- vim命令行笔记
- The first simple case of GNN: Cora classification
- Cannot change version of project facet Dynamic Web Module to 2.3.
- Understanding of AMBA, AHB, APB and Axi
- Implementation scheme of distributed transaction
- Use of lists
- RT-Thread 线程的时间片轮询调度
猜你喜欢
RT-Thread 线程的时间片轮询调度
Pat 1097 duplication on a linked list (25 points)
Detailed explanation of Union [C language]
MySQL占用内存过大解决方案
JS object and event learning notes
ES6语法总结--下篇(进阶篇 ES6~ES11)
R & D thinking 01 ----- classic of embedded intelligent product development process
Variable star user module
C language callback function [C language]
level16
随机推荐
电商数据分析--薪资预测(线性回归)
Amba, ahb, APB, Axi Understanding
Imgcat usage experience
Variable star user module
vim命令行笔记
OPPO VOOC快充电路和协议
Priority inversion and deadlock
【ESP32学习-1】Arduino ESP32开发环境搭建
arduino获取数组的长度
inline详细讲解【C语言】
js题目:输入数组,最大的与第一个元素交换,最小的与最后一个元素交换,输出数组。
ES6 grammar summary -- Part 2 (advanced part es6~es11)
STM32 how to locate the code segment that causes hard fault
优先级反转与死锁
arduino JSON数据信息解析
RT thread API reference manual
Inline detailed explanation [C language]
PyTorch四种常用优化器测试
小天才电话手表 Z3工作原理
Comparison of solutions of Qualcomm & MTK & Kirin mobile platform USB3.0