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

Server crashes in galera::ReplicatorSMM::CommitOrder::CommitOrder or assertion failed in wsrep::transaction::before_prepare

    XMLWordPrintable

Details

    Description

      To reproduce initially, do not put the test case into the galera suite. It changes something – maybe the cluster needs to be single-node to make it happen, or something else is different. Instead, put it elsewhere and run with

      --mysqld=--wsrep_provider=<path to galera library> --mysqld=--wsrep_on=ON --mysqld=--wsrep_cluster_address=gcomm:// --mysqld=--log-bin --mysqld=--binlog-format=row --mysqld=--innodb_autoinc_lock_mode=2 --mysqld=--innodb_doublewrite=1 --nocheck-testcases --nowarnings --mem
      

      Alternatively, you can just start the server with minimal wsrep options as above and run the statements from the test case.

      --source include/have_innodb.inc
       
      CREATE TABLE t1 (a INT) ENGINE=InnoDB;
      EXECUTE IMMEDIATE 'CREATE OR REPLACE TABLE t1 ENGINE=InnoDB AS SELECT 1 AS b';
      

      10.4 ea7830ee non-debug

      #3  <signal handler called>
      #4  0x00007fe2960b7406 in galera::ReplicatorSMM::CommitOrder::CommitOrder (mode=galera::ReplicatorSMM::CommitOrder::NO_OOOC, ts=..., this=0x7fe284860ed0) at galera/src/replicator_smm.hpp:694
      #5  galera::ReplicatorSMM::commit_order_leave (this=this@entry=0x56385100aad0, ts=..., error=error@entry=0x7fe2848612a0) at galera/src/replicator_smm.cpp:1412
      #6  0x00007fe2960de6b5 in galera_commit_order_leave (gh=<optimized out>, ws_handle=<optimized out>, meta=<optimized out>, error=0x7fe2848612a0) at galera/src/wsrep_provider.cpp:800
      #7  0x000056384f8d317e in wsrep::wsrep_provider_v26::commit_order_leave (this=<optimized out>, ws_handle=..., ws_meta=..., err=...) at /data/src/10.4/wsrep-lib/src/wsrep_provider_v26.cpp:841
      #8  0x000056384f8c6a4d in wsrep::transaction::ordered_commit (this=this@entry=0x7fe21c006968) at /data/src/10.4/wsrep-lib/src/transaction.cpp:532
      #9  0x000056384f43daf1 in wsrep::client_state::ordered_commit (this=<optimized out>) at /data/src/10.4/wsrep-lib/include/wsrep/client_state.hpp:479
      #10 wsrep_ordered_commit (all=<optimized out>, thd=<optimized out>) at /data/src/10.4/sql/wsrep_trans_observer.h:300
      #11 MYSQL_BIN_LOG::write_transaction_to_binlog_events (this=this@entry=0x5638502b6d40 <mysql_bin_log>, entry=entry@entry=0x7fe2848613b0) at /data/src/10.4/sql/log.cc:7751
      #12 0x000056384f43df9a in MYSQL_BIN_LOG::write_transaction_to_binlog (this=this@entry=0x5638502b6d40 <mysql_bin_log>, thd=thd@entry=0x7fe21c0009a8, cache_mngr=cache_mngr@entry=0x7fe21c019e98, end_ev=end_ev@entry=0x7fe2848614f0, all=<optimized out>, using_stmt_cache=using_stmt_cache@entry=false, using_trx_cache=true) at /data/src/10.4/sql/log.cc:7418
      #13 0x000056384f43e178 in binlog_flush_cache (thd=thd@entry=0x7fe21c0009a8, cache_mngr=cache_mngr@entry=0x7fe21c019e98, end_ev=end_ev@entry=0x7fe2848614f0, all=all@entry=false, using_stmt=using_stmt@entry=false, using_trx=using_trx@entry=true) at /data/src/10.4/sql/log.cc:1786
      #14 0x000056384f43e48e in binlog_rollback_flush_trx_cache (thd=thd@entry=0x7fe21c0009a8, all=all@entry=false, cache_mngr=cache_mngr@entry=0x7fe21c019e98) at /data/src/10.4/sql/log.cc:1874
      #15 0x000056384f43e751 in binlog_rollback (hton=<optimized out>, thd=0x7fe21c0009a8, all=<optimized out>) at /data/src/10.4/sql/log.cc:2139
      #16 0x000056384f36c0b5 in ha_rollback_trans (thd=thd@entry=0x7fe21c0009a8, all=all@entry=false) at /data/src/10.4/sql/handler.cc:1886
      #17 0x000056384f36c7f9 in ha_commit_trans (thd=thd@entry=0x7fe21c0009a8, all=all@entry=false) at /data/src/10.4/sql/handler.cc:1690
      #18 0x000056384f25e3eb in trans_commit_stmt (thd=thd@entry=0x7fe21c0009a8) at /data/src/10.4/sql/transaction.cc:436
      #19 0x000056384f149d97 in select_create::send_eof (this=0x7fe21c0128d8) at /data/src/10.4/sql/sql_insert.cc:4772
      #20 0x000056384f1cdf3e in JOIN::exec_inner (this=this@entry=0x7fe21c0129d0) at /data/src/10.4/sql/sql_select.cc:4338
      #21 0x000056384f1ce414 in JOIN::exec (this=this@entry=0x7fe21c0129d0) at /data/src/10.4/sql/sql_select.cc:4241
      #22 0x000056384f1cc860 in mysql_select (thd=thd@entry=0x7fe21c0009a8, tables=0x0, wild_num=0, fields=..., conds=<optimized out>, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2416184064, result=0x7fe21c0128d8, unit=0x7fe21c02a4f0, select_lex=0x7fe21c02c778) at /data/src/10.4/sql/sql_select.cc:4673
      #23 0x000056384f1cd1ee in handle_select (thd=thd@entry=0x7fe21c0009a8, lex=lex@entry=0x7fe21c02a430, result=result@entry=0x7fe21c0128d8, setup_tables_done_option=setup_tables_done_option@entry=0) at /data/src/10.4/sql/sql_select.cc:422
      #24 0x000056384f201f0d in Sql_cmd_create_table_like::execute (this=<optimized out>, thd=0x7fe21c0009a8) at /data/src/10.4/sql/sql_table.cc:11424
      #25 0x000056384f176e70 in mysql_execute_command (thd=0x7fe21c0009a8) at /data/src/10.4/sql/sql_parse.cc:6101
      #26 0x000056384f190327 in Prepared_statement::execute (this=this@entry=0x7fe21c01cbf8, expanded_query=expanded_query@entry=0x7fe2848644f0, open_cursor=open_cursor@entry=false) at /data/src/10.4/sql/sql_prepare.cc:4760
      #27 0x000056384f190430 in Prepared_statement::execute_loop (this=0x7fe21c01cbf8, expanded_query=0x7fe2848644f0, open_cursor=<optimized out>, packet=<optimized out>, packet_end=<optimized out>) at /data/src/10.4/sql/sql_prepare.cc:4246
      #28 0x000056384f1908da in Prepared_statement::execute_immediate (this=this@entry=0x7fe21c01cbf8, query=<optimized out>, query_len=<optimized out>) at /data/src/10.4/sql/sql_prepare.cc:4884
      #29 0x000056384f190ac0 in mysql_sql_stmt_execute_immediate (thd=thd@entry=0x7fe21c0009a8) at /data/src/10.4/sql/sql_prepare.cc:2921
      #30 0x000056384f1770a0 in mysql_execute_command (thd=thd@entry=0x7fe21c0009a8) at /data/src/10.4/sql/sql_parse.cc:3904
      #31 0x000056384f17d969 in mysql_parse (thd=thd@entry=0x7fe21c0009a8, rawbuf=rawbuf@entry=0x7fe21c011e70 "EXECUTE IMMEDIATE 'CREATE OR REPLACE TABLE t1 ENGINE=InnoDB AS SELECT 1 AS b'", length=length@entry=77, parser_state=parser_state@entry=0x7fe2848665b0, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/src/10.4/sql/sql_parse.cc:7900
      #32 0x000056384f17e183 in wsrep_mysql_parse (thd=thd@entry=0x7fe21c0009a8, rawbuf=0x7fe21c011e70 "EXECUTE IMMEDIATE 'CREATE OR REPLACE TABLE t1 ENGINE=InnoDB AS SELECT 1 AS b'", length=77, parser_state=parser_state@entry=0x7fe2848665b0, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/src/10.4/sql/sql_parse.cc:7704
      #33 0x000056384f180a76 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7fe21c0009a8, packet=packet@entry=0x7fe21c007aa9 "EXECUTE IMMEDIATE 'CREATE OR REPLACE TABLE t1 ENGINE=InnoDB AS SELECT 1 AS b'", packet_length=packet_length@entry=77, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/src/10.4/sql/sql_parse.cc:1827
      #34 0x000056384f1812d1 in do_command (thd=0x7fe21c0009a8) at /data/src/10.4/sql/sql_parse.cc:1360
      #35 0x000056384f250b94 in do_handle_one_connection (connect=connect@entry=0x5638513d3b48) at /data/src/10.4/sql/sql_connect.cc:1412
      #36 0x000056384f250c44 in handle_one_connection (arg=arg@entry=0x5638513d3b48) at /data/src/10.4/sql/sql_connect.cc:1316
      #37 0x000056384f7f35f4 in pfs_spawn_thread (arg=0x563851417c48) at /data/src/10.4/storage/perfschema/pfs.cc:1869
      #38 0x00007fe29cd264a4 in start_thread (arg=0x7fe284867700) at pthread_create.c:456
      #39 0x00007fe29ae5ad0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      10.4 ea7830ee debug

      mysqld: /data/src/10.4/wsrep-lib/src/transaction.cpp:278: int wsrep::transaction::before_prepare(wsrep::unique_lock<wsrep::mutex>&): Assertion `state() == s_executing || state() == s_must_abort || state() == s_replaying' failed.
      200523 17:52:41 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f844478bf12 in __GI___assert_fail (assertion=0x5640ad50e078 "state() == s_executing || state() == s_must_abort || state() == s_replaying", file=0x5640ad50de30 "/data/src/10.4/wsrep-lib/src/transaction.cpp", line=278, function=0x5640ad50f760 <wsrep::transaction::before_prepare(wsrep::unique_lock<wsrep::mutex>&)::__PRETTY_FUNCTION__> "int wsrep::transaction::before_prepare(wsrep::unique_lock<wsrep::mutex>&)") at assert.c:101
      #8  0x00005640acf97212 in wsrep::transaction::before_prepare (this=0x7f83c8006cf0, lock=...) at /data/src/10.4/wsrep-lib/src/transaction.cpp:277
      #9  0x00005640ac6626d6 in wsrep::client_state::before_prepare (this=0x7f83c8006c88) at /data/src/10.4/wsrep-lib/include/wsrep/client_state.hpp:457
      #10 0x00005640ac648d85 in wsrep_before_prepare (thd=0x7f83c8000af0, all=false) at /data/src/10.4/sql/wsrep_trans_observer.h:230
      #11 0x00005640ac64be78 in prepare_or_error (ht=0x5640aec64090, thd=0x7f83c8000af0, all=false) at /data/src/10.4/sql/handler.cc:1242
      #12 0x00005640ac64ccde in ha_commit_trans (thd=0x7f83c8000af0, all=false) at /data/src/10.4/sql/handler.cc:1593
      #13 0x00005640ac48ddb7 in trans_commit_stmt (thd=0x7f83c8000af0) at /data/src/10.4/sql/transaction.cc:436
      #14 0x00005640ac2b4f9d in select_create::send_eof (this=0x7f83c8015ea0) at /data/src/10.4/sql/sql_insert.cc:4772
      #15 0x00005640ac34704e in JOIN::exec_inner (this=0x7f83c8015f98) at /data/src/10.4/sql/sql_select.cc:4338
      #16 0x00005640ac34681e in JOIN::exec (this=0x7f83c8015f98) at /data/src/10.4/sql/sql_select.cc:4241
      #17 0x00005640ac347f33 in mysql_select (thd=0x7f83c8000af0, tables=0x0, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2416184064, result=0x7f83c8015ea0, unit=0x7f83c802efb8, select_lex=0x7f83c8031240) at /data/src/10.4/sql/sql_select.cc:4673
      #18 0x00005640ac337a70 in handle_select (thd=0x7f83c8000af0, lex=0x7f83c802eef8, result=0x7f83c8015ea0, setup_tables_done_option=0) at /data/src/10.4/sql/sql_select.cc:422
      #19 0x00005640ac3eaaf2 in Sql_cmd_create_table_like::execute (this=0x7f83c8030b10, thd=0x7f83c8000af0) at /data/src/10.4/sql/sql_table.cc:11424
      #20 0x00005640ac2fd084 in mysql_execute_command (thd=0x7f83c8000af0) at /data/src/10.4/sql/sql_parse.cc:6101
      #21 0x00005640ac32203e in Prepared_statement::execute (this=0x7f83c8023400, expanded_query=0x7f842e2558e0, open_cursor=false) at /data/src/10.4/sql/sql_prepare.cc:4760
      #22 0x00005640ac3204a0 in Prepared_statement::execute_loop (this=0x7f83c8023400, expanded_query=0x7f842e2558e0, open_cursor=false, packet=0x0, packet_end=0x0) at /data/src/10.4/sql/sql_prepare.cc:4246
      #23 0x00005640ac322628 in Prepared_statement::execute_immediate (this=0x7f83c8023400, query=0x7f83c8015538 "CREATE OR REPLACE TABLE t1 ENGINE=InnoDB AS SELECT 1 AS b", query_len=57) at /data/src/10.4/sql/sql_prepare.cc:4884
      #24 0x00005640ac31cc86 in mysql_sql_stmt_execute_immediate (thd=0x7f83c8000af0) at /data/src/10.4/sql/sql_prepare.cc:2921
      #25 0x00005640ac2f4c6c in mysql_execute_command (thd=0x7f83c8000af0) at /data/src/10.4/sql/sql_parse.cc:3904
      #26 0x00005640ac302549 in mysql_parse (thd=0x7f83c8000af0, rawbuf=0x7f83c8015438 "EXECUTE IMMEDIATE 'CREATE OR REPLACE TABLE t1 ENGINE=InnoDB AS SELECT 1 AS b'", length=77, parser_state=0x7f842e256570, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:7900
      #27 0x00005640ac301c49 in wsrep_mysql_parse (thd=0x7f83c8000af0, rawbuf=0x7f83c8015438 "EXECUTE IMMEDIATE 'CREATE OR REPLACE TABLE t1 ENGINE=InnoDB AS SELECT 1 AS b'", length=77, parser_state=0x7f842e256570, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:7704
      #28 0x00005640ac2ee9f3 in dispatch_command (command=COM_QUERY, thd=0x7f83c8000af0, packet=0x7f83c80084a1 "EXECUTE IMMEDIATE 'CREATE OR REPLACE TABLE t1 ENGINE=InnoDB AS SELECT 1 AS b'", packet_length=77, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1827
      #29 0x00005640ac2ed29b in do_command (thd=0x7f83c8000af0) at /data/src/10.4/sql/sql_parse.cc:1360
      #30 0x00005640ac474ee6 in do_handle_one_connection (connect=0x5640af0104c0) at /data/src/10.4/sql/sql_connect.cc:1412
      #31 0x00005640ac474c35 in handle_one_connection (arg=0x5640af0104c0) at /data/src/10.4/sql/sql_connect.cc:1316
      #32 0x00005640ace7231f in pfs_spawn_thread (arg=0x5640af02b490) at /data/src/10.4/storage/perfschema/pfs.cc:1869
      #33 0x00007f84467144a4 in start_thread (arg=0x7f842e257700) at pthread_create.c:456
      #34 0x00007f8444848d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      Reproducible on 10.4, 10.5.
      Not reproducible on 10.3.

      Attachments

        1. MDEV-22681.cnf
          0.1 kB
          Jan Lindström
        2. MDEV-22681.test
          0.2 kB
          Jan Lindström

        Activity

          People

            jplindst Jan Lindström (Inactive)
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.