[MDEV-28803] ERROR 1206 (HY000): The total number of locks exceeds the lock table size Created: 2022-06-11 Updated: 2024-01-29 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.6, 10.7, 10.8, 10.9, 10.10 |
| Fix Version/s: | 10.6 |
| Type: | Bug | Priority: | Major |
| Reporter: | Roel Van de Paar | Assignee: | Marko Mäkelä |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | not-10.3, not-10.4, not-10.5, regression-10.6 | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Description |
|
Will lead to:
In 10.6 to 10.10 only. |
| Comments |
| Comment by Marko Mäkelä [ 2022-06-13 ] | |||||||||||||||||||
|
I think that this and MDEV-28800 are siblings of each other. There shouldn’t be any difference between 10.8, 10.9, 10.10 in InnoDB that would explain why we sometimes notice that the record locks are consuming too much memory, and sometimes won’t. I can confirm that on my system, a non-debug build of 10.8 62419b1733042c30414a4feed89c79aebb5621af will only allow the file t1.ibd to grow to 28MiB, which is the same result that I got on a 10.10 32edabd1f2fa0cf9b2cf41f326d399ef0348fa30 debug build. On a non-debug build of the same 10.10 revision, the file grew to 29 MiB before the message was output. In MDEV-28800, it is implied that locks are not consuming so much memory in 10.7. There have been no changes to the InnoDB locking subsystem since version 10.6. Hence, the reason for this regression must be somewhere outside InnoDB. But, I do not see any such regression:
The test case that I used was as follows:
Please double-check the affected versions. The excessive record locking would be fixed by MDEV-24813. It is not fixable in the InnoDB subsystem itself. | |||||||||||||||||||
| Comment by Roel Van de Paar [ 2022-06-13 ] | |||||||||||||||||||
|
Double-checked affected versions. Issue only appears on optimized builds. Earlier testing had included debug builds on which the issue does not show. Found that only optimized builds and only 10.8-10.10 are affected. | |||||||||||||||||||
| Comment by Marko Mäkelä [ 2022-06-13 ] | |||||||||||||||||||
|
I do not think that anything has been changed in InnoDB transactional locks since version 10.6. In MDEV-28800, I posted a failure that I reproduced on 10.6. I think that there is a design issue that the transactional lock objects will be allocated from the buffer pool. If an excessive number of record locks is being created, InnoDB will report an error or crash due to running out of buffer pool. That an error is being reported is a nice thing, compared to a crash. What exactly do you expect to be fixed in the scope of this ticket? | |||||||||||||||||||
| Comment by Roel Van de Paar [ 2022-06-13 ] | |||||||||||||||||||
|
Your comments made me think further and helped me to understand why this currently seems to show on 10.8-10.10 only: I tested the same on 10.6 (and 10.7) using --innodb_buffer_pool_chunk_size=2097152 and in that case, the error can be produced there also:
However, on 10.5 (and 10.3, 10.4), the query succeeds (using the same setup):
So the action item for this ticket is: why does 10.6-10.10 fail with the error whereas 10.3-10.5 will process the query fine, when using the same innodb_buffer_pool_chunk_size and innodb_buffer_pool_size? | |||||||||||||||||||
| Comment by Roel Van de Paar [ 2022-06-13 ] | |||||||||||||||||||
|
Found one more odd difference. When starting 10.8 to 10.10 (all debug, and using CLI) with --innodb_buffer_pool_chunk_size=2097152, only 10.10 will produce the ERROR 1206 error. 10.8 and 10.9 will continue processing the query. | |||||||||||||||||||
| Comment by Marko Mäkelä [ 2022-06-14 ] | |||||||||||||||||||
|
The buffer pool resizing is inaccurate and somewhat nondeterministic by design. I do not think that it can be fixed easily, other than by reimplementing the buffer pool resizing in a different way: Allocate a reasonable maximum amount of contiguous 64-bit virtual address space for the buffer pool, but only map the requested amount of memory for it. I have discussed it with danblack in the past. I think that what is needed to address this bug report is to ensure that the crashes (MDEV-28800) are avoided, and that the error message is refined to mention innodb_buffer_pool_size, because the explicit record locks will be allocated from the InnoDB buffer pool. It is a reasonable design, only the enforcement of the maximum allocation size is sloppy and the error message is not helpful for a user. | |||||||||||||||||||
| Comment by Roel Van de Paar [ 2022-06-14 ] | |||||||||||||||||||
|
Understood, thank you. |