mariadb/storage/innobase/row
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
..
row0ext.cc Merge 10.3 into 10.4 2020-07-02 07:39:33 +03:00
row0ftsort.cc Merge branch '10.6' into 10.11 2026-01-28 14:22:20 +01:00
row0import.cc Merge branch '10.6' into 10.11 2026-01-28 14:22:20 +01:00
row0ins.cc MDEV-36436 Assertion "unexpected references" == 0 after ALTER IGNORE TABLE 2026-02-26 13:18:23 +05:30
row0log.cc Merge 10.6 into 10.11 2026-01-02 11:06:05 +02:00
row0merge.cc MDEV-38968 Redundant FILE_CHECKPOINT writes 2026-03-11 12:20:08 +02:00
row0mysql.cc MDEV-38928 Assertion `undo_no <= 1' failed in trx_t::reset_and_truncate_undo() 2026-03-05 22:53:07 +05:30
row0purge.cc MDEV-16168: Performance regression after MDEV-12288 2025-09-04 08:40:40 +03:00
row0quiesce.cc Merge 10.6 into 10.11 2025-05-21 07:36:35 +03:00
row0row.cc MDEV-36545: Possible crash in row_raw_format_str() 2025-10-23 09:08:08 +03:00
row0sel.cc MDEV-37619 The forced use of THD accessors hurts InnoDB performance 2025-09-16 15:18:32 +03:00
row0uins.cc MDEV-36436 Assertion "unexpected references" == 0 after ALTER IGNORE TABLE 2026-02-26 13:18:23 +05:30
row0umod.cc MDEV-36017 Alter table aborts when temporary directory is full 2025-05-26 10:12:14 +05:30
row0undo.cc MDEV-36436 Assertion "unexpected references" == 0 after ALTER IGNORE TABLE 2026-02-26 13:18:23 +05:30
row0upd.cc MDEV-36017 Alter table aborts when temporary directory is full 2025-05-26 10:12:14 +05:30
row0vers.cc Merge 10.6 into 10.11 2025-10-09 13:29:46 +03:00