[MDEV-23158] False negatives from buf_pool.is_uncompressed() cause unnecessary lookups Created: 2020-07-13 Updated: 2022-02-21 Resolved: 2022-02-21 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 5.5, 10.0, 10.1, 10.2, 10.3, 10.4, 10.5 |
| Fix Version/s: | 10.6.6 |
| Type: | Bug | Priority: | Major |
| Reporter: | Marko Mäkelä | Assignee: | Marko Mäkelä |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | performance | ||
| Issue Links: |
|
||||||||||||
| Description |
|
The function buf_pool.is_uncompressed() is expected to hold on any buf_block_t* that has been allocated by buf_LRU_get_free_block(). But it turns out that it does not hold:
With the above patch, 10.5 would crash on bootstrap. Also 10.1 will crash with an equivalent patch:
Apparently, the assumption about alignment does not hold. Can we replace it with something that is correct? The goal is to protect against ‘fake’ buf_block_t such as the one that is allocated in fil_tablespace_iterate() as well as against buffer pool resizing. The false negatives are reducing the performance of buf_page_get_gen() by triggering unnecessary hash table lookups. The original motivation of the check was simple, and the code became dead code when buf_page_alloc_descriptor() was rewritten to not use buf_buddy_alloc() any more. But, maybe starting with 10.2, more considerations could be necessary due to buffer pool resizing?
|
| Comments |
| Comment by Marko Mäkelä [ 2022-02-21 ] |
|
I think that this bug was essentially fixed by |