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

SET GLOBAL innodb_log_archive=OFF breaks recovery

    XMLWordPrintable

Details

    • Can result in data loss
    • If SET GLOBAL innodb_log_archive=OFF is executed soon after crash recovery and the server is killed thereafter, crash recovery could fail.
    • Q2/2026 Server Development, Q3/2026 Server Maintenance

    Description

      I encountered this while attempting to create a test case for MDEV-39770:

      diff --git a/mysql-test/suite/innodb/r/blob-crash.result b/mysql-test/suite/innodb/r/blob-crash.result
      index 85d12ff49b5..b45317c8866 100644
      --- a/mysql-test/suite/innodb/r/blob-crash.result
      +++ b/mysql-test/suite/innodb/r/blob-crash.result
      @@ -14,6 +14,7 @@ INSERT INTO t1 (a, b) VALUES (4, '4');
       INSERT INTO t1 (a, b) VALUES (5, '5');
       begin;
       INSERT INTO t1 (a, b) VALUES (6, REPEAT('a', 4*1024*1024));
      +SET GLOBAL innodb_log_archive=ON;
       SELECT a, right(b, 50) FROM t1;
       a	right(b, 50)
       1	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      @@ -27,6 +28,7 @@ a	right(b, 50)
       #
       begin;
       UPDATE t1 set b = REPEAT('a', 4*1024*1024) where a = 5 ;
      +SET GLOBAL innodb_log_archive=OFF;
       SELECT a, right(b, 50) FROM t1;
       a	right(b, 50)
       1	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      diff --git a/mysql-test/suite/innodb/t/blob-crash.test b/mysql-test/suite/innodb/t/blob-crash.test
      index 77787a34745..83ffef43528 100644
      --- a/mysql-test/suite/innodb/t/blob-crash.test
      +++ b/mysql-test/suite/innodb/t/blob-crash.test
      @@ -34,6 +34,7 @@ let $shutdown_timeout=0;
       let $restart_noprint=2;
       --source include/restart_mysqld.inc
       
      +SET GLOBAL innodb_log_archive=ON;
       SELECT a, right(b, 50) FROM t1;
       
       # ..........................................................................
      @@ -50,6 +51,7 @@ UPDATE t1 set b = REPEAT('a', 4*1024*1024) where a = 5 ;
       
       let $shutdown_timeout=0;
       --source include/restart_mysqld.inc
      +SET GLOBAL innodb_log_archive=OFF;
       
       SELECT a, right(b, 50) FROM t1;
       
      

      The test would fail like this:

      mysql-test/mtr --repeat=2 innodb.blob-crash,4k
      

      main 5a9af15a2ca712c8d35756385618125fb37522be with patched test

      innodb.blob-crash '4k'                   [ pass ]   9879
      innodb.blob-crash '4k'                   [ 2 fail ]
              Test ended at 2026-05-27 13:30:42
       
      CURRENT_TEST: innodb.blob-crash
      mysqltest: At line 80: query 'SELECT a, right(b, 50) FROM t1' failed: ER_UNKNOWN_STORAGE_ENGINE (1286): Unknown storage engine 'InnoDB'
      ...
      2026-05-27 13:30:41 0 [Note] InnoDB: Completed initialization of buffer pool
      2026-05-27 13:30:41 0 [ERROR] InnoDB: Missing FILE_CHECKPOINT(12572868) at 13422478
      2026-05-27 13:30:41 0 [ERROR] InnoDB: Log scan aborted at LSN 13422478
      2026-05-27 13:30:41 0 [ERROR] InnoDB: Plugin initialization aborted at srv0start.cc[1606] with error Generic error
      2026-05-27 13:30:41 0 [Note] InnoDB: Starting shutdown...
      2026-05-27 13:30:41 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
      

      The failure is reproducible for both the PMEM and pwrite(2) based log write paths.

      Attachments

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              marko Marko Mäkelä
              Marko Mäkelä Marko Mäkelä
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 1d 6h 4m
                  1d 6h 4m
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 5h 5m Time Not Required
                  5h 5m

                  Git Integration

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