summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--storage/innobase/buf/buf0flu.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc
index 32348c26e9f..00d96935461 100644
--- a/storage/innobase/buf/buf0flu.cc
+++ b/storage/innobase/buf/buf0flu.cc
@@ -1774,9 +1774,16 @@ static bool log_checkpoint_low(lsn_t oldest_lsn, lsn_t end_lsn)
ut_ad(!recv_no_log_write);
ut_ad(oldest_lsn >= log_sys.last_checkpoint_lsn);
+ const lsn_t age= oldest_lsn - log_sys.last_checkpoint_lsn;
- if (oldest_lsn > log_sys.last_checkpoint_lsn + SIZE_OF_FILE_CHECKPOINT)
+
+ if (age > SIZE_OF_FILE_CHECKPOINT + log_sys.framing_size())
/* Some log has been written since the previous checkpoint. */;
+ else if (age > SIZE_OF_FILE_CHECKPOINT &&
+ !((log_sys.log.calc_lsn_offset(oldest_lsn) ^
+ log_sys.log.calc_lsn_offset(log_sys.last_checkpoint_lsn)) &
+ ~lsn_t{OS_FILE_LOG_BLOCK_SIZE - 1}))
+ /* Some log has been written to the same log block. */;
else if (srv_shutdown_state > SRV_SHUTDOWN_INITIATED)
/* MariaDB startup expects the redo log file to be logically empty
(not even containing a FILE_CHECKPOINT record) after a clean shutdown.