Details
-
Bug
-
Status: In Review (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.11, 11.4, 11.8, 12.3
-
Related to performance
-
Q1/2026 Server Development
Description
Related to MDEV-38289 and a failure of an end_lsn assertion failure that is being added in MDEV-37949 I found out that the check at the start of log_checkpoint_low() is not preventing redundant writes of FILE_CHECKPOINT records. What I am observing is a stream of identical FILE_CHECKPOINT records pointing to the same checkpoint LSN. These durable writes (including fsync(2) or fdatasync(2) or equivalent) should cost some performance.
I was able to reproduce the problem on 10.11 with the following patch, placing the data directory outside /dev/shm:
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
|
index 189a506c3a3..e4edb020a9c 100644
|
--- a/storage/innobase/buf/buf0buf.cc
|
+++ b/storage/innobase/buf/buf0buf.cc
|
@@ -587,6 +587,7 @@ static bool buf_page_check_lsn(bool check_lsn, const byte *read_buf) noexcept
|
" is in the future! Current system log sequence number "
|
LSN_PF ".",
|
space_id, page_no, page_lsn, current_lsn);
|
+ ut_a(((current_lsn - 0x3032) & 15) || current_lsn == 0x3032 || current_lsn == 0x3042);
|
|
if (srv_force_recovery)
|
return false;
|
diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc
|
index 43682200710..7bb1d5d0bdc 100644
|
--- a/storage/innobase/buf/buf0flu.cc
|
+++ b/storage/innobase/buf/buf0flu.cc
|
@@ -2013,6 +2013,9 @@ static bool log_checkpoint_low(lsn_t oldest_lsn, lsn_t end_lsn) noexcept
|
return true;
|
}
|
|
+ //ut_a(oldest_lsn != 0x3032);
|
+ ut_a(((oldest_lsn - 0x3032) & 15) || oldest_lsn <= 12354);
|
+
|
ut_ad(!recv_no_log_write);
|
ut_ad(oldest_lsn > log_sys.last_checkpoint_lsn);
|
/* Repeat the FILE_MODIFY records after the checkpoint, in case some |
while mysql-test/mtr --rr=-h --parallel=auto innodb.log_corruption_recovery{,,,,,}{,,}; do :; done |
Attachments
Issue Links
- relates to
-
MDEV-37949 Implement innodb_log_archive
-
- Stalled
-
-
MDEV-38289 Test innodb.log_corruption_recovery fails sporadically with current LSN 12370 or 12386
-
- Closed
-