[MDEV-22222] Assertion `state() == s_executing || state() == s_preparing || state() == s_prepared || state() == s_must_abort || state() == s_aborting || state() == s_cert_failed || state() == s_must_replay' failed in wsrep::transaction::before_rollback Created: 2020-04-11  Updated: 2023-05-18  Resolved: 2020-07-06

Status: Closed
Project: MariaDB Server
Component/s: wsrep
Affects Version/s: 10.4, 10.5
Fix Version/s: 10.4.14, 10.5.5

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Julius Goryavsky
Resolution: Fixed Votes: 2
Labels: None
Environment:

Galera 26.4.4(r4599)


Issue Links:
Relates
relates to MDEV-22223 Server crashes in gu::Mutex::lock / g... Closed
relates to MDEV-23025 int wsrep::transaction::before_rollba... Closed
relates to MDEV-23057 wsrep::transaction::before_rollback()... Closed
relates to MDEV-18935 Galera test mysql-wsrep#198 sporaric ... Closed
relates to MDEV-22897 mariadb server crashed on 2 instances... Closed

 Description   

The test case to be put under suite/galera/t/

--source include/galera_cluster.inc
 
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
START TRANSACTION;
INSERT INTO t1 VALUES (1);
--error ER_NO_SUCH_TABLE
LOCK TABLES t2 READ;
 
# Cleanup
DROP TABLE t1;

10.4 edc3899d

mysqld: /data/src/10.4/wsrep-lib/src/transaction.cpp:632: int wsrep::transaction::before_rollback(): Assertion `state() == s_executing || state() == s_preparing || state() == s_prepared || state(
) == s_must_abort || state() == s_aborting || state() == s_cert_failed || state() == s_must_replay' failed.
200412  0:37:40 [ERROR] mysqld got signal 6 ;
 
ng || state() == s_cert_failed || state() == s_must_replay", file=0x559bde0966c0 "/data/src/10.4/wsrep-lib/src/transaction.cpp", line=632, function=0x559bde09ae80 <wsrep::transaction::before_rollback()::__PRETTY_FUNCTION__> "int wsrep::transaction::before_rollback()") at assert.c:101
#8  0x0000559bdd512dc2 in wsrep::transaction::before_rollback (this=0x62b000110470) at /data/src/10.4/wsrep-lib/src/transaction.cpp:625
#9  0x0000559bdb6853e3 in wsrep::client_state::before_rollback (this=0x62b000110408) at /data/src/10.4/wsrep-lib/include/wsrep/client_state.hpp:496
#10 0x0000559bdbfb92a2 in wsrep_before_rollback (thd=0x62b00010a270, all=true) at /data/src/10.4/sql/wsrep_trans_observer.h:364
#11 0x0000559bdbfc3deb in ha_rollback_trans (thd=0x62b00010a270, all=true) at /data/src/10.4/sql/handler.cc:1873
#12 0x0000559bdbbe3bca in trans_rollback (thd=0x62b00010a270) at /data/src/10.4/sql/transaction.cc:341
#13 0x0000559bdb7dbf07 in lock_tables_open_and_lock_tables (thd=0x62b00010a270, tables=0x62b000111380) at /data/src/10.4/sql/sql_parse.cc:2966
#14 0x0000559bdb7eb18c in mysql_execute_command (thd=0x62b00010a270) at /data/src/10.4/sql/sql_parse.cc:5025
#15 0x0000559bdb80046a in mysql_parse (thd=0x62b00010a270, rawbuf=0x62b000111290 "LOCK TABLES t2 READ", length=19, parser_state=0x7f5ee8b7e5d0, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:7900
#16 0x0000559bdb7feeba in wsrep_mysql_parse (thd=0x62b00010a270, rawbuf=0x62b000111290 "LOCK TABLES t2 READ", length=19, parser_state=0x7f5ee8b7e5d0, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:7704
#17 0x0000559bdb7d50b0 in dispatch_command (command=COM_QUERY, thd=0x62b00010a270, packet=0x6290002fd271 "LOCK TABLES t2 READ", packet_length=19, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1827
#18 0x0000559bdb7d1a88 in do_command (thd=0x62b00010a270) at /data/src/10.4/sql/sql_parse.cc:1359
#19 0x0000559bdbba9dc4 in do_handle_one_connection (connect=0x61100006f4b0) at /data/src/10.4/sql/sql_connect.cc:1412
#20 0x0000559bdbba9666 in handle_one_connection (arg=0x61100006f4b0) at /data/src/10.4/sql/sql_connect.cc:1316
#21 0x0000559bdd1e7531 in pfs_spawn_thread (arg=0x61600007ecf0) at /data/src/10.4/storage/perfschema/pfs.cc:1869
#22 0x00007f5f04ce7fa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
#23 0x00007f5f045364cf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Reproducible on 10.4, 10.5.
Not reproducible on 10.3.
No obvious effect on a non-debug build.



 Comments   
Comment by Kester Riley [ 2020-06-24 ]

Is there a workaround for this, or a fixed plan?

It is impacting one of my customers daily.

Comment by Julius Goryavsky [ 2020-07-03 ]

everything is working, fix here: https://github.com/MariaDB/server/commit/1bf863a91a8ad8cd6ba8e50db34b302120feaa29

Comment by Julius Goryavsky [ 2020-07-06 ]

Fixed, https://github.com/MariaDB/server/commit/1bf863a91a8ad8cd6ba8e50db34b302120feaa29

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