|
Hi Aleksey,
We are not able to reproduce it on staging/test because we do not have enough traffic to simulate live!
Also, what I see in the Live DB logs are warnings related to partition being full - "Versioned table `test`.`sample_table `: partition `p4` is full, add more HISTORY partitions". I am not sure, if its due to this it takes more time to swap and deadlocks itself.
In terms of traffic on DB WOPS is as attached! Let me know if you need specific information so that I can provide it for you.
Thanks!
|
|
Vivek, you did supply the query from the first transaction, but not from the second one. Can you supply full LATEST DETECTED DEADLOCK info as provided by SHOW engine innodb status?
Can you estimate the increase in deadlocks since System Versioning appeared?
|
|
Here is the latest one which has the second query and full logs! The deadlocks have significantly increased to now 15pc! and it seems to rise as and when the data is getting increased in the DB
--------------------------------------------------------------------------------------
LATEST DETECTED DEADLOCK
------------------------
2019-02-18 07:47:29 0x2b94a7b40700
-
-
- (1) TRANSACTION:
TRANSACTION 1945144252, ACTIVE 0 sec fetching rows
mysql tables in use 6, locked 6
LOCK WAIT 8 lock struct(s), heap size 1136, 3 row lock(s)
MySQL thread id 278004, OS thread handle 47923558876928, query id 517713740 172.XX.XX.XXX root Searching rows for update
update `sample_table` set `release_date`='2019-02-18',`changed_by_user_id`=null,`last_changed_at`=20190218074729 where `id`=825053
- (1) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 11244249 page no 83 n bits 208 index PRIMARY of table `ebs`.`sample_table` /* Partition `p0` */ trx id 1945144252 lock_mode X locks rec but not gap waiting
Record lock, heap no 108 PHYSICAL RECORD: n_fields 29; compact format; info bits 0
0: len 8; hex 00000000000c96dd; asc ;;
1: len 7; hex 5c69df52070190; asc \i R ;;
2: len 6; hex 000000000000; asc ;;
3: len 7; hex 80000000000000; asc ;;
4: len 8; hex 8000000000000000; asc ;;
5: SQL NULL;
6: SQL NULL;
7: len 4; hex 5c4912f9; asc \I ;;
8: len 1; hex 01; asc ;;
9: len 4; hex 00000f3d; asc =;;
10: len 4; hex 5c4912f9; asc \I ;;
11: SQL NULL;
12: SQL NULL;
13: SQL NULL;
14: SQL NULL;
15: SQL NULL;
16: len 8; hex 0000000000000000; asc ;;
17: SQL NULL;
18: len 8; hex 0000000000000000; asc ;;
19: SQL NULL;
20: SQL NULL;
21: SQL NULL;
22: SQL NULL;
23: SQL NULL;
24: SQL NULL;
25: len 7; hex 5c4912f90d6667; asc \I fg;;
26: len 17; hex 726f6f74403137322e33312e38322e3238; asc root@172.XX.XX.28;;
27: SQL NULL;
28: SQL NULL;
-
-
- (2) TRANSACTION:
TRANSACTION 1945144250, ACTIVE 0 sec fetching rows
mysql tables in use 6, locked 6
8 lock struct(s), heap size 1136, 32 row lock(s)
MySQL thread id 277999, OS thread handle 47917468747520, query id 517713730 172.XX.XX.XXX root Searching rows for update
update `sample_table` set `release_date`='2019-02-18',`changed_by_user_id`=null,`last_changed_at`=20190218074729 where `id`=825053
- (2) HOLDS THE LOCK(S):
RECORD LOCKS space id 11244249 page no 83 n bits 208 index PRIMARY of table `ebs`.`sample_table` /* Partition `p0` */ trx id 1945144250 lock_mode X locks rec but not gap
Record lock, heap no 108 PHYSICAL RECORD: n_fields 29; compact format; info bits 0
0: len 8; hex 00000000000c96dd; asc ;;
1: len 7; hex 5c69df52070190; asc \i R ;;
2: len 6; hex 000000000000; asc ;;
3: len 7; hex 80000000000000; asc ;;
4: len 8; hex 8000000000000000; asc ;;
5: SQL NULL;
6: SQL NULL;
7: len 4; hex 5c4912f9; asc \I ;;
8: len 1; hex 01; asc ;;
9: len 4; hex 00000f3d; asc =;;
10: len 4; hex 5c4912f9; asc \I ;;
11: SQL NULL;
12: SQL NULL;
13: SQL NULL;
14: SQL NULL;
15: SQL NULL;
16: len 8; hex 0000000000000000; asc ;;
17: SQL NULL;
18: len 8; hex 0000000000000000; asc ;;
19: SQL NULL;
20: SQL NULL;
21: SQL NULL;
22: SQL NULL;
23: SQL NULL;
24: SQL NULL;
25: len 7; hex 5c4912f90d6667; asc \I fg;;
26: len 17; hex 726f6f74403137322e33312e38322e3238; asc root@172.XX.XX.28;;
27: SQL NULL;
28: SQL NULL;
Record lock, heap no 109 PHYSICAL RECORD: n_fields 29; compact format; info bits 0
0: len 8; hex 00000000000c96dd; asc ;;
1: len 7; hex 5c69df52070572; asc \i R r;;
2: len 6; hex 000000000000; asc ;;
3: len 7; hex 80000000000000; asc ;;
4: len 8; hex 7ffffffffffffe5f; asc _;;
5: SQL NULL;
6: SQL NULL;
7: len 4; hex 5c4912f9; asc \I ;;
8: len 1; hex 01; asc ;;
9: len 4; hex 00000f3d; asc =;;
10: len 4; hex 5c4912f9; asc \I ;;
11: SQL NULL;
12: SQL NULL;
13: SQL NULL;
14: SQL NULL;
15: SQL NULL;
16: len 8; hex 0000000000000000; asc ;;
17: SQL NULL;
18: len 8; hex 0000000000000000; asc ;;
19: SQL NULL;
20: SQL NULL;
21: SQL NULL;
22: SQL NULL;
23: SQL NULL;
24: SQL NULL;
25: len 7; hex 5c69df52070190; asc \i R ;;
26: len 18; hex 726f6f74403137322e33312e37362e313337; asc root@172.XX.XX.28;;
27: SQL NULL;
28: SQL NULL;
Record lock, heap no 110 PHYSICAL RECORD: n_fields 29; compact format; info bits 0
0: len 8; hex 00000000000c96dd; asc ;;
1: len 7; hex 5c6a630d0d52d4; asc \jc R ;;
2: len 6; hex 000000000000; asc ;;
3: len 7; hex 80000000000000; asc ;;
4: len 8; hex 7ffffffffffffe5f; asc _;;
5: SQL NULL;
6: SQL NULL;
7: len 4; hex 5c4912f9; asc \I ;;
8: len 1; hex 00; asc ;;
9: len 4; hex 000005d7; asc ;;
10: SQL NULL;
11: SQL NULL;
12: SQL NULL;
13: SQL NULL;
14: SQL NULL;
15: SQL NULL;
16: len 8; hex 0000000000000000; asc ;;
17: SQL NULL;
18: len 8; hex 0000000000000000; asc ;;
19: SQL NULL;
20: SQL NULL;
21: SQL NULL;
22: SQL NULL;
23: SQL NULL;
24: SQL NULL;
25: len 7; hex 5c69df52070572; asc \i R r;;
26: len 18; hex 726f6f74403137322e33312e37362e313337; asc root@172.XX.XX.XXX;;
27: SQL NULL;
28: SQL NULL;
Record lock, heap no 111 PHYSICAL RECORD: n_fields 29; compact format; info bits 0
0: len 8; hex 00000000000c96dd; asc ;;
1: len 7; hex 5c6a630d0d5e81; asc \jc ^ ;;
2: len 6; hex 000000000000; asc ;;
3: len 7; hex 80000000000000; asc ;;
4: len 8; hex 8000000000000000; asc ;;
5: SQL NULL;
6: len 4; hex 00000f3d; asc =;;
7: len 4; hex 5c6a630d; asc \jc ;;
8: len 1; hex 00; asc ;;
9: len 4; hex 00000f3d; asc =;;
10: SQL NULL;
11: len 30; hex 496e73756666696369656e7420616d6f756e7420746f20636f7665722063; asc Insufficient amount to cover c; (total 39 bytes);
12: len 0; hex ; asc ;;
13: SQL NULL;
14: SQL NULL;
15: SQL NULL;
16: len 8; hex 0000000000000000; asc ;;
17: SQL NULL;
18: len 8; hex 0000000000000000; asc ;;
19: SQL NULL;
20: SQL NULL;
21: SQL NULL;
22: SQL NULL;
23: SQL NULL;
24: len 4; hex 00000f3d; asc =;;
25: len 7; hex 5c6a630d0d52d4; asc \jc R ;;
26: len 18; hex 726f6f74403137322e33312e37362e313337; asc root@172.XX.XX.28;;
27: SQL NULL;
28: SQL NULL;
Record lock, heap no 112 PHYSICAL RECORD: n_fields 29; compact format; info bits 0
0: len 8; hex 00000000000c96dd; asc ;;
1: len 7; hex 5c6a630d0d5f43; asc \jc _C;;
2: len 6; hex 000000000000; asc ;;
3: len 7; hex 80000000000000; asc ;;
4: len 8; hex 8000000000000000; asc ;;
5: SQL NULL;
6: len 4; hex 00000f3d; asc =;;
7: len 4; hex 5c6a630d; asc \jc ;;
8: len 1; hex 00; asc ;;
9: len 4; hex 00000f3d; asc =;;
10: SQL NULL;
11: len 30; hex 496e73756666696369656e7420616d6f756e7420746f20636f7665722063; asc Insufficient amount to cover c; (total 39 bytes);
12: len 0; hex ; asc ;;
13: SQL NULL;
14: SQL NULL;
15: SQL NULL;
16: len 8; hex 0000000000000000; asc ;;
17: SQL NULL;
18: len 8; hex 0000000000000000; asc ;;
19: SQL NULL;
20: SQL NULL;
21: SQL NULL;
22: SQL NULL;
23: SQL NULL;
24: len 4; hex 00000f3d; asc =;;
25: len 7; hex 5c6a630d0d5e81; asc \jc ^ ;;
26: len 18; hex 726f6f74403137322e33312e37362e313337; asc root@172.XX.XX.28;;
27: SQL NULL;
28: SQL NULL;
Record lock, heap no 113 PHYSICAL RECORD: n_fields 29; compact format; info bits 0
0: len 8; hex 00000000000c96dd; asc ;;
1: len 7; hex 5c6a630d0d692c; asc \jc i,;;
2: len 6; hex 000000000000; asc ;;
3: len 7; hex 80000000000000; asc ;;
4: len 8; hex 8000000000000000; asc ;;
5: SQL NULL;
6: len 4; hex 00000f3d; asc =;;
7: len 4; hex 5c6a630d; asc \jc ;;
8: len 1; hex 00; asc ;;
9: len 4; hex 00000f3d; asc =;;
10: SQL NULL;
11: len 30; hex 496e73756666696369656e7420616d6f756e7420746f20636f7665722063; asc Insufficient amount to cover c; (total 39 bytes);
12: len 0; hex ; asc ;;
13: SQL NULL;
14: SQL NULL;
15: SQL NULL;
16: len 8; hex 0000000000000000; asc ;;
17: SQL NULL;
18: len 8; hex 000…
|
|
We just have one execute command, I guess internally there are two updates one on main table and the other under partition. If you see, the lock is on the partition table p0. Correct me, if I am wrong or miss something.
|