[MDEV-25045] Assertion `client_state_.mode() != wsrep::client_state::m_toi' failed in int wsrep::transaction::before_commit() Created: 2021-03-03  Updated: 2023-04-04  Resolved: 2023-03-31

Status: Closed
Project: MariaDB Server
Component/s: Galera
Affects Version/s: 10.4, 10.5, 10.6, 10.8, 10.9, 10.10, 10.11, 11.0
Fix Version/s: 11.1.0, 10.11.3, 10.4.29, 10.5.20, 10.6.13, 10.8.8, 10.9.6, 10.10.4

Type: Bug Priority: Critical
Reporter: Ramesh Sivaraman Assignee: Julius Goryavsky
Resolution: Fixed Votes: 1
Labels: not-10.2, not-10.3

Issue Links:
Problem/Incident

 Description   

CREATE TABLE t2 (d CHAR(1)KEY);
SET autocommit=0;
INSERT INTO t2 VALUES(1);
CREATE TEMPORARY SEQUENCE seq1 ROW_FORMAT=REDUNDANT;

Leads to:

10.6.0 208233be5af55072d7ef80c37ddbc664bc51f342 (Debug)

mysqld: /test/10.6_dbg/wsrep-lib/src/transaction.cpp:443: int wsrep::transaction::before_commit(): Assertion `client_state_.mode() != wsrep::client_state::m_toi' failed.

10.6.0 208233be5af55072d7ef80c37ddbc664bc51f342 (Debug)

