Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-40852

Redundant checkpoint written after innodb_log_archive startup

    XMLWordPrintable

Details

    • Not for Release Notes
    • A redundant empty checkpoint could be written after an existing one.
    • Q4/2026 Server Maintenance

    Description

      The test innodb.log_archive that was added in MDEV-37949 is failing frequently:

      13.0 a848493c6fe031f23606144420c1ca1e467cbd81

      innodb.log_archive 'mmap'                w2 [ fail ]
              Test ended at 2026-08-11 12:37:41
       
      CURRENT_TEST: innodb.log_archive
      --- C:/a/server/server/mysql-test/suite/innodb/r/log_archive.result	2026-08-11 12:06:01.462876300 +0000
      +++ C:\a\server\server\mysql-test\suite\innodb\r\log_archive.reject	2026-08-11 12:37:40.683306200 +0000
      @@ -62,9 +62,9 @@
       SELECT variable_name, variable_value FROM information_schema.global_status
       WHERE variable_name LIKE 'INNODB_LSN%';
       variable_name	variable_value
      -INNODB_LSN_CURRENT	18446744073705357295
      -INNODB_LSN_FLUSHED	18446744073705357295
      -INNODB_LSN_LAST_CHECKPOINT	18446744073705357279
      +INNODB_LSN_CURRENT	18446744073705357311
      +INNODB_LSN_FLUSHED	18446744073705357311
      +INNODB_LSN_LAST_CHECKPOINT	18446744073705357295
       INNODB_LSN_ARCHIVED	18446744073705357279
       # restart: --innodb-log-recovery-start=0 --innodb-log-buffer-size=5m
       SELECT variable_name, variable_value FROM information_schema.global_status
       
      Result content mismatch
      

      This failure has been observed both for the mmap and pread test variants. The difference of INNODB_LSN_CURRENT is 16, which corresponds to the size of a FILE_CHECKPOINT record. All test steps before this have been executed with either innodb_read_only or innodb_log_recovery_start being enabled. Therefore, writes to the log file should have been prevented. (Edit: Due to innodb_log_recovery_target=0 writes to the log are not blocked.)

      Similar failures have also been observed on an ARMv8 based Apple macOS. On IBM System Z (s390x) and AMD64 the failure is much less frequent.

      On any platform, the probability of the failure can be improved with the following patch, suggested by andrzej.jarzabek]:

      diff --git a/mysql-test/suite/innodb/t/log_archive.test b/mysql-test/suite/innodb/t/log_archive.test
      index 925108880ba..ee3fe8ad0f3 100644
      --- a/mysql-test/suite/innodb/t/log_archive.test
      +++ b/mysql-test/suite/innodb/t/log_archive.test
      @@ -178,6 +178,7 @@ EOF
       --let $restart_parameters= --innodb-log-recovery-start=18446744073705357279
       --source include/start_mysqld.inc
       
      +--sleep 2
       SELECT variable_name, variable_value FROM information_schema.global_status
       WHERE variable_name LIKE 'INNODB_LSN%';
       
      

      If we view the LSNs in hexadecimal, it becomes clearer that the failure occurs due to a redundant write of a FILE_CHECKPOINT record. These failures started to occur on 2026-08-20, which is when the fix of MDEV-40791 was pushed. The extra write is caused by log_sys.circular_recovery_from_sequence_bit_0 being unnecessarily set in log_t::set_archive().

      Attachments

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              marko Marko Mäkelä
              Marko Mäkelä Marko Mäkelä
              Thirunarayanan Balathandayuthapani Thirunarayanan Balathandayuthapani
              Saahil Alam Saahil Alam
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 2d Original Estimate - 2d
                  2d
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 5d
                  5d

                  Git Integration

                    Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.