mariadb/storage/innobase
Marko Mäkelä bf363a573a MDEV-38968 Redundant FILE_CHECKPOINT writes
Concurrent calls to log_checkpoint_low() were possible from multiple
threads, and they could cause redundant writes of FILE_CHECKPOINT
records that refer to the same checkpoint. 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 will replace the data member log_sys.next_checkpoint_lsn.

log_sys.checkpoint_pending: Remove. Only the buf_flush_page_cleaner()
thread will write checkpoints or initiate page writes.

log_checkpoint_low(), log_checkpoint(): Remove the return value,
because there cannot be any concurrent log checkpoint in progress.

buf_flush_wait(): Add a parameter for waiting for a full checkpoint.
This function replaces buf_flush_wait_flushed().

log_t::checkpoint_margin(): Replaces log_checkpoint_margin().

lot_t::write_buf(): Remove a call set_check_for_checkpoint(false)
that commit 7443ad1c8a (MDEV-32374)
had added. The flag should only be cleared when the checkpoint has
advanced far enough.

log_make_checkpoint(): Simply wrap buf_flush_sync_batch(0, true).

buf_flush_sync_batch(): Add the parameter bool checkpoint, to wait
for an empty FILE_CHECKPOINT record to be written. Outside recovery,
pass lsn=0.

buf_flush_sync_for_checkpoint(): On shutdown, update the systemd
watchdog and keep flushing until a final checkpoint has been written.

buf_flush_page_cleaner(): Revise the shutdown logic so that all
changes will be written out and a checkpoint with just a FILE_CHECKPOINT
record can be written.

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,
and return the shutdown LSN.

fil_names_clear(): Fix an off-by-one error that would prevent
removal from fil_system.named_spaces.

innodb_shutdown(): Always invoke logs_empty_and_mark_files_at_shutdown().

srv_undo_tablespaces_reinit(): Simplify the logic and remove the
fault injection point after_reinit_undo_abort, which would cause
a failure on Microsoft Windows. Changing innodb_undo_tablespaces is
not fully crash-safe.

Reviewed by: Thirunarayanan Balathandayuthapani
Tested by: Saahil Alam
2026-03-11 12:20:08 +02:00
..
btr MDEV-36436 Assertion "unexpected references" == 0 after ALTER IGNORE TABLE 2026-02-26 13:18:23 +05:30
buf MDEV-38968 Redundant FILE_CHECKPOINT writes 2026-03-11 12:20:08 +02:00
data Merge 10.7 into 10.8 2022-11-01 08:50:28 +02:00
dict Merge branch '10.6' into 10.11 2026-01-28 14:22:20 +01:00
eval MDEV-37619 The forced use of THD accessors hurts InnoDB performance 2025-09-16 15:18:32 +03:00
fil MDEV-38968 Redundant FILE_CHECKPOINT writes 2026-03-11 12:20:08 +02:00
fsp MDEV-38968 Redundant FILE_CHECKPOINT writes 2026-03-11 12:20:08 +02:00
fts Merge branch '10.6' into 10.11 2026-01-28 14:22:20 +01:00
fut MDEV-38419: Fix some clang-21 -fsanitize=memory failures 2026-01-02 09:25:46 +02:00
gis MDEV-27675 review fixup 2025-10-23 07:36:12 +03:00
ha MDEV-35472 Server crash in ha_storage_put_memlim upon reading from INNODB_LOCKS 2024-11-25 10:31:57 +02:00
handler MDEV-38968 Redundant FILE_CHECKPOINT writes 2026-03-11 12:20:08 +02:00
ibuf MDEV-29930 Lock order inversion in ibuf_remove_free_page() 2025-09-11 13:25:08 +03:00
include MDEV-38968 Redundant FILE_CHECKPOINT writes 2026-03-11 12:20:08 +02:00
lock Merge 10.6 -> 10.11 2026-03-11 09:57:09 +01:00
log MDEV-38968 Redundant FILE_CHECKPOINT writes 2026-03-11 12:20:08 +02:00
mem Cleanup: Remove duplicated code 2024-11-29 14:16:34 +02:00
mtr MDEV-38968 Redundant FILE_CHECKPOINT writes 2026-03-11 12:20:08 +02:00
mysql-test/storage_engine MDEV-36330: SERIALIZABLE read inconsistency 2025-07-11 16:07:08 +03:00
os MDEV-36234: Add innodb_linux_aio 2025-06-23 13:51:52 +03:00
page Merge branch '10.6' into 10.11 2025-12-19 14:18:11 +11:00
pars Merge 10.6 into 10.11 2025-02-25 10:23:24 +02:00
que MDEV-24035 Failing assertion: UT_LIST_GET_LEN(lock.trx_locks) == 0 causing disruption and replication failure 2024-12-12 18:02:00 +02:00
read MDEV-34515: Contention between purge and workload 2024-08-26 12:23:06 +03:00
rem MDEV-30732 : wsrep_store_key_val_for_row() may invoke memcpy() on nullptr 2025-11-11 12:43:19 +02:00
row MDEV-38968 Redundant FILE_CHECKPOINT writes 2026-03-11 12:20:08 +02:00
srv MDEV-38968 Redundant FILE_CHECKPOINT writes 2026-03-11 12:20:08 +02:00
sync MDEV-35566 Ensure compatibility with ARMv9 by updating .arch directive 2025-08-15 09:47:40 +03:00
trx MDEV-38993 Assertion `trx->undo_no == 1' fails upon ALTER IGNORE 2026-03-09 18:33:05 +05:30
unittest Fix MSVC warning 2026-01-19 17:09:05 +01:00
ut MDEV-36759: Huge performance drop 2025-05-13 12:27:50 +03:00
.clang-format-old switch off storage/innobase/.clang-format: InnoDB uses a common formatting style for all new code 2021-03-17 11:01:15 +03:00
CMakeLists.txt MDEV-36234: Add innodb_linux_aio 2025-06-23 13:51:52 +03:00
COPYING.Google
COPYING.Percona