Core was generated by `/test/GAL_MD230221-mariadb-10.6.0-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 0x15130c3ec700 (LWP 1332434))]
(gdb) bt
#0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
#1  0x00005569a94ad4db in my_write_core (sig=sig@entry=6) at /test/10.6_dbg/mysys/stacktrace.c:424
#2  0x00005569a8c3d2df in handle_fatal_signal (sig=6) at /test/10.6_dbg/sql/signal_handler.cc:330
#3  <signal handler called>
#4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#5  0x000015131c6cc859 in __GI_abort () at abort.c:79
#6  0x000015131c6cc729 in __assert_fail_base (fmt=0x15131c862588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x5569a9ba31c8 "client_state_.mode() != wsrep::client_state::m_toi", file=0x5569a9ba2178 "/test/10.6_dbg/wsrep-lib/src/transaction.cpp", line=443, function=<optimized out>) at assert.c:92
#7  0x000015131c6ddf36 in __GI___assert_fail (assertion=assertion@entry=0x5569a9ba31c8 "client_state_.mode() != wsrep::client_state::m_toi", file=file@entry=0x5569a9ba2178 "/test/10.6_dbg/wsrep-lib/src/transaction.cpp", line=line@entry=443, function=function@entry=0x5569a9ba31a0 "int wsrep::transaction::before_commit()") at assert.c:101
#8  0x00005569a95ddbc2 in wsrep::transaction::before_commit (this=this@entry=0x1512a40073b0) at /test/10.6_dbg/wsrep-lib/src/transaction.cpp:530
#9  0x00005569a8c404de in wsrep::client_state::before_commit (this=0x1512a4007348) at /test/10.6_dbg/wsrep-lib/include/wsrep/client_state.hpp:503
#10 wsrep_before_commit (thd=thd@entry=0x1512a4000db8, all=all@entry=true) at /test/10.6_dbg/sql/wsrep_trans_observer.h:277
#11 0x00005569a8c56df9 in ha_commit_trans (thd=thd@entry=0x1512a4000db8, all=all@entry=true) at /test/10.6_dbg/sql/handler.cc:1708
#12 0x00005569a8ae798e in trans_commit_implicit (thd=thd@entry=0x1512a4000db8) at /test/10.6_dbg/sql/transaction.cc:329
#13 0x00005569a8b90f17 in sequence_insert (thd=thd@entry=0x1512a4000db8, lex=0x1512a4004ec0, org_table_list=org_table_list@entry=0x1512a4013c88) at /test/10.6_dbg/sql/sql_sequence.cc:371
#14 0x00005569a8a4db6a in mysql_create_table_no_lock (thd=thd@entry=0x1512a4000db8, db=db@entry=0x1512a4013ca0, table_name=table_name@entry=0x1512a4013cb0, create_info=create_info@entry=0x15130c3eaaa0, alter_info=alter_info@entry=0x15130c3ea9d0, is_trans=is_trans@entry=0x15130c3ea8f7, create_table_mode=0, table_list=0x1512a4013c88) at /test/10.6_dbg/sql/sql_table.cc:5473
#15 0x00005569a8a4de83 in mysql_create_table (thd=thd@entry=0x1512a4000db8, create_table=create_table@entry=0x1512a4013c88, create_info=create_info@entry=0x15130c3eaaa0, alter_info=alter_info@entry=0x15130c3ea9d0) at /test/10.6_dbg/sql/sql_table.cc:5564
#16 0x00005569a8a4f848 in Sql_cmd_create_table_like::execute (this=0x1512a4013c68, thd=0x1512a4000db8) at /test/10.6_dbg/sql/sql_table.cc:12145
#17 0x00005569a897c71f in mysql_execute_command (thd=thd@entry=0x1512a4000db8) at /test/10.6_dbg/sql/sql_parse.cc:5946
#18 0x00005569a8963360 in mysql_parse (thd=thd@entry=0x1512a4000db8, rawbuf=rawbuf@entry=0x1512a4013b60 "CREATE TEMPORARY SEQUENCE seq1 ROW_FORMAT=REDUNDANT", length=length@entry=51, parser_state=parser_state@entry=0x15130c3eb3d0) at /test/10.6_dbg/sql/sql_parse.cc:7972
#19 0x00005569a8962cbc in wsrep_mysql_parse (thd=thd@entry=0x1512a4000db8, rawbuf=0x1512a4013b60 "CREATE TEMPORARY SEQUENCE seq1 ROW_FORMAT=REDUNDANT", length=51, parser_state=parser_state@entry=0x15130c3eb3d0) at /test/10.6_dbg/sql/sql_parse.cc:7786
#20 0x00005569a89712a0 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x1512a4000db8, packet=packet@entry=0x1512a400b319 "CREATE TEMPORARY SEQUENCE seq1 ROW_FORMAT=REDUNDANT", packet_length=packet_length@entry=51, blocking=blocking@entry=true) at /test/10.6_dbg/sql/sql_class.h:1295
#21 0x00005569a897470c in do_command (thd=0x1512a4000db8, blocking=blocking@entry=true) at /test/10.6_dbg/sql/sql_parse.cc:1397
#22 0x00005569a8ad1bf5 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5569aaefb688, put_in_cache=put_in_cache@entry=true) at /test/10.6_dbg/sql/sql_connect.cc:1410
#23 0x00005569a8ad22fb in handle_one_connection (arg=arg@entry=0x5569aaefb688) at /test/10.6_dbg/sql/sql_connect.cc:1312
#24 0x00005569a8f895cd in pfs_spawn_thread (arg=0x5569aaf72eb8) at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
#25 0x000015131cbda609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#26 0x000015131c7c9293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

10.5.10 85bec9d691bb69ed20beb565b03d5585b94624fe (Debug)

mysqld: /test/10.5_dbg/wsrep-lib/src/transaction.cpp:443: int wsrep::transaction::before_commit(): Assertion `client_state_.mode() != wsrep::client_state::m_toi' failed.

10.5.10 85bec9d691bb69ed20beb565b03d5585b94624fe (Debug)

