Details
-
Bug
-
Status: In Review (View Workflow)
-
Critical
-
Resolution: Unresolved
-
13.0
-
Can result in hang or crash
-
Q3/2026 Server Development
Description
A test that is being introduced by MDEV-39061 would time out due to an infinite loop. Initially, I was unable to reproduce it on my system. Adding more concurrency helped to delay a log checkpoint sufficiently:
MTR_TESTCASE_TIMEOUT=1 mysql-test/mtr --repeat=15 --parallel=40 mariabackup.huge_lsn,SERVER,strict_full_crc32{,,,,,,,}{,,,,} |
This would allow the test to fail in my development environment, where nproc reports 24:
mariabackup.huge_lsn 'SERVER,strict_full_crc32' w20 [ 9 pass ] 13969
|
mariabackup.huge_lsn 'SERVER,strict_full_crc32' w3 [ 8 pass ] 14219
|
mariabackup.huge_lsn 'SERVER,strict_full_crc32' w39 [ fail ] timeout after 60 seconds
|
With some added logging, I figured out the problem. The fix is quite simple: When we wait for a log checkpoint, we must wait for it to be not behind the latest sampled LSN. On one code path, which matches the test case, we are subtracting from the wait_lsn before waiting, causing buf_flush_wait(wait_lsn, false) to be a no-op (no checkpoint executed, even though there are some dirty pages):
diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc
|
index ee8d43a68e5..c8aa06b02dc 100644
|
--- a/storage/innobase/log/log0log.cc
|
+++ b/storage/innobase/log/log0log.cc
|
@@ -811,14 +811,15 @@ void log_t::set_archive(my_bool archive, THD *thd) noexcept
|
|
if (archive)
|
{
|
- wait_lsn-= (wait_lsn - first_lsn) % capacity();
|
+ const lsn_t limit{wait_lsn - (wait_lsn - first_lsn) % capacity()};
|
/* We are in innodb_log_archive=OFF. If the file has wrapped
|
around between the checkpoint and the current position, we must
|
wait for a log checkpoint not before the desired first_lsn of
|
our innodb_log_archive=ON log file, because that format does not
|
allow any wrap-around. */
|
- if (checkpoint < wait_lsn)
|
+ if (checkpoint < limit)
|
goto retry_after_checkpoint;
|
+ wait_lsn= limit;
|
}
|
else if (circular_recovery_from_sequence_bit_0)
|
{ |
Attachments
Issue Links
- blocks
-
MDEV-14992 BACKUP SERVER to mounted file system
-
- In Progress
-
-
MDEV-39061 mariadb-backup compatible wrappers for BACKUP SERVER
-
- In Testing
-
- is caused by
-
MDEV-37949 Implement innodb_log_archive
-
- Closed
-