[MDEV-29202] Assertion `active()' failed in int wsrep::transaction::append_data(const wsrep::const_buffer&) Created: 2022-07-29  Updated: 2023-11-28

Status: Open
Project: MariaDB Server
Component/s: Galera
Affects Version/s: 10.5, 10.6, 10.7, 10.8, 10.9, 10.10
Fix Version/s: 10.5, 10.6

Type: Bug Priority: Major
Reporter: Ramesh Sivaraman Assignee: Seppo Jaakola
Resolution: Unresolved Votes: 0
Labels: debug


 Description   

Test case

perl runall-new.pl \
   --basedir=/test/mtest/10.10/mariadb-10.10.0-linux-x86_64 \
   --vardir=/home/ramesh/galera-rqg-test \
   --mysqld=--wsrep-provider=/test/mtest/10.10/mariadb-10.10.0-linux-x86_64/lib/libgalera_smm.so \
   --gendata=conf/runtime/concurrency_1.zz \
   --grammar=conf/runtime/concurrency_1.yy \
   --threads=2 \
   --galera=mss \
   --mysqld=--wsrep_sst_method=rsync \
   --mysqld=--core \
   --mysqld=--general-log \
   --mysqld=--general-log-file=queries.log \
   --mysqld=--log-output=file \
   --mysqld=--wsrep-debug=0 \
   --mysqld=--wsrep-sync-wait=15 \
   --mysqld=--wsrep_retry_autocommit=0 \
   --mysqld=--wsrep_slave_threads=12 \
   --mysqld=--wsrep_log_conflicts=1 \
   --mysqld=--wsrep_on=1 \
   --mysqld=--default-storage-engine=innodb \
   --mysqld=--sort_buffer_size=200M \
   --mysqld=--innodb-lock-wait-timeout=1 \
   --mysqld=--gtid_domain_id=10 \
   --mysqld=--wsrep_gtid_domain_id=100 \
   --mysqld=--wsrep_gtid_mode=ON \
   --mysqld=--wsrep_slave_threads=4 \
   --mysqld=--slave_parallel_threads=4 \
   --mysqld=--server_id=11 \
   --mysqld=--gtid_strict_mode=1 \
   --mysqld=--log_slave_updates=ON \
   --mysqld=--log_bin=binlog \
   --mysqld=--binlog_format=ROW \
   --mysqld=--master_info_repository=TABLE \
   --mysqld=--relay_log_info_repository=TABLE 

Leads to

10.10.0 c360eadb8c92624419b94ec0601ebf3e6bb64374

mysqld: /test/mtest/10.10/wsrep-lib/src/transaction.cpp:254: int wsrep::transaction::append_data(const wsrep::const_buffer&): Assertion `active()' failed.

10.10.0 c360eadb8c92624419b94ec0601ebf3e6bb64374