Core was generated by `/test/GAL_MD230221-mariadb-10.5.10-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 0x148ca9c73700 (LWP 1334232))]
(gdb) bt
#0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
#1  0x000055d6447a289b in my_write_core (sig=sig@entry=6) at /test/10.5_dbg/mysys/stacktrace.c:424
#2  0x000055d643ef06f5 in handle_fatal_signal (sig=6) at /test/10.5_dbg/sql/signal_handler.cc:330
#3  <signal handler called>
#4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#5  0x0000148cdf966859 in __GI_abort () at abort.c:79
#6  0x0000148cdf966729 in __assert_fail_base (fmt=0x148cdfafc588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55d644e9de48 "client_state_.mode() != wsrep::client_state::m_toi", file=0x55d644e9cdf8 "/test/10.5_dbg/wsrep-lib/src/transaction.cpp", line=443, function=<optimized out>) at assert.c:92
#7  0x0000148cdf977f36 in __GI___assert_fail (assertion=assertion@entry=0x55d644e9de48 "client_state_.mode() != wsrep::client_state::m_toi", file=file@entry=0x55d644e9cdf8 "/test/10.5_dbg/wsrep-lib/src/transaction.cpp", line=line@entry=443, function=function@entry=0x55d644e9de20 "int wsrep::transaction::before_commit()") at assert.c:101
#8  0x000055d6448d3282 in wsrep::transaction::before_commit (this=this@entry=0x148c6c007278) at /test/10.5_dbg/wsrep-lib/src/transaction.cpp:530
#9  0x000055d643ef38f4 in wsrep::client_state::before_commit (this=0x148c6c007210) at /test/10.5_dbg/wsrep-lib/include/wsrep/client_state.hpp:503
#10 wsrep_before_commit (thd=thd@entry=0x148c6c000db8, all=all@entry=true) at /test/10.5_dbg/sql/wsrep_trans_observer.h:277
#11 0x000055d643f0a210 in ha_commit_trans (thd=thd@entry=0x148c6c000db8, all=all@entry=true) at /test/10.5_dbg/sql/handler.cc:1708
#12 0x000055d643d9adc8 in trans_commit_implicit (thd=thd@entry=0x148c6c000db8) at /test/10.5_dbg/sql/transaction.cc:329
#13 0x000055d643e4430d in sequence_insert (thd=thd@entry=0x148c6c000db8, lex=0x148c6c004e98, org_table_list=org_table_list@entry=0x148c6c013de8) at /test/10.5_dbg/sql/sql_sequence.cc:371
#14 0x000055d643d00fbb in mysql_create_table_no_lock (thd=thd@entry=0x148c6c000db8, db=db@entry=0x148c6c013e00, table_name=table_name@entry=0x148c6c013e10, create_info=create_info@entry=0x148ca9c71a70, alter_info=alter_info@entry=0x148ca9c719a0, is_trans=is_trans@entry=0x148ca9c718c7, create_table_mode=0, table_list=0x148c6c013de8) at /test/10.5_dbg/sql/sql_table.cc:5473
#15 0x000055d643d012d4 in mysql_create_table (thd=thd@entry=0x148c6c000db8, create_table=create_table@entry=0x148c6c013de8, create_info=create_info@entry=0x148ca9c71a70, alter_info=alter_info@entry=0x148ca9c719a0) at /test/10.5_dbg/sql/sql_table.cc:5564
#16 0x000055d643d02c9a in Sql_cmd_create_table_like::execute (this=0x148c6c013dc8, thd=0x148c6c000db8) at /test/10.5_dbg/sql/sql_table.cc:12142
#17 0x000055d643c2ff99 in mysql_execute_command (thd=thd@entry=0x148c6c000db8) at /test/10.5_dbg/sql/sql_parse.cc:6024
#18 0x000055d643c16685 in mysql_parse (thd=thd@entry=0x148c6c000db8, rawbuf=rawbuf@entry=0x148c6c013cc0 "CREATE TEMPORARY SEQUENCE seq1 ROW_FORMAT=REDUNDANT", length=length@entry=51, parser_state=parser_state@entry=0x148ca9c723d0, 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:8063
#19 0x000055d643c15fb0 in wsrep_mysql_parse (thd=thd@entry=0x148c6c000db8, rawbuf=0x148c6c013cc0 "CREATE TEMPORARY SEQUENCE seq1 ROW_FORMAT=REDUNDANT", length=51, parser_state=parser_state@entry=0x148ca9c723d0, 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:7866
#20 0x000055d643c2485e in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x148c6c000db8, packet=packet@entry=0x148c6c00b479 "CREATE TEMPORARY SEQUENCE seq1 ROW_FORMAT=REDUNDANT", packet_length=packet_length@entry=51, 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:1257
#21 0x000055d643c27fa6 in do_command (thd=0x148c6c000db8) at /test/10.5_dbg/sql/sql_parse.cc:1370
#22 0x000055d643d8502e in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55d6483dc898, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1410
#23 0x000055d643d85735 in handle_one_connection (arg=arg@entry=0x55d6483dc898) at /test/10.5_dbg/sql/sql_connect.cc:1312
#24 0x000055d64423dc39 in pfs_spawn_thread (arg=0x55d6484580d8) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
#25 0x0000148cdfe74609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#26 0x0000148cdfa63293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

10.4.19 245d33db4e0586df4fe28362fb002cef0151a1c9 (Debug)

mysqld: /test/10.4_dbg/wsrep-lib/src/transaction.cpp:443: int wsrep::transaction::before_commit(): Assertion `client_state_.mode() != wsrep::client_state::m_toi' failed.

