Bug #86174 Assert (*thd)->get_transaction()->xid_state()-> has_state(XID_STATE::XA_IDLE)...

Submitted: 4 May 2017 4:17 Modified: 16 Aug 2017 8:27
Reporter: Roel Van de Paar Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: XA transactions Severity:S1 (Critical)
Version:5.7.17, 5.7.18 OS:Any
Assigned to: CPU Architecture:Any

[4 May 2017 4:17] Roel Van de Paar
Description:
2017-05-04T03:50:53.388708Z 3 [Note] Changed GTID_MODE from OFF_PERMISSIVE to ON_PERMISSIVE.
mysqld: /git/mysql-server_dbg/sql/rpl_gtid_persist.cc:180: bool Gtid_table_access_context::init(THD**, TABLE**, bool): Assertion `(*thd)->get_transaction()->xid_state()-> has_state(XID_STATE::XA_IDLE) || (*thd)->get_transaction()->xid_state()-> has_state(XID_STATE::XA_PREPARED)' failed.
03:50:53 UTC - mysqld got signal 6 ;

#0  0x00007fa8a5281741 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
#1  0x0000000001826d71 in my_write_core (sig=6) at /git/mysql-server_dbg/mysys/stacktrace.c:249
#2  0x0000000000e75574 in handle_fatal_signal (sig=6) at /git/mysql-server_dbg/sql/signal_handler.cc:220
#3  <signal handler called>
#4  0x00007fa8a36151d7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#5  0x00007fa8a36168c8 in __GI_abort () at abort.c:90
#6  0x00007fa8a360e146 in __assert_fail_base (fmt=0x7fa8a375f3a8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", 
    assertion=assertion@entry=0x201d350 "(*thd)->get_transaction()->xid_state()-> has_state(XID_STATE::XA_IDLE) || (*thd)->get_transaction()->xid_state()-> has_state(XID_STATE::XA_PREPARED)", 
    file=file@entry=0x201d230 "/git/mysql-server_dbg/sql/rpl_gtid_persist.cc", line=line@entry=180, 
    function=function@entry=0x201dc80 <Gtid_table_access_context::init(THD**, TABLE**, bool)::__PRETTY_FUNCTION__> "bool Gtid_table_access_context::init(THD**, TABLE**, bool)") at assert.c:92
#7  0x00007fa8a360e1f2 in __GI___assert_fail (
    assertion=0x201d350 "(*thd)->get_transaction()->xid_state()-> has_state(XID_STATE::XA_IDLE) || (*thd)->get_transaction()->xid_state()-> has_state(XID_STATE::XA_PREPARED)", file=0x201d230 "/git/mysql-server_dbg/sql/rpl_gtid_persist.cc", line=180, 
    function=0x201dc80 <Gtid_table_access_context::init(THD**, TABLE**, bool)::__PRETTY_FUNCTION__> "bool Gtid_table_access_context::init(THD**, TABLE**, bool)") at assert.c:101
#8  0x000000000174e975 in Gtid_table_access_context::init (this=0x7fa8a58713d0, thd=0x7fa8a5871478, table=0x7fa8a5871480, 
    is_write=true) at /git/mysql-server_dbg/sql/rpl_gtid_persist.cc:177
#9  0x000000000174f6a0 in Gtid_table_persistor::save (this=0x7fa8a142f080, gtid_set=0x7fa8a5871530)
    at /git/mysql-server_dbg/sql/rpl_gtid_persist.cc:432
#10 0x0000000001749388 in Gtid_state::save (this=0x7fa89b3eaa00, gtid_set=0x7fa8a5871530)
    at /git/mysql-server_dbg/sql/rpl_gtid_state.cc:732
#11 0x000000000174952d in Gtid_state::save_gtids_of_last_binlog_into_table (this=0x7fa89b3eaa00, on_rotation=true)
    at /git/mysql-server_dbg/sql/rpl_gtid_state.cc:771
#12 0x00000000017963ee in MYSQL_BIN_LOG::new_file_impl (this=0x2b5da40 <mysql_bin_log>, need_lock_log=false, 
    extra_description_event=0x0) at /git/mysql-server_dbg/sql/binlog.cc:6634
#13 0x0000000001795e41 in MYSQL_BIN_LOG::new_file_without_locking (this=0x2b5da40 <mysql_bin_log>, extra_description_event=0x0)
    at /git/mysql-server_dbg/sql/binlog.cc:6519
#14 0x0000000001797a8b in MYSQL_BIN_LOG::rotate (this=0x2b5da40 <mysql_bin_log>, force_rotate=true, check_purge=0x7fa8a58722ae)
    at /git/mysql-server_dbg/sql/binlog.cc:7165
#15 0x00000000015b87b1 in Sys_var_enum_binlog_checksum::global_update (this=0x2b50220 <Binlog_checksum_enum>, thd=0x7fa867819000, 
    var=0x7fa86782bc68) at /git/mysql-server_dbg/sql/sys_vars.cc:3564
#16 0x000000000142f766 in sys_var::update (this=0x2b50220 <Binlog_checksum_enum>, thd=0x7fa867819000, var=0x7fa86782bc68)
    at /git/mysql-server_dbg/sql/set_var.cc:183
#17 0x0000000001430de0 in set_var::update (this=0x7fa86782bc68, thd=0x7fa867819000) at /git/mysql-server_dbg/sql/set_var.cc:802
#18 0x0000000001430703 in sql_set_variables (thd=0x7fa867819000, var_list=0x7fa86781b6d0)
    at /git/mysql-server_dbg/sql/set_var.cc:662
#19 0x00000000014f63e5 in mysql_execute_command (thd=0x7fa867819000, first_level=true)
    at /git/mysql-server_dbg/sql/sql_parse.cc:3717
#20 0x00000000014fb5f5 in mysql_parse (thd=0x7fa867819000, parser_state=0x7fa8a5873550)
    at /git/mysql-server_dbg/sql/sql_parse.cc:5611
#21 0x00000000014f0c1d in dispatch_command (thd=0x7fa867819000, com_data=0x7fa8a5873cb0, command=COM_QUERY)
    at /git/mysql-server_dbg/sql/sql_parse.cc:1461
#22 0x00000000014efa44 in do_command (thd=0x7fa867819000) at /git/mysql-server_dbg/sql/sql_parse.cc:999
#23 0x000000000161f9d0 in handle_connection (arg=0x7fa87a788960)
    at /git/mysql-server_dbg/sql/conn_handler/connection_handler_per_thread.cc:300
#24 0x00000000018534f9 in pfs_spawn_thread (arg=0x7fa888e76220) at /git/mysql-server_dbg/storage/perfschema/pfs.cc:2188
#25 0x00007fa8a527cdc5 in start_thread (arg=0x7fa8a5874700) at pthread_create.c:308
#26 0x00007fa8a36d773d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

How to repeat:
# mysqld options required for replay:  --sql_mode= --server-id=100 --log-bin
DROP DATABASE test;
SET GLOBAL GTID_MODE=OFF_PERMISSIVE;
set global gtid_mode=on_permissive;
grant insert on test.* to '_2';
XA START 'xa_high_prio';
set @@global.binlog_checksum=CRC32;

Suggested fix:
This bug may be a regression and may be connected with other bugs (ref bug 85220).
[4 May 2017 5:33] MySQL Verification Team
Hello Roel,

Thank you for the report and test case.
Observed that 5.7.18 debug build is affected.

Thanks,
Umesh
[16 Aug 2017 8:27] Venkatesh Duggirala
This bug is marked as duplicate of Bug#80699

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.054 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.