Draft
Conversation
Concurrent calls to log_checkpoint_low() were possible from multiple threads, and they could cause redundant writes of FILE_CHECKPOINT records. Let us simplify the logic by making the dedicated buf_flush_page_cleaner() thread responsible for checkpoints. log_t::write_checkpoint(lsn_t end_lsn): Add the parameter checkpoint, which replaces log_sys.next_checkpoint_lsn. log_sys.checkpoint_pending: Remove. Only the buf_flush_page_cleaner thread will write checkpoints, hence there is no possibility of a race condition. log_checkpoint_low(), log_checkpoint(): Remove the return value, because there cannot be any concurrent log checkpoint in progress. buf_flush_wait(): Add special handling for log_sys.check_for_checkpoint() as well as shutdown. buf_flush_wait_flushed(): Assert that buf_flush_page_cleaner() is available. log_make_checkpoint(): Delegate all work to the page cleaner. buf_flush_sync_for_checkpoint(): Update the systemd watchdog. On shutdown, keep flushing until a checkpoint has been written. buf_flush_page_cleaner(): Revise the shutdown logic so that all changes will be written out. buf_flush_buffer_pool(): Remove. buf_flush_wait_flushed(): Require the caller to acquire buf_pool.flush_list_mutex. logs_empty_and_mark_files_at_shutdown(): Simplify the logic. fil_names_clear(): Fix an off-by-one error that would prevent removal from fil_system.named_spaces.
|
|
Contributor
Author
|
Apparently there are some problems with shutdown that make the tests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Concurrent calls to
log_checkpoint_low()were possible from multiple threads, and they could cause redundant writes ofFILE_CHECKPOINTrecords. Let us simplify the logic by making the dedicatedbuf_flush_page_cleaner()thread responsible for checkpoints.log_t::write_checkpoint(lsn_t end_lsn): Add the parametercheckpoint, which replaceslog_sys.next_checkpoint_lsn.log_sys.checkpoint_pending: Remove. Only thebuf_flush_page_cleanerthread will write checkpoints, hence there is no possibility of a race condition.log_checkpoint_low(),log_checkpoint(): Remove the return value, because there cannot be any concurrent log checkpoint in progress.buf_flush_wait(): Add special handling forlog_sys.check_for_checkpoint()as well as shutdown.buf_flush_wait_flushed(): Assert thatbuf_flush_page_cleaner()is available.log_make_checkpoint(): Delegate all work to the page cleaner.buf_flush_sync_for_checkpoint(): Update the systemd watchdog. On shutdown, keep flushing until a checkpoint has been written.buf_flush_page_cleaner(): Revise the shutdown logic so that all changes will be written out.buf_flush_buffer_pool(): Remove.buf_flush_wait_flushed(): Require the caller to acquirebuf_pool.flush_list_mutex.logs_empty_and_mark_files_at_shutdown(): Simplify the logic.fil_names_clear(): Fix an off-by-one error that would prevent removal fromfil_system.named_spaces.Release Notes
InnoDB shutdown was simplified.
How can this PR be tested?
rm -fr mysql-test/var mkdir /tmp/var ln -s /tmp/var mysql-test/var mysql-test/mtr --repeat=10 --parallel=auto innodb.log_corruption_recovery{,,,,,}{,,,} mysql-test/mtr --force --parallel=auto --big-testThis ensures that despite
cmake -DWITH_INNODB_PMEM=ONthepwritebased log write code path will be used.Basing the PR against the correct MariaDB version
mainbranch.PR quality check