10.4.19 245d33db4e0586df4fe28362fb002cef0151a1c9 (Debug)

Core was generated by `/test/GAL_MD230221-mariadb-10.4.19-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 0x1458440bb700 (LWP 1336214))]
(gdb) bt
#0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
#1  0x0000557ce79dedcd in my_write_core (sig=sig@entry=6) at /test/10.4_dbg/mysys/stacktrace.c:386
#2  0x0000557ce70ec370 in handle_fatal_signal (sig=6) at /test/10.4_dbg/sql/signal_handler.cc:344
#3  <signal handler called>
#4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#5  0x000014587abdd859 in __GI_abort () at abort.c:79
#6  0x000014587abdd729 in __assert_fail_base (fmt=0x14587ad73588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x557ce8008d88 "client_state_.mode() != wsrep::client_state::m_toi", file=0x557ce8007d38 "/test/10.4_dbg/wsrep-lib/src/transaction.cpp", line=443, function=<optimized out>) at assert.c:92
#7  0x000014587abeef36 in __GI___assert_fail (assertion=assertion@entry=0x557ce8008d88 "client_state_.mode() != wsrep::client_state::m_toi", file=file@entry=0x557ce8007d38 "/test/10.4_dbg/wsrep-lib/src/transaction.cpp", line=line@entry=443, function=function@entry=0x557ce8008d60 "int wsrep::transaction::before_commit()") at assert.c:101
#8  0x0000557ce7a7ccfe in wsrep::transaction::before_commit (this=this@entry=0x1457f0006fa0) at /test/10.4_dbg/wsrep-lib/src/transaction.cpp:530
#9  0x0000557ce70eea54 in wsrep::client_state::before_commit (this=0x1457f0006f38) at /test/10.4_dbg/wsrep-lib/include/wsrep/client_state.hpp:503
#10 wsrep_before_commit (thd=thd@entry=0x1457f0000d90, all=all@entry=true) at /test/10.4_dbg/sql/wsrep_trans_observer.h:273
#11 0x0000557ce710421b in ha_commit_trans (thd=thd@entry=0x1457f0000d90, all=all@entry=true) at /test/10.4_dbg/sql/handler.cc:1580
#12 0x0000557ce6f75cf1 in trans_commit_implicit (thd=thd@entry=0x1457f0000d90) at /test/10.4_dbg/sql/transaction.cc:301
#13 0x0000557ce701587c in sequence_insert (thd=thd@entry=0x1457f0000d90, lex=0x1457f0004c00, org_table_list=org_table_list@entry=0x1457f0013330) at /test/10.4_dbg/sql/sql_sequence.cc:371
#14 0x0000557ce6ee739b in mysql_create_table_no_lock (thd=thd@entry=0x1457f0000d90, db=db@entry=0x1457f0013348, table_name=table_name@entry=0x1457f0013358, create_info=create_info@entry=0x1458440b8810, alter_info=alter_info@entry=0x1458440b8750, is_trans=is_trans@entry=0x1458440b8677, create_table_mode=0, table_list=0x1457f0013330) at /test/10.4_dbg/sql/sql_table.cc:5220
#15 0x0000557ce6ee7694 in mysql_create_table (thd=thd@entry=0x1457f0000d90, create_table=create_table@entry=0x1457f0013330, create_info=create_info@entry=0x1458440b8810, alter_info=alter_info@entry=0x1458440b8750) at /test/10.4_dbg/sql/sql_table.cc:5302
#16 0x0000557ce6ee8fd7 in Sql_cmd_create_table_like::execute (this=0x1457f0013310, thd=0x1457f0000d90) at /test/10.4_dbg/sql/sql_table.cc:11525
#17 0x0000557ce6e1f702 in mysql_execute_command (thd=thd@entry=0x1457f0000d90) at /test/10.4_dbg/sql/sql_parse.cc:6161
#18 0x0000557ce6e21c49 in mysql_parse (thd=thd@entry=0x1457f0000d90, rawbuf=rawbuf@entry=0x1457f0013208 "CREATE TEMPORARY SEQUENCE seq1 ROW_FORMAT=REDUNDANT", length=length@entry=51, parser_state=parser_state@entry=0x1458440ba490, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.4_dbg/sql/sql_parse.cc:7959
#19 0x0000557ce6e22ce3 in wsrep_mysql_parse (thd=thd@entry=0x1457f0000d90, rawbuf=0x1457f0013208 "CREATE TEMPORARY SEQUENCE seq1 ROW_FORMAT=REDUNDANT", length=51, parser_state=parser_state@entry=0x1458440ba490, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.4_dbg/sql/sql_parse.cc:7763
#20 0x0000557ce6e24517 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x1457f0000d90, packet=packet@entry=0x1457f001b641 "CREATE TEMPORARY SEQUENCE seq1 ROW_FORMAT=REDUNDANT", packet_length=packet_length@entry=51, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.4_dbg/sql/sql_class.h:1170
#21 0x0000557ce6e27cb2 in do_command (thd=0x1457f0000d90) at /test/10.4_dbg/sql/sql_parse.cc:1373
#22 0x0000557ce6f61feb in do_handle_one_connection (connect=connect@entry=0x557cea065190) at /test/10.4_dbg/sql/sql_connect.cc:1412
#23 0x0000557ce6f6210a in handle_one_connection (arg=0x557cea065190) at /test/10.4_dbg/sql/sql_connect.cc:1316
#24 0x000014587b19a609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#25 0x000014587acda293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Bug confirmed present in:
MariaDB: 10.4.19 (dbg), 10.5.10 (dbg), 10.6.0 (dbg)

Bug (or feature/syntax) confirmed not present in:
MariaDB: 10.2.38 (dbg), 10.3.29 (dbg)



 Comments   
Comment by Daniele Sciascia [ 2021-04-29 ]

I think there are two issues here:

1) We attempt to replicate the CREATE TEMPORARY SEQUENCE, while we probably should not. Function wsrep_can_run_in_toi() should probably be extended so that it returns false for temporary sequence, similar to what we do for temporary tables: https://github.com/MariaDB/server/blob/10.4/sql/wsrep_mysqld.cc#L1805-L1810

2) CREATE TEMPORARY SEQUENCE causes an implicit commit. Is this expected?

Comment by Ramesh Sivaraman [ 2022-05-25 ]

A slightly different assertion was found when changing the wsrep_OSU_method from TOI to RSU.

SET AUTOCOMMIT = 0;
SET SESSION wsrep_OSU_method='RSU';
CREATE TABLE t1(c1 VARCHAR(10));
INSERT INTO t1 (c1) VALUES('');
CREATE TEMPORARY SEQUENCE s1 ENGINE=INNODB;

Leads to

10.4.29 841e8877ccb8ef5d692a22b4447383a360557326 (Debug)

mysqld: /test/10.4_dbg/wsrep-lib/src/transaction.cpp:554: int wsrep::transaction::before_commit(): Assertion `0' failed.

