Details
-
Bug
-
Status: Closed (View Workflow)
-
Blocker
-
Resolution: Fixed
-
10.6(EOL), 10.11, 11.4, 11.8, 12.3
-
Can result in data loss
-
An InnoDB page reorganize operation could corrupt things further in case it encountered corruption.
Description
In the function btr_page_reorganize_low(), there are several failure paths after the following:
buf_block_t *old= buf_block_alloc();
|
Only right before the final return DB_SUCCESS we would release the allocated block back to the buffer pool:
buf_block_free(old);
|
The implication is that if the page is found to be corrupted during a reorganize operation, we would leak a block that we allocated from the buffer pool. Eventually, this could lead to a hang of the server if we run out of the buffer pool.
alessandro.vetere recently fixed this in MDEV-40408, but only for MariaDB Server 11.8 onwards. The motivation of that fix was to improve performance, not to prevent a memory leak. A minimal fix will not change the allocation but just ensure that buf_block_free(old) will be invoked in every return path.
Furthermore, when a failure occurs, we fail to restore the contents of the page from old. We should do that in order to avoid making a bad situation worse. This follow-up to MDEV-18519 is needed to match the MySQL change Bug#37258813 btr_page_reorganize_low may cause crash recovery failure.
Attachments
Issue Links
- blocks
-
MDEV-41670 Merge applicable InnoDB changes from MySQL 8.4.13
-
- Open
-
- relates to
-
MDEV-18519 0x7f0118195700 InnoDB: Assertion failure in file /home/buildbot/buildbot/build/mariadb-10.3.7/storage/innobase/btr/btr0cur.cc line 4308
-
- Closed
-
-
MDEV-40408 btr_page_reorganize_low() uses the buffer pool just to obtain a scratch block
-
- Closed
-