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

Conflict between innodb_defragment and ALTER TABLE

    XMLWordPrintable

Details

    • Can result in hang or crash

    Description

      Assertion found on debug build

      origin/10.11 9aca89fa9f3b78074fd360cd229abb349fb6b572

      # 2025-09-17T17:06:46 [3345048] | mariadbd: /data/Server/10.11D/storage/innobase/handler/handler0alter.cc:11728: virtual bool ha_innobase::commit_inplace_alter_table(TABLE*, Alter_inplace_info*, bool): Assertion `ctx->new_table->get_ref_count() == 1' failed.
      

      StackTrace

      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=125082942207552) at ./nptl/pthread_kill.c:44
      #1  __pthread_kill_internal (signo=6, threadid=125082942207552) at ./nptl/pthread_kill.c:78
      #2  __GI___pthread_kill (threadid=125082942207552, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
      #3  __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
      #4  __GI_abort () at ./stdlib/abort.c:79
      #5  __assert_fail_base (fmt="%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion="ctx->new_table->get_ref_count() == 1", file="/data/Server/10.11D/storage/innobase/handler/handler0alter.cc", line=11728, 
          function=<optimized out>) at ./assert/assert.c:92
      #6  __GI___assert_fail (assertion="ctx->new_table->get_ref_count() == 1", file="/data/Server/10.11D/storage/innobase/handler/handler0alter.cc", line=11728, 
          function="virtual bool ha_innobase::commit_inplace_alter_table(TABLE*, Alter_inplace_info*, bool)") at ./assert/assert.c:101
      #7  ha_innobase::commit_inplace_alter_table (this=<optimized out>, altered_table=, ha_alter_info=, commit=true) at /data/Server/10.11D/storage/innobase/handler/handler0alter.cc:11728
      #8  handler::ha_commit_inplace_alter_table (this=, altered_table=altered_table@entry=, ha_alter_info=ha_alter_info@entry=, commit=commit@entry=true) at /data/Server/10.11D/sql/handler.cc:5431
      #9  mysql_inplace_alter_table (thd=thd@entry=, table_list=, table=table@entry=, altered_table=altered_table@entry=, ha_alter_info=ha_alter_info@entry=, target_mdl_request=target_mdl_request@entry=, ddl_log_state=, 
          trigger_param=, alter_ctx=, partial_alter=false, start_alter_id=0, if_exists=false) at /data/Server/10.11D/sql/sql_table.cc:8190
      #10 mysql_alter_table (thd=thd@entry=, new_db=new_db@entry=, new_name=<optimized out>, create_info=create_info@entry=, table_list=<optimized out>, table_list@entry=, recreate_info=recreate_info@entry=, 
          alter_info=<optimized out>, order_num=<optimized out>, order=<optimized out>, ignore=<optimized out>, if_exists=<optimized out>) at /data/Server/10.11D/sql/sql_table.cc:11404
      #11 Sql_cmd_alter_table::execute (this=<optimized out>, thd=) at /data/Server/10.11D/sql/sql_alter.cc:688
      #12 mysql_execute_command (thd=thd@entry=, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /data/Server/10.11D/sql/sql_parse.cc:6165
      #13 mysql_parse (thd=thd@entry=, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=) at /data/Server/10.11D/sql/sql_parse.cc:8180
      #14 dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=, packet=packet@entry="ALTER TABLE `t7` ENCRYPTION_KEY_ID=2 /* E_R Thread7 QNO 11 CON_ID 22 */ ", packet_length=packet_length@entry=72, 
          blocking=blocking@entry=true) at /data/Server/10.11D/sql/sql_parse.cc:1906
      #15 do_command (thd=thd@entry=, blocking=blocking@entry=true) at /data/Server/10.11D/sql/sql_parse.cc:1419
      #16 do_handle_one_connection (connect=<optimized out>, connect@entry=, put_in_cache=put_in_cache@entry=true) at /data/Server/10.11D/sql/sql_connect.cc:1475
      #17 handle_one_connection (arg=) at /data/Server/10.11D/sql/sql_connect.cc:1387
      #18 start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #19 clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:100
      

      RR trace is present on pluto:-
      /data/results/1758109426/TBR-2333

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:

                Git Integration

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