10.4.29 841e8877ccb8ef5d692a22b4447383a360557326 (Debug)

Core was generated by `/test/GAL_MD010323-mariadb-10.4.29-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 0x14bb39e67700 (LWP 482740))]
(gdb) bt
#0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
#1  0x000055c91f28a578 in my_write_core (sig=sig@entry=6) at /test/10.4_dbg/mysys/stacktrace.c:386
#2  0x000055c91ea9c946 in handle_fatal_signal (sig=6) at /test/10.4_dbg/sql/signal_handler.cc:368
#3  <signal handler called>
#4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#5  0x000014bb75fed859 in __GI_abort () at abort.c:79
#6  0x000014bb75fed729 in __assert_fail_base (fmt=0x14bb76183588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55c91f59112d "0", file=0x55c91f92d278 "/test/10.4_dbg/wsrep-lib/src/transaction.cpp", line=554, function=<optimized out>) at assert.c:92
#7  0x000014bb75ffefd6 in __GI___assert_fail (assertion=assertion@entry=0x55c91f59112d "0", file=file@entry=0x55c91f92d278 "/test/10.4_dbg/wsrep-lib/src/transaction.cpp", line=line@entry=554, function=function@entry=0x55c91f92e3e8 "int wsrep::transaction::before_commit()") at assert.c:101
#8  0x000055c91f3d5300 in wsrep::transaction::before_commit (this=this@entry=0x14baf4006e08) at /test/10.4_dbg/wsrep-lib/src/transaction.cpp:554
#9  0x000055c91eab09e5 in wsrep::client_state::before_commit (this=0x14baf4006da0) at /test/10.4_dbg/wsrep-lib/include/wsrep/client_state.hpp:502
#10 wsrep_before_commit (all=true, thd=0x14baf4000d28) at /test/10.4_dbg/sql/wsrep_trans_observer.h:277
#11 ha_commit_trans (thd=thd@entry=0x14baf4000d28, all=all@entry=true) at /test/10.4_dbg/sql/handler.cc:1609
#12 0x000055c91e960240 in trans_commit_implicit (thd=thd@entry=0x14baf4000d28) at /test/10.4_dbg/sql/transaction.cc:302
#13 0x000055c91e9f26b4 in sequence_insert (thd=thd@entry=0x14baf4000d28, lex=0x14baf4004a08, org_table_list=org_table_list@entry=0x14baf40125b8) at /test/10.4_dbg/sql/sql_sequence.cc:384
#14 0x000055c91e8e1ffa in mysql_create_table_no_lock (thd=thd@entry=0x14baf4000d28, db=db@entry=0x14baf40125d0, table_name=table_name@entry=0x14baf40125e0, create_info=create_info@entry=0x14bb39e647a0, alter_info=alter_info@entry=0x14bb39e646e0, is_trans=is_trans@entry=0x14bb39e64657, create_table_mode=0, table_list=0x14baf40125b8) at /test/10.4_dbg/sql/sql_table.cc:5280
#15 0x000055c91e8e22c8 in mysql_create_table (thd=thd@entry=0x14baf4000d28, create_table=create_table@entry=0x14baf40125b8, create_info=create_info@entry=0x14bb39e647a0, alter_info=alter_info@entry=0x14bb39e646e0) at /test/10.4_dbg/sql/sql_table.cc:5362
#16 0x000055c91e8e3b4c in Sql_cmd_create_table_like::execute (this=0x14baf4012598, thd=0x14baf4000d28) at /test/10.4_dbg/sql/sql_table.cc:11747
#17 0x000055c91e82b236 in mysql_execute_command (thd=thd@entry=0x14baf4000d28) at /test/10.4_dbg/sql/sql_parse.cc:6197
#18 0x000055c91e82d673 in mysql_parse (thd=thd@entry=0x14baf4000d28, rawbuf=rawbuf@entry=0x14baf40124a0 "CREATE TEMPORARY SEQUENCE s1 ENGINE=INNODB", length=length@entry=42, parser_state=parser_state@entry=0x14bb39e663b0, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.4_dbg/sql/sql_parse.cc:7986
#19 0x000055c91e82e4ac in wsrep_mysql_parse (thd=thd@entry=0x14baf4000d28, rawbuf=0x14baf40124a0 "CREATE TEMPORARY SEQUENCE s1 ENGINE=INNODB", length=42, parser_state=parser_state@entry=0x14bb39e663b0, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.4_dbg/sql/sql_parse.cc:7788
#20 0x000055c91e83005e in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14baf4000d28, packet=packet@entry=0x14baf401a679 "CREATE TEMPORARY SEQUENCE s1 ENGINE=INNODB", packet_length=packet_length@entry=42, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.4_dbg/sql/sql_class.h:1231
#21 0x000055c91e832856 in do_command (thd=0x14baf4000d28) at /test/10.4_dbg/sql/sql_parse.cc:1378
#22 0x000055c91e94f1b4 in do_handle_one_connection (connect=<optimized out>) at /test/10.4_dbg/sql/sql_connect.cc:1420
#23 0x000055c91e94f270 in handle_one_connection (arg=<optimized out>) at /test/10.4_dbg/sql/sql_connect.cc:1324
#24 0x000014bb764fe609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#25 0x000014bb760ea133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

10.5.16 3fabdc3ca889db0e490df3a9a48ae527f21eed45 (Debug)

mysqld: /test/10.5_dbg/wsrep-lib/src/transaction.cpp:552: int wsrep::transaction::before_commit(): Assertion `0' failed.

