MDEV-34307 On startup, [FATAL] InnoDB: Page ... still fixed or dirty #3310
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
buf_pool_invalidate()
: Properly wait foros_aio_wait_until_no_pending_writes()
to ensure so that there are no pendingbuf_page_t::write_complete()
orbuf_page_write_complete()
operations. This will avoid a failure ofbuf_pool.assert_all_freed()
.This bug should affect debug builds only. At this point, the
buf_pool.flush_list
should be clear and all changes should have been written out. The loop aroundbuf_LRU_scan_and_free_block()
should have eventually completed and freed all pages as soon asbuf_page_t::write_complete()
had a chance to release the page latches.This regression was introduced in a55b951.
Release Notes
This only fixes a debug check and should have no impact on actual operations.
How can this PR be tested?
This was found while testing #3282, running
mariadb-backup --prepare
on HDD. This code should be covered by killing the server and restarting with a smallerinnodb_buffer_pool_size
, but it should be hard to hit the race condition that we are fixing here. See MDEV-34307 for an analysis of anrr replay
trace of a failure.Basing the PR against the correct MariaDB version
PR quality check