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

InnoDB: Failing assertion: doc_id == src_node->last_doc_id

    XMLWordPrintable

Details

    • Can result in hang or crash
    • Q3/2026 Server Development

    Description

      --source include/have_innodb.inc
      --source include/have_sequence.inc
       
      CREATE TABLE t1 ( id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, body MEDIUMTEXT,FULLTEXT KEY ftidx (body)) ENGINE=InnoDB;
      INSERT INTO t1 (body) SELECT REPEAT('megaword ', 30) FROM seq_1_to_260;
      SET GLOBAL innodb_optimize_fulltext_only = ON;
      DELETE FROM t1 WHERE id = 1;
      OPTIMIZE TABLE t1;
      

      Lead to

      MDEV-28730 CS 13.1.0 81c3836bb2ba0823fe69fd6953c21fccf6476b92 (Optimized, Clang 18.1.3-11) Build 04/08/2026

      InnoDB: Failing assertion: doc_id == src_node->last_doc_id
      

      MDEV-28730 CS 13.1.0 81c3836bb2ba0823fe69fd6953c21fccf6476b92 (Optimized, Clang 18.1.3-11) Build 04/08/2026

      Core was generated by `/test/mtest/MDEV-28730/MD040826-mariadb-13.1.0-linux-x86_64-opt/bin/mariadbd --'.
      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 3699363)]
      (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  0x00007f751704527e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x00007f75170288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x00005f3fba6ea20c in ut_dbg_assertion_failed (expr=0x5f3fbb2cfe38 "doc_id == src_node->last_doc_id", file=0x5f3fbb2cfa1e "/test/mtest/MDEV-28730/server_opt/storage/innobase/fts/fts0opt.cc", line=925)at /test/mtest/MDEV-28730/server_opt/storage/innobase/ut/ut0dbg.cc:60
      #6  0x00005f3fbaf6f269 in fts_optimize_compact (executor=<optimized out>, optim=<optimized out>, index=<optimized out>, start_time=<optimized out>)at /test/mtest/MDEV-28730/server_opt/storage/innobase/fts/fts0opt.cc:1668
      #7  fts_optimize_words (executor=0x7f751407f500, optim=0x7774000280e8, index=0x777400029398, word=0x7f751407f290)at /test/mtest/MDEV-28730/server_opt/storage/innobase/fts/fts0opt.cc:1328
      #8  fts_optimize_index (executor=0x7f751407f500, optim=0x7774000280e8, index=0x777400029398)at /test/mtest/MDEV-28730/server_opt/storage/innobase/fts/fts0opt.cc:1486
      #9  fts_optimize_indexes (executor=executor@entry=0x7f751407f500, optim=optim@entry=0x7774000280e8)at /test/mtest/MDEV-28730/server_opt/storage/innobase/fts/fts0opt.cc:1656
      #10 0x00005f3fbaf6d6ed in fts_optimize_table (table=0x777400025c48, thd=thd@entry=0x777400000c70)at /test/mtest/MDEV-28730/server_opt/storage/innobase/fts/fts0opt.cc:1838
      #11 0x00005f3fbade4ff0 in ha_innobase::optimize (this=0x777400023c10, thd=0x777400000c70)at /test/mtest/MDEV-28730/server_opt/storage/innobase/handler/ha_innodb.cc:15515
      #12 0x00005f3fba9b6fc2 in mysql_admin_table (thd=thd@entry=0x777400000c70, tables=tables@entry=0x777400017cc0, check_opt=check_opt@entry=0x7774000065d0, operator_name=0x5f3fbb9d0d88 <msg_optimize>, lock_type=lock_type@entry=TL_WRITE, org_open_for_modify=true, no_errors_from_open=<optimized out>, extra_open_options=0, prepare_func=0x0, operator_func=(int (handler::*)(class handler * const, class THD *, HA_CHECK_OPT *)) 0x5f3fbab02090 <handler::ha_optimize(THD*, st_ha_check_opt*)>, view_operator_func=0x0, is_cmd_replicated=<optimized out>)at /test/mtest/MDEV-28730/server_opt/sql/sql_admin.cc:949
      #13 0x00005f3fba9b81a3 in Sql_cmd_optimize_table::execute (this=<optimized out>, thd=0x777400000c70)at /test/mtest/MDEV-28730/server_opt/sql/sql_admin.cc:1730
      #14 0x00005f3fba88348b in mysql_execute_command (thd=thd@entry=0x777400000c70, is_called_from_prepared_stmt=false)at /test/mtest/MDEV-28730/server_opt/sql/sql_parse.cc:5905
      #15 0x00005f3fba87edb2 in mysql_parse (thd=thd@entry=0x777400000c70, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x7f7514080580)at /test/mtest/MDEV-28730/server_opt/sql/sql_parse.cc:7958
      #16 0x00005f3fba87d370 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x777400000c70, packet=packet@entry=0x777400008e01 "", packet_length=packet_length@entry=17, blocking=true)at /test/mtest/MDEV-28730/server_opt/sql/sql_parse.cc:1903
      #17 0x00005f3fba87f231 in do_command (thd=thd@entry=0x777400000c70, blocking=true) at /test/mtest/MDEV-28730/server_opt/sql/sql_parse.cc:1437
      #18 0x00005f3fba9a848d in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5f3ff7bd2940, put_in_cache=true)at /test/mtest/MDEV-28730/server_opt/sql/sql_connect.cc:1510
      #19 0x00005f3fba9a82c2 in handle_one_connection (arg=arg@entry=0x5f3ff7bd2940)at /test/mtest/MDEV-28730/server_opt/sql/sql_connect.cc:1422
      #20 0x00005f3fbad4b033 in pfs_spawn_thread (arg=0x5f3ff7bf3300)at /test/mtest/MDEV-28730/server_opt/storage/perfschema/pfs.cc:2198
      #21 0x00007f751709cb84 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #22 0x00007f7517129d6c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      MDEV-28730 CS 13.1.0 81c3836bb2ba0823fe69fd6953c21fccf6476b92 (Debug, Clang 18.1.3-11) Build 04/08/2026

      mariadbd: /test/mtest/MDEV-28730/server_dbg/storage/innobase/include/fts0vlc.h:106: doc_id_t fts_decode_vlc(const byte **): Assertion `*start' failed.
      

      MDEV-28730 CS 13.1.0 81c3836bb2ba0823fe69fd6953c21fccf6476b92 (Debug, Clang 18.1.3-11) Build 04/08/2026

      Core was generated by `/test/mtest/MDEV-28730/MD040826-mariadb-13.1.0-linux-x86_64-dbg/bin/mariadbd --'.
      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 3658595)]
      (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  0x000075592ca4527e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x000075592ca288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x000075592ca2881b in __assert_fail_base (fmt=0x75592cbd01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x57bc080d9d60 "*start", file=file@entry=0x57bc080d9d1b "/test/mtest/MDEV-28730/server_dbg/storage/innobase/include/fts0vlc.h", line=line@entry=106, function=function@entry=0x57bc080d9d67 "doc_id_t fts_decode_vlc(const byte **)") at ./assert/assert.c:96
      #6  0x000075592ca3b517 in __assert_fail (assertion=0x57bc080d9d60 "*start", file=0x57bc080d9d1b "/test/mtest/MDEV-28730/server_dbg/storage/innobase/include/fts0vlc.h", line=106, function=0x57bc080d9d67 "doc_id_t fts_decode_vlc(const byte **)")at ./assert/assert.c:105
      #7  0x000057bc0771a8d2 in fts_decode_vlc (ptr=0x75590448e408)at include/fts0vlc.h:106
      #8  0x000057bc07b14c42 in fts_optimize_node (del_vec=0x6d58140ad128, del_pos=0x75590448e3ec, dst_node=0x6d58140af720, src_node=0x6d58140ae878, enc=0x75590448e400)at /test/mtest/MDEV-28730/server_dbg/storage/innobase/fts/fts0opt.cc:865
      #9  0x000057bc07b146d8 in fts_optimize_word (optim=0x6d58140a5ec8, word=0x6d58140a6198)at /test/mtest/MDEV-28730/server_dbg/storage/innobase/fts/fts0opt.cc:1016
      #10 0x000057bc07b1450a in fts_optimize_compact (executor=0x75590448e7a0, optim=0x6d58140a5ec8, index=0x6d5814030018, start_time=1785844566)at /test/mtest/MDEV-28730/server_dbg/storage/innobase/fts/fts0opt.cc:1148
      #11 0x000057bc07b12ec4 in fts_optimize_words (executor=0x75590448e7a0, optim=0x6d58140a5ec8, index=0x6d5814030018, word=0x75590448e560)at /test/mtest/MDEV-28730/server_dbg/storage/innobase/fts/fts0opt.cc:1328
      #12 0x000057bc07b12695 in fts_optimize_index (executor=0x75590448e7a0, optim=0x6d58140a5ec8, index=0x6d5814030018)at /test/mtest/MDEV-28730/server_dbg/storage/innobase/fts/fts0opt.cc:1486
      #13 0x000057bc07b10bfc in fts_optimize_indexes (executor=0x75590448e7a0, optim=0x6d58140a5ec8)at /test/mtest/MDEV-28730/server_dbg/storage/innobase/fts/fts0opt.cc:1656
      #14 0x000057bc07b10388 in fts_optimize_table (table=0x6d581402ce78, thd=0x6d5814000d60)at /test/mtest/MDEV-28730/server_dbg/storage/innobase/fts/fts0opt.cc:1838
      #15 0x000057bc0768156a in ha_innobase::optimize (this=0x6d581404a560, thd=0x6d5814000d60)at /test/mtest/MDEV-28730/server_dbg/storage/innobase/handler/ha_innodb.cc:15515
      #16 0x000057bc072439e7 in handler::ha_optimize (this=0x6d581404a560, thd=0x6d5814000d60, check_opt=0x6d5814006698)at /test/mtest/MDEV-28730/server_dbg/sql/handler.cc:5884
      #17 0x000057bc06fe7106 in mysql_admin_table (thd=0x6d5814000d60, tables=0x6d581401a520, check_opt=0x6d5814006698, operator_name=0x57bc08866e08 <msg_optimize>, lock_type=TL_WRITE, org_open_for_modify=true, no_errors_from_open=false, extra_open_options=0, prepare_func=0x0, operator_func=(int (handler::*)(class handler * const, class THD *, HA_CHECK_OPT *)) 0x57bc072438c0 <handler::ha_optimize(THD*, st_ha_check_opt*)>, view_operator_func=0x0, is_cmd_replicated=true)at /test/mtest/MDEV-28730/server_dbg/sql/sql_admin.cc:949
      #18 0x000057bc06fea241 in Sql_cmd_optimize_table::execute (this=0x6d581401ac80, thd=0x6d5814000d60)at /test/mtest/MDEV-28730/server_dbg/sql/sql_admin.cc:1730
      #19 0x000057bc06ddcd7a in mysql_execute_command (thd=0x6d5814000d60, is_called_from_prepared_stmt=false)at /test/mtest/MDEV-28730/server_dbg/sql/sql_parse.cc:5905
      #20 0x000057bc06dcbed4 in mysql_parse (thd=0x6d5814000d60, rawbuf=0x6d581401a430 "OPTIMIZE TABLE t1", length=17, parser_state=0x755904491a80)at /test/mtest/MDEV-28730/server_dbg/sql/sql_parse.cc:7958
      #21 0x000057bc06dc91fd in dispatch_command (command=COM_QUERY, thd=0x6d5814000d60, packet=0x6d581400b661 "", packet_length=17, blocking=true) at /test/mtest/MDEV-28730/server_dbg/sql/sql_parse.cc:1903
      #22 0x000057bc06dcca83 in do_command (thd=0x6d5814000d60, blocking=true)at /test/mtest/MDEV-28730/server_dbg/sql/sql_parse.cc:1437
      #23 0x000057bc06fccfe9 in do_handle_one_connection (connect=0x57bc130544e0, put_in_cache=true)at /test/mtest/MDEV-28730/server_dbg/sql/sql_connect.cc:1510
      #24 0x000057bc06fccd8e in handle_one_connection (arg=0x57bc130f8060)at /test/mtest/MDEV-28730/server_dbg/sql/sql_connect.cc:1422
      #25 0x000075592ca9cb84 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #26 0x000075592cb29d6c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Attachments

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              ramesh Ramesh Sivaraman
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

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

                  Git Integration

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