10.5.16 3fabdc3ca889db0e490df3a9a48ae527f21eed45 (Debug)

Core was generated by `/test/GAL_MD160522-mariadb-10.5.16-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 0x14ef99750700 (LWP 622290))]
(gdb) bt
#0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
#1  0x000055ef207f8f9e in my_write_core (sig=sig@entry=6) at /test/10.5_dbg/mysys/stacktrace.c:424
#2  0x000055ef2001724d in handle_fatal_signal (sig=6) at /test/10.5_dbg/sql/signal_handler.cc:344
#3  <signal handler called>
#4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#5  0x000014efd0380859 in __GI_abort () at abort.c:79
#6  0x000014efd0380729 in __assert_fail_base (fmt=0x14efd0516588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55ef20b3599d "0", file=0x55ef20ed7638 "/test/10.5_dbg/wsrep-lib/src/transaction.cpp", line=552, function=<optimized out>) at assert.c:92
#7  0x000014efd0391f36 in __GI___assert_fail (assertion=assertion@entry=0x55ef20b3599d "0", file=file@entry=0x55ef20ed7638 "/test/10.5_dbg/wsrep-lib/src/transaction.cpp", line=line@entry=552, function=function@entry=0x55ef20ed87a8 "int wsrep::transaction::before_commit()") at assert.c:101
#8  0x000055ef2094fbf4 in wsrep::transaction::before_commit (this=this@entry=0x14ef400070b0) at /test/10.5_dbg/wsrep-lib/src/transaction.cpp:552
#9  0x000055ef20019ab1 in wsrep::client_state::before_commit (this=0x14ef40007048) at /test/10.5_dbg/wsrep-lib/include/wsrep/client_state.hpp:503
#10 wsrep_before_commit (thd=thd@entry=0x14ef40000db8, all=all@entry=true) at /test/10.5_dbg/sql/wsrep_trans_observer.h:277
#11 0x000055ef2002d948 in ha_commit_trans (thd=thd@entry=0x14ef40000db8, all=all@entry=true) at /test/10.5_dbg/sql/handler.cc:1737
#12 0x000055ef1fecea2e in trans_commit_implicit (thd=thd@entry=0x14ef40000db8) at /test/10.5_dbg/sql/transaction.cc:329
#13 0x000055ef1ff6e72e in sequence_insert (thd=thd@entry=0x14ef40000db8, lex=0x14ef40004c98, org_table_list=org_table_list@entry=0x14ef40013c10) at /test/10.5_dbg/sql/sql_sequence.cc:376
#14 0x000055ef1fe4036d in mysql_create_table_no_lock (thd=thd@entry=0x14ef40000db8, db=db@entry=0x14ef40013c28, table_name=table_name@entry=0x14ef40013c38, create_info=create_info@entry=0x14ef9974ec10, alter_info=alter_info@entry=0x14ef9974eb40, is_trans=is_trans@entry=0x14ef9974eab7, create_table_mode=0, table_list=0x14ef40013c10) at /test/10.5_dbg/sql/sql_table.cc:5515
#15 0x000055ef1fe4066c in mysql_create_table (thd=thd@entry=0x14ef40000db8, create_table=create_table@entry=0x14ef40013c10, create_info=create_info@entry=0x14ef9974ec10, alter_info=alter_info@entry=0x14ef9974eb40) at /test/10.5_dbg/sql/sql_table.cc:5606
#16 0x000055ef1fe41fbd in Sql_cmd_create_table_like::execute (this=0x14ef40013bf0, thd=0x14ef40000db8) at /test/10.5_dbg/sql/sql_table.cc:12288
#17 0x000055ef1fd8125d in mysql_execute_command (thd=thd@entry=0x14ef40000db8) at /test/10.5_dbg/sql/sql_parse.cc:6072
#18 0x000055ef1fd68d30 in mysql_parse (thd=thd@entry=0x14ef40000db8, rawbuf=rawbuf@entry=0x14ef40013b00 "CREATE TEMPORARY SEQUENCE f ENGINE=MEMORY", length=length@entry=41, parser_state=parser_state@entry=0x14ef9974f480, 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:8116
#19 0x000055ef1fd6871a in wsrep_mysql_parse (thd=thd@entry=0x14ef40000db8, rawbuf=0x14ef40013b00 "CREATE TEMPORARY SEQUENCE f ENGINE=MEMORY", length=41, parser_state=parser_state@entry=0x14ef9974f480, 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:7919
#20 0x000055ef1fd76ea6 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14ef40000db8, packet=packet@entry=0x14ef4000b2b9 "CREATE TEMPORARY SEQUENCE f ENGINE=MEMORY", packet_length=packet_length@entry=41, 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:1290
#21 0x000055ef1fd799a9 in do_command (thd=0x14ef40000db8) at /test/10.5_dbg/sql/sql_parse.cc:1375
#22 0x000055ef1febab8a in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55ef22e7fd08, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1418
#23 0x000055ef1febb095 in handle_one_connection (arg=0x55ef22e7fd08) at /test/10.5_dbg/sql/sql_connect.cc:1312
#24 0x000014efd088f609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#25 0x000014efd047d293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Comment by Ramesh Sivaraman [ 2023-03-16 ]

seppo Release build also crashes when binary log is enabled.

# mysqld options required for replay:  --log-bin
SET autocommit=OFF;
CREATE TABLE t (c INT) ENGINE=InnoDB;
INSERT INTO t VALUES (0);
CREATE TEMPORARY SEQUENCE s;

Leads to:

11.0.2 d77aaa6994b30660bd8788d3415ae4a44f55d9a0 (Optimized)

Core was generated by `/test/GAL_MD130323-mariadb-11.0.2-linux-x86_64-opt/bin/mysqld --defaults-file=/'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=11)
    at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
