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

Race condition between TRUNCATE and innodb_encrypt_tables

    XMLWordPrintable

Details

    • Can result in unexpected behaviour

    Description

      Assertion found on debug build
      Leads to :-

      origin/10.11 2f5bad2f2bbe1c43bf796edb67b93fc64d3c3157

      # 2025-10-14T19:07:01 [535093] | mariadbd: /data/Server/10.11E/storage/innobase/fil/fil0fil.cc:861: void fil_space_free_low(fil_space_t*): Assertion `srv_fast_shutdown == 2 || !srv_was_started || space->max_lsn == 0' failed.
      

      StackTrace

       
      #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  __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=assertion@entry="srv_fast_shutdown == 2 || !srv_was_started || space->max_lsn == 0", 
          file=file@entry="/data/Server/10.11E/storage/innobase/fil/fil0fil.cc", line=line@entry=861, function=function@entry="void fil_space_free_low(fil_space_t*)") at ./assert/assert.c:94
      #6  __assert_fail (assertion="srv_fast_shutdown == 2 || !srv_was_started || space->max_lsn == 0", file="/data/Server/10.11E/storage/innobase/fil/fil0fil.cc", line=861, 
          function="void fil_space_free_low(fil_space_t*)") at ./assert/assert.c:103
      #7  fil_space_free_low (space=) at /data/Server/10.11E/storage/innobase/fil/fil0fil.cc:861
      #8  fil_delete_tablespace (id=196) at /data/Server/10.11E/storage/innobase/fil/fil0fil.cc:1637
      #9  trx_t::commit (this=this@entry=, deleted=std::__debug::vector of length 0, capacity 0) at /data/Server/10.11E/storage/innobase/dict/drop.cc:281
      #10 ha_innobase::truncate (this=) at /data/Server/10.11E/storage/innobase/handler/ha_innodb.cc:14026
      #11 handler::ha_truncate (this=) at /data/Server/10.11E/sql/handler.cc:5267
      #12 Sql_cmd_truncate_table::handler_truncate (this=this@entry=, thd=thd@entry=, table_ref=table_ref@entry=, is_tmp_table=is_tmp_table@entry=false) at /data/Server/10.11E/sql/sql_truncate.cc:255
      #13 Sql_cmd_truncate_table::truncate_table (this=this@entry=, thd=thd@entry=, table_ref=table_ref@entry=) at /data/Server/10.11E/sql/sql_truncate.cc:536
      #14 Sql_cmd_truncate_table::execute (this=, thd=) at /data/Server/10.11E/sql/sql_truncate.cc:602
      #15 mysql_execute_command (thd=thd@entry=, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /data/Server/10.11E/sql/sql_parse.cc:6169
      #16 mysql_parse (thd=thd@entry=, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=) at /data/Server/10.11E/sql/sql_parse.cc:8184
      #17 dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=, packet=packet@entry=" TRUNCATE `table100_innodb_default_int`  /* E_R Thread28 QNO 63 CON_ID 42 */ ", packet_length=packet_length@entry=77, 
          blocking=blocking@entry=true) at /data/Server/10.11E/sql/sql_parse.cc:1906
      #18 do_command (thd=thd@entry=, blocking=blocking@entry=true) at /data/Server/10.11E/sql/sql_parse.cc:1419
      #19 do_handle_one_connection (connect=<optimized out>, connect@entry=, put_in_cache=put_in_cache@entry=true) at /data/Server/10.11E/sql/sql_connect.cc:1475
      #20 handle_one_connection (arg=) at /data/Server/10.11E/sql/sql_connect.cc:1387
      #21 start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:447
      #22 clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:100
      

      RR trace is present on SDP:-
      /data/results/1760480250/TBR-2338

      Attachments

        Activity

          People

            thiru Thirunarayanan Balathandayuthapani
            saahil Saahil Alam
            Thirunarayanan Balathandayuthapani Thirunarayanan Balathandayuthapani
            Marko Mäkelä Marko Mäkelä
            Saahil Alam 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.