Fix for BUG#42112 "Maria: recovery failure (pushbuild2) Assertion `rownr == 0 && new_page' failed"
mysql-test/suite/maria/r/maria-recovery3.result: result update mysql-test/suite/maria/t/maria-recovery3.test: Test for BUG#42112; before the bugfix, recovery would assert like this: ma_blockrec.c:6051: _ma_apply_redo_insert_row_head_or_tail: Assertion `rownr == 0 && new_page' failed. storage/maria/ma_create.c: Fix for BUG#42112; plus some intentional crashes to test the fix. The bug was that if crash happened during TRUNCATE TABLE, in maria_create(), after the index file's state has been written but before its LSNs have been updated (so, if crash happened between _ma_state_info_write_sub() and _ma_update_state__lsns_sub()), then that would leave a table with create_rename_lsn==0. Recovery would then try old pre-TRUNCATE REDOs on this table, and fail as this table is already partly shortened. Fix is to write create_rename_lsn==LSN_MAX as soon as TRUNCATE touches the index file, so that Recovery ignores this table. This allows Maria to start; the table is still corrupted but the user can successfully repeat TRUNCATE TABLE (which required Maria to start). storage/maria/ma_delete_all.c: A comment.
Showing
Please register or sign in to comment