[MDEV-29808] Assertion `thd->wsrep_exec_mode == LOCAL_STATE' failed in int wsrep_prepare(handlerton*, THD*, bool) Created: 2022-10-17  Updated: 2023-04-11

Status: Open
Project: MariaDB Server
Component/s: Galera
Affects Version/s: 10.3
Fix Version/s: 10.3

Type: Bug Priority: Major
Reporter: Ramesh Sivaraman Assignee: Daniele Sciascia
Resolution: Unresolved Votes: 0
Labels: debug, not-10.4, not-10.5, not-10.6, not-10.7, not-10.8, not-10.9


 Description   

CREATE OR REPLACE TABLE t1 (a INT) engine=InnoDB;
CREATE TABLE ti ( id BIGINT NOT NULL, PRIMARY KEY(id)) engine=InnoDB;
XA START 'a';
INSERT INTO t1 (a) VALUES (1);
SAVEPOINT s3;
XA END 'a';
XA PREPARE 'a';
SET GLOBAL wsrep_on=OFF;
XA ROLLBACK 'a';
SET GLOBAL wsrep_on=ON;
INSERT INTO ti VALUES (10);

Leads to

10.3.37 4fec99a2ba6034592d273d918402540d3d4fe772 (Debug)

mysqld: /test/10.3_dbg/sql/wsrep_hton.cc:215: int wsrep_prepare(handlerton*, THD*, bool): Assertion `thd->wsrep_exec_mode == LOCAL_STATE' failed.

10.3.37 4fec99a2ba6034592d273d918402540d3d4fe772 (Debug)

Core was generated by `/test/GAL_MD121022-mariadb-10.3.37-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 0x14bad00e0700 (LWP 375015))]
(gdb) bt
#0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
#1  0x000055fffa644e68 in my_write_core (sig=sig@entry=6) at /test/10.3_dbg/mysys/stacktrace.c:386
#2  0x000055fff9e992c6 in handle_fatal_signal (sig=6) at /test/10.3_dbg/sql/signal_handler.cc:365
#3  <signal handler called>
#4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#5  0x000014bae253c859 in __GI_abort () at abort.c:79
#6  0x000014bae253c729 in __assert_fail_base (fmt=0x14bae26d2588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55fffa728a90 "thd->wsrep_exec_mode == LOCAL_STATE", file=0x55fffa7283f8 "/test/10.3_dbg/sql/wsrep_hton.cc", line=215, function=<optimized out>) at assert.c:92
#7  0x000014bae254dfd6 in __GI___assert_fail (assertion=assertion@entry=0x55fffa728a90 "thd->wsrep_exec_mode == LOCAL_STATE", file=file@entry=0x55fffa7283f8 "/test/10.3_dbg/sql/wsrep_hton.cc", line=line@entry=215, function=function@entry=0x55fffa728a60 "int wsrep_prepare(handlerton*, THD*, bool)") at assert.c:101
#8  0x000055fff9de81fa in wsrep_prepare (hton=<optimized out>, thd=0x14ba60000d28, all=false) at /test/10.3_dbg/sql/wsrep_hton.cc:215
#9  0x000055fff9e999ec in prepare_or_error (ht=ht@entry=0x55fffd8261d8, thd=thd@entry=0x14ba60000d28, all=all@entry=false) at /test/10.3_dbg/sql/handler.cc:1208
#10 0x000055fff9e9d3e7 in ha_commit_trans (thd=thd@entry=0x14ba60000d28, all=all@entry=false) at /test/10.3_dbg/sql/handler.cc:1522
#11 0x000055fff9d69978 in trans_commit_stmt (thd=thd@entry=0x14ba60000d28) at /test/10.3_dbg/sql/transaction.cc:506
#12 0x000055fff9c49183 in mysql_execute_command (thd=thd@entry=0x14ba60000d28) at /test/10.3_dbg/sql/sql_parse.cc:6152
#13 0x000055fff9c4a72d in mysql_parse (thd=thd@entry=0x14ba60000d28, rawbuf=rawbuf@entry=0x14ba60010990 "INSERT INTO ti VALUES (10)", length=length@entry=26, parser_state=parser_state@entry=0x14bad00df5b0, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.3_dbg/sql/sql_parse.cc:7855
#14 0x000055fff9c4b81a in wsrep_mysql_parse (thd=thd@entry=0x14ba60000d28, rawbuf=0x14ba60010990 "INSERT INTO ti VALUES (10)", length=26, parser_state=parser_state@entry=0x14bad00df5b0, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.3_dbg/sql/sql_parse.cc:7647
#15 0x000055fff9c4c81c in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14ba60000d28, packet=packet@entry=0x14ba60018ad9 "INSERT INTO ti VALUES (10)", packet_length=packet_length@entry=26, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.3_dbg/sql/sql_class.h:1153
#16 0x000055fff9c4ec7f in do_command (thd=0x14ba60000d28) at /test/10.3_dbg/sql/sql_parse.cc:1398
#17 0x000055fff9d5a99b in do_handle_one_connection (connect=<optimized out>) at /test/10.3_dbg/sql/sql_connect.cc:1403
#18 0x000055fff9d5aacb in handle_one_connection (arg=<optimized out>) at /test/10.3_dbg/sql/sql_connect.cc:1308
#19 0x000014bae2714609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#20 0x000014bae2639133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95


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