[MDEV-31858] NEXTVAL on nocache sequence encounter "ERROR 1213 (40001): Deadlock found when trying to get lock; try restarting transaction" in Galera Created: 2023-08-06 Updated: 2023-09-11 Resolved: 2023-09-11 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Galera, Server |
| Affects Version/s: | 10.6.14 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | William Wong | Assignee: | Jan Lindström |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
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. 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.
|
| Comments |
| Comment by Jan Lindström [ 2023-09-11 ] |
|
I could reproduce this issue but it is not a bug. This is because sequence value is stored in special table and SELECT NEXTVAL is basically update of latest used value. Concurrent execution could cause both lock wait as well as deadlock errors especially if you have multi-master setup. |