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

Assertion `client_state.transaction().active()' failed in int wsrep_thd_append_key(THD*, const wsrep_key*, int, Wsrep_service_key_type)

    XMLWordPrintable

Details

    Description

      Similar to MDEV-31660, crash also occurs when setting binlog_format to STATEMENT

      --source include/galera_cluster.inc
       
      SET @@binlog_format=STATEMENT;
      CREATE TABLE t (a INT UNIQUE) REPLACE SELECT 1 AS a,2 AS b UNION SELECT 1 AS a,3 AS c;
      

      Leads to:

      11.5.2 4e805aed8554e21ba5f2b979cbcb55769162ba33 (Debug)

      mysqld: /test/11.5_dbg/sql/service_wsrep.cc:326: int wsrep_thd_append_key(THD*, const wsrep_key*, int, Wsrep_service_key_type): Assertion `client_state.transaction().active()' failed.
      

      11.5.2 4e805aed8554e21ba5f2b979cbcb55769162ba33 (Debug)

      Core was generated by `/test/GAL_MD150724-mariadb-11.5.2-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 0x14da380a6700 (LWP 35301))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      #1  0x0000561bdf3a9ae7 in my_write_core (sig=sig@entry=6) at /test/11.5_dbg/mysys/stacktrace.c:424
      #2  0x0000561bdec81f22 in handle_fatal_signal (sig=6) at /test/11.5_dbg/sql/signal_handler.cc:358
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #5  0x000014da3c797859 in __GI_abort () at abort.c:79
      #6  0x000014da3c797729 in __assert_fail_base (fmt=0x14da3c92d588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x561bdf7f0a60 "client_state.transaction().active()", file=0x561bdf7f08f8 "/test/11.5_dbg/sql/service_wsrep.cc", line=326, function=<optimized out>) at assert.c:92
      #7  0x000014da3c7a8fd6 in __GI___assert_fail (assertion=assertion@entry=0x561bdf7f0a60 "client_state.transaction().active()", file=file@entry=0x561bdf7f08f8 "/test/11.5_dbg/sql/service_wsrep.cc", line=line@entry=326, function=function@entry=0x561bdf7f0a88 "int wsrep_thd_append_key(THD*, const wsrep_key*, int, Wsrep_service_key_type)") at assert.c:101
      #8  0x0000561bdef7374f in wsrep_thd_append_key (thd=thd@entry=0x14d9c8000d48, key=key@entry=0x14da380a0970, n_keys=n_keys@entry=1, key_type=key_type@entry=WSREP_SERVICE_KEY_UPDATE) at /test/11.5_dbg/wsrep-lib/include/wsrep/transaction_id.hpp:52
      #9  0x0000561bdef8d331 in wsrep_append_key (thd=thd@entry=0x14d9c8000d48, trx=trx@entry=0x14da2bbff680, table_share=0x14d9c8027760, key=key@entry=0x14da380a0a30 "", key_len=6, key_type=key_type@entry=WSREP_SERVICE_KEY_UPDATE) at /test/11.5_dbg/storage/innobase/handler/ha_innodb.cc:10089
      #10 0x0000561bdef9476a in ha_innobase::wsrep_append_keys (this=this@entry=0x14d9c8033950, thd=0x14d9c8000d48, key_type=WSREP_SERVICE_KEY_UPDATE, record0=record0@entry=0x14d9c8033548 "\245\001", record1=record1@entry=0x14d9c8033538 "\375\001") at /test/11.5_dbg/storage/innobase/handler/ha_innodb.cc:10263
      #11 0x0000561bdefa76aa in ha_innobase::update_row (this=0x14d9c8033950, old_row=0x14d9c8033548 "\245\001", new_row=0x14d9c8033538 "\375\001") at /test/11.5_dbg/storage/innobase/handler/ha_innodb.cc:8624
      #12 0x0000561bdec9b6e1 in handler::ha_update_row (this=0x14d9c8033950, old_data=0x14d9c8033548 "\245\001", new_data=0x14d9c8033538 "\375\001") at /test/11.5_dbg/sql/handler.cc:8098
      #13 0x0000561bde90a220 in write_record (thd=0x14d9c8000d48, table=0x14d9c8030138, info=info@entry=0x14d9c801cec8, sink=0x0) at /test/11.5_dbg/sql/sql_insert.cc:2224
      #14 0x0000561bde90afaa in select_insert::send_data (this=0x14d9c801ce78, values=<optimized out>) at /test/11.5_dbg/sql/sql_insert.cc:4298
      #15 0x0000561bde9d1937 in select_result_sink::send_data_with_check (sent=<optimized out>, u=<optimized out>, items=@0x14d9c8005828: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14d9c801e540, last = 0x14d9c801e670, elements = 2}, <No data fields>}, this=<optimized out>) at /test/11.5_dbg/sql/sql_class.h:6154
      #16 end_send (join=0x14d9c8023740, join_tab=0x14d9c8026638, end_of_records=<optimized out>) at /test/11.5_dbg/sql/sql_select.cc:24963
      #17 0x0000561bde99b5db in evaluate_join_record (join=join@entry=0x14d9c8023740, join_tab=join_tab@entry=0x14d9c80261c8, error=error@entry=0) at /test/11.5_dbg/sql/sql_select.cc:23889
      #18 0x0000561bde9b40f7 in sub_select (join=0x14d9c8023740, join_tab=0x14d9c80261c8, end_of_records=false) at /test/11.5_dbg/sql/sql_select.cc:23693
      #19 0x0000561bde9ee7ce in do_select (procedure=<optimized out>, join=0x14d9c8023740) at /test/11.5_dbg/sql/sql_select.cc:23167
      #20 JOIN::exec_inner (this=this@entry=0x14d9c8023740) at /test/11.5_dbg/sql/sql_select.cc:5021
      #21 0x0000561bde9eed3f in JOIN::exec (this=this@entry=0x14d9c8023740) at /test/11.5_dbg/sql/sql_select.cc:4804
      #22 0x0000561bde9ecc60 in mysql_select (thd=0x14d9c8000d48, tables=tables@entry=0x14d9c8005080, fields=@0x14d9c8005828: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14d9c801e540, last = 0x14d9c801e670, elements = 2}, <No data fields>}, conds=conds@entry=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2199023255552, result=0x14d9c801ce78, unit=0x14d9c8005038, select_lex=0x14d9c801c5d8) at /test/11.5_dbg/sql/sql_select.cc:5337
      #23 0x0000561bdea6c2c6 in st_select_lex_unit::exec_inner (this=this@entry=0x14d9c8005038) at /test/11.5_dbg/sql/sql_lex.h:972
      #24 0x0000561bdea6c4cd in st_select_lex_unit::exec (this=this@entry=0x14d9c8005038) at /test/11.5_dbg/sql/sql_union.cc:2290
      #25 0x0000561bdea6f76b in mysql_union (thd=thd@entry=0x14d9c8000d48, lex=lex@entry=0x14d9c8004f58, result=result@entry=0x14d9c801ce78, unit=unit@entry=0x14d9c8005038, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/11.5_dbg/sql/sql_union.cc:45
      #26 0x0000561bde9ed322 in handle_select (thd=thd@entry=0x14d9c8000d48, lex=lex@entry=0x14d9c8004f58, result=result@entry=0x14d9c801ce78, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/11.5_dbg/sql/sql_select.cc:618
      #27 0x0000561bdea5104f in Sql_cmd_create_table_like::execute (this=<optimized out>, thd=0x14d9c8000d48) at /test/11.5_dbg/sql/sql_table.cc:13052
      #28 0x0000561bde959812 in mysql_execute_command (thd=thd@entry=0x14d9c8000d48, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/11.5_dbg/sql/sql_parse.cc:5842
      #29 0x0000561bde94502f in mysql_parse (thd=thd@entry=0x14d9c8000d48, rawbuf=rawbuf@entry=0x14d9c801a6b0 "CREATE TABLE t1 (a INT UNIQUE) engine=INNODB REPLACE SELECT 1 AS a,2 AS b UNION SELECT 1 AS a,3 AS c", length=length@entry=100, parser_state=parser_state@entry=0x14da380a5300) at /test/11.5_dbg/sql/sql_parse.cc:7867
      #30 0x0000561bde944935 in wsrep_mysql_parse (thd=thd@entry=0x14d9c8000d48, rawbuf=0x14d9c801a6b0 "CREATE TABLE t1 (a INT UNIQUE) engine=INNODB REPLACE SELECT 1 AS a,2 AS b UNION SELECT 1 AS a,3 AS c", length=100, parser_state=parser_state@entry=0x14da380a5300) at /test/11.5_dbg/sql/sql_parse.cc:7677
      #31 0x0000561bde95bd33 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14d9c8000d48, packet=packet@entry=0x14d9c800b039 "CREATE TABLE t1 (a INT UNIQUE) engine=INNODB REPLACE SELECT 1 AS a,2 AS b UNION SELECT 1 AS a,3 AS c", packet_length=packet_length@entry=100, blocking=blocking@entry=true) at /test/11.5_dbg/sql/sql_class.h:1638
      #32 0x0000561bde95e566 in do_command (thd=0x14d9c8000d48, blocking=blocking@entry=true) at /test/11.5_dbg/sql/sql_parse.cc:1405
      #33 0x0000561bdeadc28e in do_handle_one_connection (connect=<optimized out>, connect@entry=0x561be1914348, put_in_cache=put_in_cache@entry=true) at /test/11.5_dbg/sql/sql_connect.cc:1447
      #34 0x0000561bdeadc760 in handle_one_connection (arg=0x561be1914348) at /test/11.5_dbg/sql/sql_connect.cc:1349
      #35 0x000014da3cca8609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #36 0x000014da3c894133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.5.26 (dbg), 10.6.19 (dbg), 10.11.9 (dbg), 11.1.6 (dbg), 11.2.4 (dbg), 11.4.3 (dbg), 11.5.2 (dbg)

      Bug confirmed not present in:
      MariaDB: 10.5.26 (opt), 10.6.19 (opt), 10.11.9 (opt), 11.1.6 (opt), 11.2.4 (opt), 11.4.3 (opt), 11.5.2 (opt)

      Attachments

        Activity

          People

            sysprg Julius Goryavsky
            ramesh Ramesh Sivaraman
            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.