[Current thread is 1 (Thread 0x154a183c0700 (LWP 4157827))]
(gdb) bt
#0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=11) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
#1  0x00005623dd30fddf in my_write_core (sig=sig@entry=11) at /test/11.0_opt/mysys/stacktrace.c:424
#2  0x00005623dce74fb0 in handle_fatal_signal (sig=11) at /test/11.0_opt/sql/signal_handler.cc:357
#3  <signal handler called>
#4  0x0000154a4e5a6626 in galera::ReplicatorSMM::CommitOrder::CommitOrder (mode=galera::ReplicatorSMM::CommitOrder::NO_OOOC, ts=<error reading variable>, this=<synthetic pointer>) at /test/galera_4x_dbg/galera/src/replicator_smm.hpp:740
#5  galera::ReplicatorSMM::commit_order_leave (this=this@entry=0x5623dfb714a0, ts=<error reading variable>, error=error@entry=0x154a183bb350) at /test/galera_4x_dbg/galera/src/replicator_smm.cpp:1430
#6  0x0000154a4e584ca9 in galera_commit_order_leave (gh=<optimized out>, ws_handle=<optimized out>, meta=<optimized out>, error=0x154a183bb350) at /usr/include/c++/9/bits/atomic_base.h:539
#7  0x00005623dd4aeb30 in wsrep::wsrep_provider_v26::commit_order_leave (this=<optimized out>, ws_handle=<optimized out>, ws_meta=<optimized out>, err=<optimized out>) at /test/11.0_opt/wsrep-lib/src/wsrep_provider_v26.cpp:276
#8  0x00005623dd4a1143 in wsrep::transaction::ordered_commit (this=0x1549a00070f0) at /test/11.0_opt/wsrep-lib/include/wsrep/server_state.hpp:320
#9  0x00005623dd0d7018 in wsrep::client_state::ordered_commit (this=<optimized out>) at /test/11.0_opt/wsrep-lib/include/wsrep/client_state.hpp:509
#10 wsrep_commit_ordered (thd=<optimized out>) at /test/11.0_opt/sql/service_wsrep.cc:348
#11 0x0000000000000000 in ?? ()

Comment by Jan Lindström [ 2023-03-27 ]

https://github.com/MariaDB/server/pull/2568

Comment by Julius Goryavsky [ 2023-03-31 ]

Everything works, no regressions were found during testing, merged as https://github.com/MariaDB/server/commit/eaebe8b5600b144c51a9405de42a70bd4b710987

Comment by Julius Goryavsky [ 2023-03-31 ]

Everything works, no regressions were found during testing, merged as https://github.com/MariaDB/server/commit/eaebe8b5600b144c51a9405de42a70bd4b710987

Generated at Thu Feb 08 09:34:42 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.