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

Server aborts on crash recovery after an interrupted instant ALTER TABLE reorders/drops columns

    XMLWordPrintable

Details

    • Can result in hang or crash

    Description

        --source include/have_innodb.inc
        --source include/have_debug_sync.inc
        # A kill after an instant column reorder updated SYS_COLUMNS and SYS_TABLES,
        # but before it updated the metadata record. With innodb_force_recovery=4
        # the DDL transaction is not rolled back, and DDL recovery must not crash.
        CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c INT) ENGINE=InnoDB;
        ALTER TABLE t1 MODIFY c INT FIRST, ALGORITHM=INSTANT;
        --connect (con1,localhost,root)
        # Stop after the 4th update: 3 SYS_COLUMNS deletes, then SYS_TABLES
        SET DEBUG_SYNC='after_row_upd_clust SIGNAL s WAIT_FOR go EXECUTE 4';
        --send ALTER TABLE t1 MODIFY b INT FIRST, ALGORITHM=INSTANT
        --connection default
        --let $n= 3
        while ($n)
        {
          SET DEBUG_SYNC='now WAIT_FOR s';
          SET DEBUG_SYNC='now SIGNAL go';
          --dec $n
        }
        SET DEBUG_SYNC='now WAIT_FOR s';
        FLUSH ENGINE LOGS;
        --source include/kill_mysqld.inc
        --disconnect con1
        --let $restart_parameters= --innodb-force-recovery=4
        --source include/start_mysqld.inc
        SELECT * FROM t1;
        --let $restart_parameters=
        --source include/restart_mysqld.inc
        DROP TABLE t1;
      

      Leads to:

      ES 10.6.29-25 4cdc4f0b741fd1a3cc3fc34c7dc197a5b12c65cc (Debug, Clang 22.1.8-20260621) Build 12/10/2026

      mariadbd: /test/10.6-es_dbg/storage/innobase/dict/dict0load.cc:2523: dict_table_t *dict_load_table_one(const span<const char> &, dict_err_ignore_t, dict_names_t &): Assertion `!table || (ignore_err & ~DICT_ERR_IGNORE_FK_NOKEY) || !table->is_readable() || !table->corrupted' failed.
      

      ES 10.6.29-25 4cdc4f0b741fd1a3cc3fc34c7dc197a5b12c65cc (Debug, Clang 22.1.8-20260621) Build 12/10/2026

      Core was generated by `/test/EMD121026-mariadb-10.6.29-25-linux-x86_64-dbg/bin/mariadbd --defaults-gro'.
      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 546840)]
      (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  0x00007f7bcc04527e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x00007f7bcc0288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x00007f7bcc02881b in __assert_fail_base (fmt=0x7f7bcc1d1208 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x59eb6cd7295a "!table || (ignore_err & ~DICT_ERR_IGNORE_FK_NOKEY) || !table->is_readable() || !table->corrupted", file=file@entry=0x59eb6cd719c1 "/test/10.6-es_dbg/storage/innobase/dict/dict0load.cc", line=line@entry=2523, function=function@entry=0x59eb6cd72619 "dict_table_t *dict_load_table_one(const span<const char> &, dict_err_ignore_t, dict_names_t &)")at ./assert/assert.c:96
      #6  0x00007f7bcc03b517 in __assert_fail (assertion=0x59eb6cd7295a "!table || (ignore_err & ~DICT_ERR_IGNORE_FK_NOKEY) || !table->is_readable() || !table->corrupted", file=0x59eb6cd719c1 "/test/10.6-es_dbg/storage/innobase/dict/dict0load.cc", line=2523, function=0x59eb6cd72619 "dict_table_t *dict_load_table_one(const span<const char> &, dict_err_ignore_t, dict_names_t &)") at ./assert/assert.c:105
      #7  0x000059eb6c9c5459 in dict_load_table_one (name=@0x7fff8d9fcf78: {data_ = 0x7fff8d9fd2f0 "test/t1", size_ = 7}, ignore_err=DICT_ERR_IGNORE_NONE, fk_tables=std::deque with 0 elements)at /test/10.6-es_dbg/storage/innobase/dict/dict0load.cc:2520
      #8  0x000059eb6c9c3e8d in dict_sys_t::load_table (this=0x59eb6d48d780 <dict_sys>, name=@0x7fff8d9fcf78: {data_ = 0x7fff8d9fd2f0 "test/t1", size_ = 7}, ignore=DICT_ERR_IGNORE_NONE)at /test/10.6-es_dbg/storage/innobase/dict/dict0load.cc:2554
      #9  0x000059eb6c9ae853 in dict_table_open_on_name (table_name=0x7fff8d9fd2f0 "test/t1", dict_locked=false, ignore_err=DICT_ERR_IGNORE_NONE)at /test/10.6-es_dbg/storage/innobase/dict/dict0dict.cc:1105
      #10 0x000059eb6c68fea5 in innodb_check_version (hton=0x59eb747547c8, path=0x7fff8d9fdc80 "./test/t1", version=0x7fff8d9fd778, create_id=27)at /test/10.6-es_dbg/storage/innobase/handler/ha_innodb.cc:1954
      #11 0x000059eb6c066195 in ddl_log_execute_action (thd=0x59eb7490b778, mem_root=0x7fff8d9fdeb0, ddl_log_entry=0x7fff8d9fdf00)at /test/10.6-es_dbg/sql/ddl_log.cc:2045
      #12 0x000059eb6c0611bc in ddl_log_execute_entry_no_lock (thd=0x59eb7490b778, first_entry=3) at /test/10.6-es_dbg/sql/ddl_log.cc:2426
      #13 0x000059eb6c06176a in ddl_log_execute_recovery ()at /test/10.6-es_dbg/sql/ddl_log.cc:2798
      #14 0x000059eb6bdf0539 in init_server_components ()at /test/10.6-es_dbg/sql/mysqld.cc:5449
      #15 0x000059eb6bdecbba in mysqld_main (argc=157, argv=0x59eb746d2eb0)at /test/10.6-es_dbg/sql/mysqld.cc:5815
      #16 0x000059eb6bdea0d2 in main (argc=24, argv=0x7fff8da003c8)at /test/10.6-es_dbg/sql/main.cc:34
      

      Bug Detection Matrix

          Rel    o/d  Build   Commit                                    UniqueID observed             
      CS  10.11  dbg  121026  7aecfef1072045404167edaaba4656edf218a7a8  !table || (ignore_err & ~DICT_ERR_IGNORE_FK_NOKEY) || !table->is_readable() || !table->corrupted|SIGABRT|dict_load_table_one|dict_sys_t::load_table|dict_table_open_on_name|innodb_check_version
      CS  10.11  opt  121026  7aecfef1072045404167edaaba4656edf218a7a8  No bug found                  
      CS  11.4   dbg  121026  fd85202eb2f866bac7117b5a4542b76f438e2780  !table || (ignore_err & ~DICT_ERR_IGNORE_FK_NOKEY) || !table->is_readable() || !table->corrupted|SIGABRT|dict_load_table_one|dict_sys_t::load_table|dict_table_open_on_name|innodb_check_version
      CS  11.4   opt  121026  fd85202eb2f866bac7117b5a4542b76f438e2780  No bug found                  
      CS  11.8   dbg  121026  14362356d14b80242d60dceb9b34f988bbcc9945  !table || (ignore_err & ~DICT_ERR_IGNORE_FK_NOKEY) || !table->is_readable() || !table->corrupted|SIGABRT|dict_load_table_one|dict_sys_t::load_table|dict_table_open_on_name|innodb_check_version
      CS  11.8   opt  121026  14362356d14b80242d60dceb9b34f988bbcc9945  No bug found                  
      CS  12.3   dbg  121026  5e1d303aa6acf34c09309a9d64d750f20fc1921d  !table || (ignore_err & ~DICT_ERR_IGNORE_FK_NOKEY) || !table->is_readable() || !table->corrupted|SIGABRT|dict_load_table_one|dict_sys_t::load_table|dict_table_open_on_name|innodb_check_version
      CS  12.3   opt  121026  5e1d303aa6acf34c09309a9d64d750f20fc1921d  No bug found                  
      CS  13.0   dbg  121026  620a4b5624222048fece7fe1789978ae0675cae2  !table || (ignore_err & ~DICT_ERR_IGNORE_FK_NOKEY) || !table->is_readable() || !table->corrupted|SIGABRT|dict_load_table_one|dict_sys_t::load_table|dict_table_open_on_name|innodb_check_version
      CS  13.0   opt  121026  620a4b5624222048fece7fe1789978ae0675cae2  No bug found                  
      CS  13.2   dbg  121026  cf542109f3389838b4b688b78941797f6a95d51f  !table || (ignore_err & ~DICT_ERR_IGNORE_FK_NOKEY) || !table->is_readable() || !table->corrupted|SIGABRT|dict_load_table_one|dict_sys_t::load_table|dict_table_open_on_name|innodb_check_version
      CS  13.2   opt  121026  cf542109f3389838b4b688b78941797f6a95d51f  No bug found                  
      ES  10.6   dbg  121026  4cdc4f0b741fd1a3cc3fc34c7dc197a5b12c65cc  !table || (ignore_err & ~DICT_ERR_IGNORE_FK_NOKEY) || !table->is_readable() || !table->corrupted|SIGABRT|dict_load_table_one|dict_sys_t::load_table|dict_table_open_on_name|innodb_check_version
      ES  10.6   opt  121026  4cdc4f0b741fd1a3cc3fc34c7dc197a5b12c65cc  No bug found                  
      ES  11.4   dbg  121026  f1a52e7bb41922f37759b2d6a7d7dbd6b779dd40  !table || (ignore_err & ~DICT_ERR_IGNORE_FK_NOKEY) || !table->is_readable() || !table->corrupted|SIGABRT|dict_load_table_one|dict_sys_t::load_table|dict_table_open_on_name|innodb_check_version
      ES  11.4   opt  121026  f1a52e7bb41922f37759b2d6a7d7dbd6b779dd40  No bug found                  
      ES  11.8   dbg  121026  2b449b705bc9223b003a05bed300873361e5e970  !table || (ignore_err & ~DICT_ERR_IGNORE_FK_NOKEY) || !table->is_readable() || !table->corrupted|SIGABRT|dict_load_table_one|dict_sys_t::load_table|dict_table_open_on_name|innodb_check_version
      ES  11.8   opt  121026  2b449b705bc9223b003a05bed300873361e5e970  No bug found                  
      ES  12.3   dbg  121026  b09ac90250cf897f23f243954754ed88c57f4f31  !table || (ignore_err & ~DICT_ERR_IGNORE_FK_NOKEY) || !table->is_readable() || !table->corrupted|SIGABRT|dict_load_table_one|dict_sys_t::load_table|dict_table_open_on_name|innodb_check_version
      ES  12.3   opt  121026  b09ac90250cf897f23f243954754ed88c57f4f31  No bug found                  
      

      Attachments

        Activity

          People

            alessandro.vetere Alessandro Vetere
            saahil Saahil Alam
            Alessandro Vetere Alessandro Vetere
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - 0d
                0d
                Remaining:
                Time Spent - 3.5h Remaining Estimate - 3h
                3h
                Logged:
                Time Spent - 3.5h Remaining Estimate - 3h
                3.5h

                Git Integration

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