Core was generated by `/test/mtest/10.10/mariadb-10.10.0-linux-x86_64/bin/mysqld --defaults-file=/home'.
Program terminated with signal SIGABRT, Aborted.
#0  __pthread_kill (threadid=<optimized out>, signo=6)
    at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
[Current thread is 1 (Thread 0x1486e0109700 (LWP 1258223))]
(gdb) bt
#0  __pthread_kill (threadid=<optimized out>, signo=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
#1  0x00005598537ebf3c in my_write_core (sig=6) at /test/mtest/10.10/mysys/stacktrace.c:424
#2  0x0000559852f40443 in handle_fatal_signal (sig=6) at /test/mtest/10.10/sql/signal_handler.cc:345
#3  <signal handler called>
#4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#5  0x0000148716b2b859 in __GI_abort () at abort.c:79
#6  0x0000148716b2b729 in __assert_fail_base (fmt=0x148716cc1588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x559853ed7469 "active()", file=0x559853ed7300 "/test/mtest/10.10/wsrep-lib/src/transaction.cpp", line=254, function=<optimized out>) at assert.c:92
#7  0x0000148716b3cfd6 in __GI___assert_fail (assertion=0x559853ed7469 "active()", file=0x559853ed7300 "/test/mtest/10.10/wsrep-lib/src/transaction.cpp", line=254, function=0x559853ed7678 "int wsrep::transaction::append_data(const wsrep::const_buffer&)") at assert.c:101
#8  0x00005598538b7b21 in wsrep::transaction::append_data (this=0x1486680076b8, data=@0x1486e0106f90: {ptr_ = 0x148668075918, size_ = 38}) at /test/mtest/10.10/wsrep-lib/src/transaction.cpp:254
#9  0x00005598530bee45 in wsrep::client_state::append_data (this=0x148668007650, data=@0x1486e0106f90: {ptr_ = 0x148668075918, size_ = 38}) at /test/mtest/10.10/wsrep-lib/include/wsrep/client_state.hpp:385
#10 0x00005598530ab9a6 in THD::binlog_start_trans_and_stmt (this=0x148668000db8) at /test/mtest/10.10/sql/log.cc:6121
#11 0x0000559852b2c96a in select_create::prepare (this=0x1486680172f8, _values=@0x148668015e18: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x148668016108, last = 0x1486680181b8, elements = 6}, <No data fields>}, u=0x1486680051d8) at /test/mtest/10.10/sql/sql_insert.cc:4737
#12 0x0000559852bdbb44 in JOIN::prepare (this=0x148668017440, tables_init=0x148668016168, conds_init=0x0, og_num=0, order_init=0x0, skip_order_by=false, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x148668015b78, unit_arg=0x1486680051d8) at /test/mtest/10.10/sql/sql_select.cc:1720
#13 0x0000559852be7c9d in mysql_select (thd=0x148668000db8, tables=0x148668016168, fields=@0x148668015e18: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x148668016108, last = 0x1486680181b8, elements = 6}, <No data fields>}, conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2201171004160, result=0x1486680172f8, unit=0x1486680051d8, select_lex=0x148668015b78) at /test/mtest/10.10/sql/sql_select.cc:5020
#14 0x0000559852bd6edd in handle_select (thd=0x148668000db8, lex=0x148668005100, result=0x1486680172f8, setup_tables_done_option=0) at /test/mtest/10.10/sql/sql_select.cc:579
#15 0x0000559852ca2f38 in Sql_cmd_create_table_like::execute (this=0x148668015408, thd=0x148668000db8) at /test/mtest/10.10/sql/sql_table.cc:12463
#16 0x0000559852b7cc0e in mysql_execute_command (thd=0x148668000db8, is_called_from_prepared_stmt=false) at /test/mtest/10.10/sql/sql_parse.cc:5996
#17 0x0000559852b82dd8 in mysql_parse (thd=0x148668000db8, rawbuf=0x148668015230 "/* Sequence start */ /* testdb_S.t1_base1_S testdb_S.t1_base2_S */ CREATE TABLE IF NOT EXISTS testdb_S.t1_base1_S ENGINE = InnoDB AS SELECT * FROM test.table10_int  /* QNO 220 CON_ID 22 */", length=188, parser_state=0x1486e0108480) at /test/mtest/10.10/sql/sql_parse.cc:8036
#18 0x0000559852b82514 in wsrep_mysql_parse (thd=0x148668000db8, rawbuf=0x148668015230 "/* Sequence start */ /* testdb_S.t1_base1_S testdb_S.t1_base2_S */ CREATE TABLE IF NOT EXISTS testdb_S.t1_base1_S ENGINE = InnoDB AS SELECT * FROM test.table10_int  /* QNO 220 CON_ID 22 */", length=188, parser_state=0x1486e0108480) at /test/mtest/10.10/sql/sql_parse.cc:7849
#19 0x0000559852b6f10a in dispatch_command (command=COM_QUERY, thd=0x148668000db8, packet=0x148668731e49 "/* Sequence start */ /* testdb_S.t1_base1_S testdb_S.t1_base2_S */ CREATE TABLE IF NOT EXISTS testdb_S.t1_base1_S ENGINE = InnoDB AS SELECT * FROM test.table10_int  /* QNO 220 CON_ID 22 */ ", packet_length=189, blocking=true) at /test/mtest/10.10/sql/sql_parse.cc:1881
#20 0x0000559852b6dbd0 in do_command (thd=0x148668000db8, blocking=true) at /test/mtest/10.10/sql/sql_parse.cc:1407
#21 0x0000559852d4bfa5 in do_handle_one_connection (connect=0x559856873928, put_in_cache=true) at /test/mtest/10.10/sql/sql_connect.cc:1418
#22 0x0000559852d4bc35 in handle_one_connection (arg=0x559856873928) at /test/mtest/10.10/sql/sql_connect.cc:1312
#23 0x0000559853262025 in pfs_spawn_thread (arg=0x5598568e78e8) at /test/mtest/10.10/storage/perfschema/pfs.cc:2201
#24 0x0000148717057609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#25 0x0000148716c28133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95



 Comments   
Comment by Ramesh Sivaraman [ 2023-03-08 ]

Reduced test case

# mysqld options required for replay: --log-bin
SET autocommit=OFF;
SET GLOBAL wsrep_gtid_mode=ON;
SET SESSION binlog_format=statement;
ALTER TABLE t0 MODIFY a TIMESTAMP;
CREATE TEMPORARY TABLE t0 (c0 INT);

Leads to

10.5.20 57c526ffb852fb027e25fdc77173d45bdc60b8a2 (Debug)

mysqld: /test/10.5_dbg/wsrep-lib/src/transaction.cpp:256: int wsrep::transaction::append_data(const wsrep::const_buffer&): Assertion `active()' 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 0x1460cb91b700 (LWP 1207561))]
(gdb) bt
#0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
#1  0x0000562f37685852 in my_write_core (sig=sig@entry=6) at /test/10.5_dbg/mysys/stacktrace.c:424
#2  0x0000562f36ec5fd1 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  0x000014610d9f8859 in __GI_abort () at abort.c:79
#6  0x000014610d9f8729 in __assert_fail_base (fmt=0x14610db8e588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x562f37a0de94 "active()", file=0x562f37d55638 "/test/10.5_dbg/wsrep-lib/src/transaction.cpp", line=256, function=<optimized out>) at assert.c:92
#7  0x000014610da09fd6 in __GI___assert_fail (assertion=assertion@entry=0x562f37a0de94 "active()", file=file@entry=0x562f37d55638 "/test/10.5_dbg/wsrep-lib/src/transaction.cpp", line=line@entry=256, function=function@entry=0x562f37d55668 "int wsrep::transaction::append_data(const wsrep::const_buffer&)") at assert.c:101
#8  0x0000562f377da80a in wsrep::transaction::append_data (this=this@entry=0x146090007070, data=@0x1460cb918f90: {ptr_ = 0x14609001d7f8, size_ = 38}) at /test/10.5_dbg/wsrep-lib/include/wsrep/client_state.hpp:879
#9  0x0000562f3701514a in wsrep::client_state::append_data (data=@0x1460cb918f90: {ptr_ = 0x14609001d7f8, size_ = 38}, this=0x146090007008) at /test/10.5_dbg/wsrep-lib/include/wsrep/client_state.hpp:384
#10 THD::binlog_start_trans_and_stmt (this=this@entry=0x146090000d48) at /test/10.5_dbg/sql/log.cc:5905
#11 0x0000562f3702ac69 in MYSQL_BIN_LOG::write (this=0x562f3810e2a0 <mysql_bin_log>, event_info=event_info@entry=0x1460cb919740, with_annotate=with_annotate@entry=0x0) at /test/10.5_dbg/sql/log.cc:6702
#12 0x0000562f36bd43de in THD::binlog_query (this=this@entry=0x146090000d48, qtype=qtype@entry=THD::STMT_QUERY_TYPE, query_arg=query_arg@entry=0x146090012e10 "CREATE TEMPORARY TABLE t0 (c0 INT)", query_len=query_len@entry=34, is_trans=is_trans@entry=true, direct=direct@entry=false, suppress_use=false, errcode=0) at /test/10.5_dbg/sql/sql_class.cc:7721
#13 0x0000562f36ce3444 in write_bin_log (thd=thd@entry=0x146090000d48, clear_error=<optimized out>, query=0x146090012e10 "CREATE TEMPORARY TABLE t0 (c0 INT)", query_length=34, is_trans=<optimized out>) at /test/10.5_dbg/sql/sql_table.cc:1991
#14 0x0000562f36cf650e in mysql_create_table (thd=thd@entry=0x146090000d48, create_table=create_table@entry=0x146090012f18, create_info=create_info@entry=0x1460cb919a90, alter_info=alter_info@entry=0x1460cb9199c0) at /test/10.5_dbg/sql/sql_class.h:1320
#15 0x0000562f36cf7c73 in Sql_cmd_create_table_like::execute (this=0x146090012eb8, thd=0x146090000d48) at /test/10.5_dbg/sql/sql_table.cc:12367
#16 0x0000562f36c39f26 in mysql_execute_command (thd=thd@entry=0x146090000d48) at /test/10.5_dbg/sql/sql_parse.cc:6061
#17 0x0000562f36c22242 in mysql_parse (thd=thd@entry=0x146090000d48, rawbuf=rawbuf@entry=0x146090012e10 "CREATE TEMPORARY TABLE t0 (c0 INT)", length=length@entry=34, parser_state=parser_state@entry=0x1460cb91a310, 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
#18 0x0000562f36c21c23 in wsrep_mysql_parse (thd=thd@entry=0x146090000d48, rawbuf=0x146090012e10 "CREATE TEMPORARY TABLE t0 (c0 INT)", length=34, parser_state=parser_state@entry=0x1460cb91a310, 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
#19 0x0000562f36c2fef2 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x146090000d48, packet=packet@entry=0x14609000aa69 "CREATE TEMPORARY TABLE t0 (c0 INT)", packet_length=packet_length@entry=34, 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
#20 0x0000562f36c32741 in do_command (thd=0x146090000d48) at /test/10.5_dbg/sql/sql_parse.cc:1375
#21 0x0000562f36d6d88f in do_handle_one_connection (connect=<optimized out>, connect@entry=0x562f3a2916a8, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1416
#22 0x0000562f36d6dd60 in handle_one_connection (arg=0x562f3a2916a8) at /test/10.5_dbg/sql/sql_connect.cc:1318
#23 0x000014610df09609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#24 0x000014610daf5133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

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

Bug (or feature/syntax) confirmed not present in:
MariaDB: 10.4.29 (opt), 10.4.29 (dbg), 10.5.20 (opt), 10.6.12 (opt), 10.7.8 (opt), 10.8.8 (opt), 10.9.6 (opt), 10.10.4 (opt), 10.11.3 (opt)

Generated at Thu Feb 08 10:06:41 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.