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

Race condition between checkpoint and .ibd file creation

    XMLWordPrintable

Details

    • Can result in unexpected behaviour
    • If the server was killed during an operation that creates a .ibd file, such as TRUNCATE TABLE, it could fail to recover.

    Description

      Assertion found on debug build
      Leads to :

      origin/10.6 e80998281aa1551f12a6b86cb3765796130d822d

      # 2025-10-29T12:47:56 [1973044] | mariadbd: /data/Server/10.6B/storage/innobase/os/os0file.cc:1363: bool os_file_rename_func(const char*, const char*): Assertion `!exists' 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="!exists", file=file@entry="/data/Server/10.6B/storage/innobase/os/os0file.cc", line=line@entry=1363,
          function=function@entry="bool os_file_rename_func(const char*, const char*)") at ./assert/assert.c:94
      #6  __assert_fail (assertion="!exists", file="/data/Server/10.6B/storage/innobase/os/os0file.cc", line=1363, function="bool os_file_rename_func(const char*, const char*)") at ./assert/assert.c:103
      #7  os_file_rename_func (oldpath=oldpath@entry="./test/#sql-ib499.ibd", newpath=newpath@entry="./test/t1.ibd") at /data/Server/10.6B/storage/innobase/os/os0file.cc:1363
      #8  mtr_t::commit_file (this=this@entry=, space=..., name=name@entry="./test/t1.ibd") at /data/Server/10.6B/storage/innobase/mtr/mtr0mtr.cc:395
      #9  fil_space_t::rename (this=, path=path@entry="./test/t1.ibd", log=log@entry=true, replace=replace@entry=true) at /data/Server/10.6B/storage/innobase/fil/fil0fil.cc:1817
      #10 dict_table_t::rename_tablespace (this=this@entry=, new_name=..., replace=replace@entry=true) at /data/Server/10.6B/storage/innobase/dict/dict0dict.cc:1525
      #11 row_undo_ins_parse_undo_rec (node=node@entry=, dict_locked=dict_locked@entry=true) at /data/Server/10.6B/storage/innobase/row/row0uins.cc:438
      #12 row_undo_ins (node=node@entry=, thr=thr@entry=) at /data/Server/10.6B/storage/innobase/row/row0uins.cc:579
      #13 row_undo (node=node@entry=, thr=thr@entry=) at /data/Server/10.6B/storage/innobase/row/row0undo.cc:401
      #14 row_undo_step (thr=thr@entry=) at /data/Server/10.6B/storage/innobase/row/row0undo.cc:442
      #15 que_thr_step (thr=thr@entry=) at /data/Server/10.6B/storage/innobase/que/que0que.cc:551
      #16 que_run_threads_low (thr=thr@entry=) at /data/Server/10.6B/storage/innobase/que/que0que.cc:609
      #17 que_run_threads (thr=) at /data/Server/10.6B/storage/innobase/que/que0que.cc:629
      #18 trx_rollback_active (trx=trx@entry=) at /data/Server/10.6B/storage/innobase/trx/trx0roll.cc:303
      #19 trx_rollback_recovered (all=all@entry=false) at /data/Server/10.6B/storage/innobase/trx/trx0roll.cc:443
      #20 srv_start (create_new_db=<optimized out>) at /data/Server/10.6B/storage/innobase/srv/srv0start.cc:1868
      #21 innodb_init (p=<optimized out>) at /data/Server/10.6B/storage/innobase/handler/ha_innodb.cc:4340
      #22 ha_initialize_handlerton (plugin_=) at /data/Server/10.6B/sql/handler.cc:664
      #23 plugin_do_initialize (plugin=plugin@entry=, state=4) at /data/Server/10.6B/sql/sql_plugin.cc:1456
      #24 plugin_initialize (tmp_root=tmp_root@entry=, plugin=plugin@entry=, argc=argc@entry=<remaining_argc>, argv=argv@entry=, options_only=false) at /data/Server/10.6B/sql/sql_plugin.cc:1510
      #25 plugin_init (argc=argc@entry=<remaining_argc>, argv=<optimized out>, flags=0) at /data/Server/10.6B/sql/sql_plugin.cc:1766
      #26 init_server_components () at /data/Server/10.6B/sql/mysqld.cc:5119
      #27 mysqld_main (argc=<optimized out>, argv=<optimized out>) at /data/Server/10.6B/sql/mysqld.cc:5762
      #28 main (argc=<optimized out>, argv=<optimized out>) at /data/Server/10.6B/sql/main.cc:34
      

      RR trace is present on SDP:-
      /data/results/1761765882/TBR-1043

      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:
                Resolved:

                Git Integration

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