Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Not a Bug
-
10.6.14
-
None
-
redhat 7 on VMware
Description
One of our DB is using 2 DB nodes + 1 aribtrator architecture with HAProxy on top. Found nextval error when sequence object is using nocache. Increment is 0 as Galera requirement.
ERROR 1213 (40001): Deadlock found when trying to get lock; try restarting transaction
DB nodes are using MariaDB version 10.6.14 and Galera 26.4.12.
Below is the test case. One node will encounter error easily.
# create sequence with nocache
|
drop sequence s ;
|
create sequence s increment=0 cache=0 ; |
show create sequence s ;
|
|
|
# create procedure for the test |
DROP PROCEDURE IF EXISTS seq_test;
|
|
DELIMITER $$
|
CREATE PROCEDURE seq_test(IN num_of_turn int, IN slp float) |
BEGIN
|
DECLARE finished char(1); |
DECLARE cnt int; |
|
SET cnt=0; |
|
WHILE cnt <= num_of_turn DO
|
SELECT NEXTVAL(s);
|
|
SET cnt=cnt+1; |
|
SELECT SLEEP(slp);
|
END WHILE;
|
END $$
|
|
DELIMITER ;
|
|
|
# node 1 |
call seq_test(1000, 0.3); |
|
|
# node 2 |
call seq_test(1000, 0.2); |
|