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

InnoDB fails to reject invalid innodb_log_recovery_target

    XMLWordPrintable

Details

    • Can result in unexpected behaviour
    • The bound for invalid innodb_log_recovery_target was off by a few bytes.

    Description

      --source include/have_innodb.inc
      --source include/have_debug.inc
      call mtr.add_suppression("cannot fulfill innodb_log_recovery_target|Plugin initialization aborted|'InnoDB' registration as a STORAGE ENGINE failed");
      SET GLOBAL innodb_log_archive=ON;
      SET GLOBAL debug_dbug='+d,ib_log_checkpoint_avoid';
      CREATE TABLE t(a INT) ENGINE=InnoDB;
      --let $target= `SELECT VARIABLE_VALUE - 1 FROM information_schema.GLOBAL_STATUS WHERE VARIABLE_NAME='INNODB_LSN_CURRENT'`
      --source include/kill_mysqld.inc
      --let $restart_parameters= --innodb-log-archive=ON --innodb-log-recovery-target=$target
      --source include/start_mysqld.inc
      --let $e= `SELECT COUNT(*) FROM information_schema.ENGINES WHERE ENGINE='InnoDB' AND SUPPORT<>'NO'`
      --let $restart_parameters= --innodb-log-archive=ON
      --source include/restart_mysqld.inc
      SET GLOBAL innodb_log_archive=OFF;
      DROP TABLE t;
      if ($e) {
        --die InnoDB started although innodb_log_recovery_target is inside the last mini-transaction
      }
      

      Leads to :

      CS 13.2.0 cf542109f3389838b4b688b78941797f6a95d51f (Debug, Clang 22.1.8-20260621) Build 12/10/2026

      mariadbd: /test/13.1_dbg/storage/innobase/log/log0log.cc:1590: void log_t::persist(lsn_t): Assertion `is_mmap_writeable()' failed.
      

      CS 13.2.0 cf542109f3389838b4b688b78941797f6a95d51f (Debug, Clang 22.1.8-20260621) Build 12/10/2026

      Core was generated by `/test/MD121026-mariadb-13.2.0-linux-x86_64-dbg/bin/mariadbd --defaults-group-su'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
       
      [Current thread is 1 (LWP 1018274)]
      (gdb) bt
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
      #1  __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
      #2  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
      #3  0x0000740be0c4527e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x0000740be0c288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x0000740be0c2881b in __assert_fail_base (fmt=0x740be0dd1208 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x60bfcb5753a4 "is_mmap_writeable()", file=file@entry=0x60bfcb56ad8d "/test/13.1_dbg/storage/innobase/log/l
      og0log.cc", line=line@entry=1590, function=function@entry=0x60bfcb56b85e "void log_t::persist(lsn_t)")at ./assert/assert.c:96
      #6  0x0000740be0c3b517 in __assert_fail (assertion=0x60bfcb5753a4 "is_mmap_writeable()", file=0x60bfcb56ad8d "/test/13.1_dbg/storage/innobase/log/log0log.cc", line=1590, function=0x60bfcb56b85e "void log_t::persist(lsn_t)")at ./assert/assert.c
      :105
      #7  0x000060bfcac9b081 in log_t::persist (this=0x60bfcc93a180 <log_sys>, lsn=56031) at /test/13.1_dbg/storage/innobase/log/log0log.cc:1590
      #8  0x000060bfcac9c15c in log_write_persist (lsn=56031)at /test/13.1_dbg/storage/innobase/log/log0log.cc:1624
      #9  0x000060bfcac9bdba in log_write_up_to (lsn=56031, durable=true, callback=0x0) at /test/13.1_dbg/storage/innobase/log/log0log.cc:1847
      #10 0x000060bfcaf0c8fe in buf_dblwr_t::flush_buffered_writes_completed (this=0x60bfcc95fb88 <buf_dblwr>, request=@0x60bfced3df40: {bpage = 0x0, slot = 0x0, node = 0x60bfced8bfb0, type = IORequest::DBLWR_BATCH})at /test/13.1_dbg/storage/innobas
      e/buf/buf0dblwr.cc:764
      #11 0x000060bfcaf8ee51 in IORequest::write_complete (this=0x60bfced3df40, io_error=0) at /test/13.1_dbg/storage/innobase/fil/fil0fil.cc:2934
      #12 0x000060bfcad0a6e8 in write_io_callback (c=0x60bfced3de98)at /test/13.1_dbg/storage/innobase/os/os0file.cc:3071
      #13 0x000060bfcb0440c2 in tpool::task_group::execute (this=0x60bfced3dd10, t=0x60bfced3df20) at /test/13.1_dbg/tpool/task_group.cc:73
      #14 0x000060bfcb044618 in tpool::task::execute (this=0x60bfced3df20)at /test/13.1_dbg/tpool/task.cc:32
      #15 0x000060bfcb03d938 in tpool::thread_pool_generic::worker_main (this=0x60bfcecdac20, thread_var=0x60bfcecdaef0)at /test/13.1_dbg/tpool/tpool_generic.cc:531
      #16 0x000060bfcb041f6d in std::__invoke_impl<void, void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*>(__f=@0x740bb8000d08: (void (tpool::thread_pool_generic::*)(class tpool::thread_pool
      _generic * const, struct tpool::worker_data *)) 0x60bfcb03d840 <tpool::thread_pool_generic::worker_main(tpool::worker_data*)>, __t=@0x740bb8000d00: 0x60bfcecdac20, __args=@0x740bb8000cf8: 0x60bfcecdaef0)at /usr/lib/gcc/x86_64-linux-gnu/13/../.
      ./../../include/c++/13/bits/invoke.h:74
      #17 0x000060bfcb041e95 in std::__invoke<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> (__fn=@0x740bb8000d08: (void (tpool::thread_pool_generic::*)(class tpool::thread_pool_generic 
      * const, struct tpool::worker_data *)) 0x60bfcb03d840 <tpool::thread_pool_generic::worker_main(tpool::worker_data*)>, __args=@0x740bb8000cf8: 0x60bfcecdaef0, __args=@0x740bb8000cf8: 0x60bfcecdaef0)at /usr/lib/gcc/x86_64-linux-gnu/13/../../../.
      ./include/c++/13/bits/invoke.h:96
      #18 0x000060bfcb041e63 in std::thread::_Invoker<std::tuple<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> >::_M_invoke<0ul, 1ul, 2ul> (this=0x740bb8000cf8)at /usr/lib/gcc/x86_64-lin
      ux-gnu/13/../../../../include/c++/13/bits/std_thread.h:292
      #19 0x000060bfcb041e15 in std::thread::_Invoker<std::tuple<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> >::operator() (this=0x740bb8000cf8)at /usr/lib/gcc/x86_64-linux-gnu/13/../.
      ./../../include/c++/13/bits/std_thread.h:299
      #20 0x000060bfcb041c89 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> > >::_M_run (this=0x740bb8000cf0)at /usr/lib/gcc/x
      86_64-linux-gnu/13/../../../../include/c++/13/bits/std_thread.h:244
      #21 0x0000740be10ecdb4 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
      #22 0x0000740be0c9cb84 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #23 0x0000740be0d29ecc in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Attachments

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              saahil Saahil Alam
              Marko Mäkelä Marko Mäkelä
              Alessandro Vetere Alessandro Vetere
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 0d
                  0d
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 1d
                  1d

                  Git Integration

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