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

Assertion `state() == s_committing' failed in int wsrep::transaction::ordered_commit()

    XMLWordPrintable

Details

    Description

      The assertion is similar to MDEV-19973, but the given test case does not crash the 10.4 build.

      # mysqld options required for replay: --log-bin
      CREATE TABLE t (a INT) ENGINE=Aria;
      SET AUTOCOMMIT=0;
      CREATE TABLE t1 (c1 INTEGER);
      REPLACE INTO t VALUES ('1');
      INSERT INTO t1  VALUES ('1');
      ALTER TABLE t ADD c2 INT;
      

      Leads to

      10.5.20 57c526ffb852fb027e25fdc77173d45bdc60b8a2 (Optimized)

      Core was generated by `/test/GAL_MD010323-mariadb-10.5.20-linux-x86_64-opt/bin/mysqld --defaults-file='.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
          at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      [Current thread is 1 (Thread 0x14b3b419b700 (LWP 3686165))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      #1  0x000055dfb253efef in my_write_core (sig=sig@entry=6) at /test/10.5_opt/mysys/stacktrace.c:424
      #2  0x000055dfb20105d0 in handle_fatal_signal (sig=6) at /test/10.5_opt/sql/signal_handler.cc:356
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #5  0x000014b3c8343859 in __GI_abort () at abort.c:79
      #6  0x000014b3c7da1b40 in galera::FSM<galera::TrxHandle::State, galera::TrxHandle::Transition>::shift_to (this=this@entry=0x14b338069848, state=state@entry=galera::TrxHandle::S_COMMITTED, line=line@entry=1434)
          at /usr/include/c++/9/bits/char_traits.h:342
      #7  0x000014b3c7dbf6b9 in galera::TrxHandle::set_state (line=1434, state=galera::TrxHandle::S_COMMITTED, this=0x14b338069840) at /test/galera_4x_opt/galera/src/trx_handle.hpp:602
      #8  galera::TrxHandleSlave::set_state (line=1434, state=galera::TrxHandle::S_COMMITTED, this=0x14b338069840) at /test/galera_4x_opt/galera/src/trx_handle.hpp:602
      #9  galera::ReplicatorSMM::commit_order_leave (this=this@entry=0x55dfb38f6440, ts=..., error=error@entry=0x14b3b4198f00) at /test/galera_4x_opt/galera/src/replicator_smm.cpp:1434
      #10 0x000014b3c7d9dca9 in galera_commit_order_leave (gh=<optimized out>, ws_handle=<optimized out>, meta=<optimized out>, error=0x14b3b4198f00) at /usr/include/c++/9/bits/atomic_base.h:539
      #11 0x000055dfb26c2100 in wsrep::wsrep_provider_v26::commit_order_leave (this=<optimized out>, ws_handle=..., ws_meta=..., err=...) at /test/10.5_opt/wsrep-lib/src/wsrep_provider_v26.cpp:276
      #12 0x000055dfb26b9233 in wsrep::transaction::ordered_commit (this=this@entry=0x14b338006d40) at /test/10.5_opt/wsrep-lib/include/wsrep/server_state.hpp:320
      #13 0x000055dfb2110693 in wsrep::client_state::ordered_commit (this=<optimized out>) at /test/10.5_opt/wsrep-lib/include/wsrep/client_state.hpp:509
      #14 wsrep_ordered_commit (all=<optimized out>, thd=<optimized out>) at /test/10.5_opt/sql/wsrep_trans_observer.h:333
      #15 MYSQL_BIN_LOG::queue_for_group_commit (this=this@entry=0x55dfb2ed8dc0 <mysql_bin_log>, orig_entry=orig_entry@entry=0x14b3b4199090) at /test/10.5_opt/sql/log.cc:8077
      #16 0x000055dfb2115aae in MYSQL_BIN_LOG::write_transaction_to_binlog_events (this=this@entry=0x55dfb2ed8dc0 <mysql_bin_log>, entry=entry@entry=0x14b3b4199090) at /test/10.5_opt/sql/log.cc:8106
      #17 0x000055dfb2116012 in MYSQL_BIN_LOG::write_transaction_to_binlog (this=0x55dfb2ed8dc0 <mysql_bin_log>, thd=0x14b338000c58, cache_mngr=0x14b338054e38, end_ev=<optimized out>, all=<optimized out>, 
          using_stmt_cache=<optimized out>, using_trx_cache=true) at /test/10.5_opt/sql/log.cc:7736
      #18 0x000055dfb2116a21 in binlog_flush_cache (using_trx=true, using_stmt=false, all=true, end_ev=0x14b3b41991c0, cache_mngr=0x14b338054e38, thd=0x14b338000c58) at /test/10.5_opt/sql/log.cc:1772
      #19 binlog_commit_flush_trx_cache (thd=0x14b338000c58, all=<optimized out>, cache_mngr=0x14b338054e38) at /test/10.5_opt/sql/log.cc:1869
      #20 0x000055dfb211860c in binlog_commit (hton=<optimized out>, thd=0x14b338000c58, all=<optimized out>) at /test/10.5_opt/sql/log.cc:2226
      #21 0x000055dfb201116f in commit_one_phase_2 (thd=thd@entry=0x14b338000c58, all=true, trans=0x14b338004240, is_real_trans=<optimized out>) at /test/10.5_opt/sql/handler.cc:1970
      #22 0x000055dfb2013ad8 in ha_commit_one_phase (thd=thd@entry=0x14b338000c58, all=all@entry=true) at /test/10.5_opt/sql/handler.cc:1949
      #23 0x000055dfb2014b55 in ha_commit_trans (thd=thd@entry=0x14b338000c58, all=all@entry=true) at /test/10.5_opt/sql/handler.cc:1743
      #24 0x000055dfb1f1c9e4 in trans_commit_implicit (thd=thd@entry=0x14b338000c58) at /test/10.5_opt/sql/transaction.cc:329
      #25 0x000055dfb1e11790 in mysql_execute_command (thd=0x14b338000c58) at /test/10.5_opt/sql/sql_parse.cc:3816
      #26 0x000055dfb1e016e4 in mysql_parse (thd=thd@entry=0x14b338000c58, rawbuf=rawbuf@entry=0x14b3380104e0 "ALTER TABLE t ADD c2 INT", length=length@entry=24, parser_state=parser_state@entry=0x14b3b419a460, 
          is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_opt/sql/sql_parse.cc:8091
      #27 0x000055dfb1e00f51 in wsrep_mysql_parse (thd=0x14b338000c58, rawbuf=0x14b3380104e0 "ALTER TABLE t ADD c2 INT", length=24, parser_state=0x14b3b419a460, is_com_multi=false, is_next_command=false)
          at /test/10.5_opt/sql/sql_parse.cc:7892
      #28 0x000055dfb1e0edf5 in dispatch_command (command=COM_QUERY, thd=0x14b338000c58, packet=<optimized out>, packet_length=<optimized out>, is_com_multi=<optimized out>, is_next_command=<optimized out>)
          at /test/10.5_opt/sql/sql_parse.cc:1975
      #29 0x000055dfb1e0ffc3 in do_command (thd=0x14b338000c58) at /test/10.5_opt/sql/sql_parse.cc:1375
      #30 0x000055dfb1f0dd1e in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55dfb3d83318, put_in_cache=put_in_cache@entry=true) at /test/10.5_opt/sql/sql_connect.cc:1416
      #31 0x000055dfb1f0dfdd in handle_one_connection (arg=0x55dfb3d83318) at /test/10.5_opt/sql/sql_connect.cc:1318
      #32 0x000014b3c8854609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #33 0x000014b3c8440133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      10.5.20 57c526ffb852fb027e25fdc77173d45bdc60b8a2 (Debug)

      mysqld: /test/10.5_dbg/wsrep-lib/src/transaction.cpp:565: int wsrep::transaction::ordered_commit(): Assertion `state() == s_committing' failed.
      

      10.5.20 57c526ffb852fb027e25fdc77173d45bdc60b8a2 (Debug)

      Core was generated by `/test/GAL_MD010323-mariadb-10.5.20-linux-x86_64-dbg/bin/mysqld --defaults-file='.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
          at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      [Current thread is 1 (Thread 0x145bbc155700 (LWP 1747869))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      #1  0x00005616c3d49852 in my_write_core (sig=sig@entry=6) at /test/10.5_dbg/mysys/stacktrace.c:424
      #2  0x00005616c3589fd1 in handle_fatal_signal (sig=6) at /test/10.5_dbg/sql/signal_handler.cc:356
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #5  0x0000145bf17e1859 in __GI_abort () at abort.c:79
      #6  0x0000145bf17e1729 in __assert_fail_base (fmt=0x145bf1977588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x5616c4418eb2 "state() == s_committing", file=0x5616c4419638 "/test/10.5_dbg/wsrep-lib/src/transaction.cpp", line=565, function=<optimized out>) at assert.c:92
      #7  0x0000145bf17f2fd6 in __GI___assert_fail (assertion=assertion@entry=0x5616c4418eb2 "state() == s_committing", file=file@entry=0x5616c4419638 "/test/10.5_dbg/wsrep-lib/src/transaction.cpp", line=line@entry=565, function=function@entry=0x5616c4419cb0 "int wsrep::transaction::ordered_commit()") at assert.c:101
      #8  0x00005616c3ea0f83 in wsrep::transaction::ordered_commit (this=this@entry=0x145b74007070) at /test/10.5_dbg/wsrep-lib/src/transaction.cpp:567
      #9  0x00005616c36e1c5b in wsrep::client_state::ordered_commit (this=0x145b74007008) at /test/10.5_dbg/wsrep-lib/include/wsrep/client_state.hpp:509
      #10 wsrep_ordered_commit (all=true, thd=0x145b74000d48) at /test/10.5_dbg/sql/wsrep_trans_observer.h:333
      #11 MYSQL_BIN_LOG::queue_for_group_commit (this=this@entry=0x5616c47d22a0 <mysql_bin_log>, orig_entry=orig_entry@entry=0x145bbc152e70) at /test/10.5_dbg/sql/log.cc:8077
      #12 0x00005616c36e9532 in MYSQL_BIN_LOG::write_transaction_to_binlog_events (this=this@entry=0x5616c47d22a0 <mysql_bin_log>, entry=entry@entry=0x145bbc152e70) at /test/10.5_dbg/sql/log.cc:8106
      #13 0x00005616c36e9e72 in MYSQL_BIN_LOG::write_transaction_to_binlog (this=this@entry=0x5616c47d22a0 <mysql_bin_log>, thd=thd@entry=0x145b74000d48, cache_mngr=cache_mngr@entry=0x145b740789a8, end_ev=end_ev@entry=0x145bbc152ff0, all=all@entry=true, using_stmt_cache=using_stmt_cache@entry=false, using_trx_cache=true) at /test/10.5_dbg/sql/log.cc:7736
      #14 0x00005616c36ea060 in binlog_flush_cache (thd=thd@entry=0x145b74000d48, cache_mngr=cache_mngr@entry=0x145b740789a8, end_ev=end_ev@entry=0x145bbc152ff0, all=all@entry=true, using_stmt=using_stmt@entry=false, using_trx=using_trx@entry=true) at /test/10.5_dbg/sql/log.cc:1772
      #15 0x00005616c36ec1f2 in binlog_commit_flush_trx_cache (thd=thd@entry=0x145b74000d48, all=all@entry=true, cache_mngr=cache_mngr@entry=0x145b740789a8) at /test/10.5_dbg/sql/log.cc:1869
      #16 0x00005616c36ec474 in binlog_commit (hton=<optimized out>, thd=0x145b74000d48, all=<optimized out>) at /test/10.5_dbg/sql/log.cc:2226
      #17 0x00005616c358bb5b in commit_one_phase_2 (thd=thd@entry=0x145b74000d48, all=all@entry=true, trans=trans@entry=0x145b740044e0, is_real_trans=true) at /test/10.5_dbg/sql/handler.cc:1970
      #18 0x00005616c358d8f1 in ha_commit_one_phase (thd=thd@entry=0x145b74000d48, all=all@entry=true) at /test/10.5_dbg/sql/handler.cc:1949
      #19 0x00005616c359ecce in ha_commit_trans (thd=thd@entry=0x145b74000d48, all=all@entry=true) at /test/10.5_dbg/sql/handler.cc:1743
      #20 0x00005616c3444e66 in trans_commit_implicit (thd=thd@entry=0x145b74000d48) at /test/10.5_dbg/sql/transaction.cc:329
      #21 0x00005616c32f803f in mysql_execute_command (thd=thd@entry=0x145b74000d48) at /test/10.5_dbg/sql/sql_parse.cc:3816
      #22 0x00005616c32e6242 in mysql_parse (thd=thd@entry=0x145b74000d48, rawbuf=rawbuf@entry=0x145b74012e10 "ALTER TABLE t ADD c2 INT", length=length@entry=24, parser_state=parser_state@entry=0x145bbc154310, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:8091
      #23 0x00005616c32e5c23 in wsrep_mysql_parse (thd=thd@entry=0x145b74000d48, rawbuf=0x145b74012e10 "ALTER TABLE t ADD c2 INT", length=24, parser_state=parser_state@entry=0x145bbc154310, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:7892
      #24 0x00005616c32f3ef2 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x145b74000d48, packet=packet@entry=0x145b7400aa69 "ALTER TABLE t ADD c2 INT", packet_length=packet_length@entry=24, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_class.h:1320
      #25 0x00005616c32f6741 in do_command (thd=0x145b74000d48) at /test/10.5_dbg/sql/sql_parse.cc:1375
      #26 0x00005616c343188f in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5616c64a96a8, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1416
      #27 0x00005616c3431d60 in handle_one_connection (arg=0x5616c64a96a8) at /test/10.5_dbg/sql/sql_connect.cc:1318
      #28 0x0000145bf1cf2609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #29 0x0000145bf18de133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.5.20 (opt), 10.5.20 (dbg), 10.6.12 (opt), 10.6.13 (dbg), 10.7.8 (opt), 10.7.8 (dbg),10.8.8 (opt), 10.8.8 (dbg), 10.9.6 (opt), 10.9.6 (dbg), 10.10.4 (opt), 10.10.4 (dbg), 10.11.3 (dbg), 10.11.3 (opt)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.4.29 (opt), 10.4.29 (dbg)

      Attachments

        Issue Links

          Activity

            People

              sysprg Julius Goryavsky
              ramesh Ramesh Sivaraman
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.