Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL)
Description
The function log_checkpoint() or log_checkpoint_low() tries to avoid redundant writes. Here is the 10.3 version of log_checkpoint():
if (oldest_lsn |
> log_sys.last_checkpoint_lsn + SIZE_OF_MLOG_CHECKPOINT) {
|
/* Some log has been written since the previous checkpoint. */ |
} else if (srv_shutdown_state > SRV_SHUTDOWN_INITIATED) { |
/* MariaDB 10.3 startup expects the redo log file to be |
logically empty (not even containing a MLOG_CHECKPOINT record)
|
after a clean shutdown. Perform an extra checkpoint at
|
shutdown. */
|
} else { |
/* Do nothing, because nothing was logged (other than |
a MLOG_CHECKPOINT marker) since the previous checkpoint. */
|
log_mutex_exit();
|
return(true); |
}
|
...
|
if (fil_names_clear(flush_lsn, do_write)) { |
This logic fails to take two things into account:
- The function fil_names_clear() may write some file names before the checkpoint record.
- Before
MDEV-14425, the checkpoint record may be interrupted by 4+12 or 8+12 bytes of log block trailer and header.
In either case, the difference of oldest_lsn and log_sys.last_checkpoint_lsn could be more than the size of the checkpoint record.
The simplest way to fix this could be to avoid writing a new checkpoint if oldest_lsn did not change since the previous checkpoint.
Attachments
Issue Links
- relates to
-
MDEV-24845 Oddities around innodb_fatal_semaphore_wait_threshold and global.innodb_disallow_writes
- Closed