Bug #80665 Assertion `thd->owned_gtid. sidno == THD::OWNED_SIDNO_ANONYMOUS' failed
Submitted: 9 Mar 2016 6:17 Modified: 9 Mar 2016 7:16
Reporter: Ramesh Sivaraman Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:5.7.10, 5.7.11 OS:CentOS
Assigned to: CPU Architecture:Any
Tags: debug

[9 Mar 2016 6:17] Ramesh Sivaraman
Description:
Error info 

Version: '5.7.10-debug-log'  socket: '/dev/shm/1452850231/socket.sock'  port: 31962  MySQL Community Server (GPL)
mysqld: /sda/mysql-server_dbg/sql/binlog.cc:1157: bool MYSQL_BIN_LOG::write_gtid(THD*, binlog_cache_data*, Binlog_event_writer*): Assertion `thd->owned_gtid.
sidno == THD::OWNED_SIDNO_ANONYMOUS' failed.

GDB info

#0  0x00007f03f4b4b741 in pthread_kill () from /lib64/libpthread.so.0
#1  0x00000000017ef51c in my_write_core (sig=6) at /sda/mysql-server_dbg/mysys/stacktrace.c:247
#2  0x0000000000e583e4 in handle_fatal_signal (sig=6) at /sda/mysql-server_dbg/sql/signal_handler.cc:220
#3  <signal handler called>
#4  0x00007f03f2cd75f7 in raise () from /lib64/libc.so.6
#5  0x00007f03f2cd8ce8 in abort () from /lib64/libc.so.6
#6  0x00007f03f2cd0566 in __assert_fail_base () from /lib64/libc.so.6
#7  0x00007f03f2cd0612 in __assert_fail () from /lib64/libc.so.6
#8  0x0000000001755014 in MYSQL_BIN_LOG::write_gtid (this=0x2b0d6c0 <mysql_bin_log>, thd=0x7f03b3819000, cache_data=0x7f03b39422a0, writer=0x7f03f50ff250) at /sda/mysql-server_dbg/sql/binlog.cc:1157
#9  0x0000000001755ad7 in binlog_cache_data::flush (this=0x7f03b39422a0, thd=0x7f03b3819000, bytes_written=0x7f03f50ff2c0, wrote_xid=0x7f03f50ff2f7) at /sda/mysql-server_dbg/sql/binlog.cc:1427
#10 0x000000000176e737 in binlog_cache_mngr::flush (this=0x7f03b39422a0, thd=0x7f03b3819000, bytes_written=0x7f03f50ff2f8, wrote_xid=0x7f03f50ff2f7) at /sda/mysql-server_dbg/sql/binlog.cc:725
#11 0x0000000001765483 in MYSQL_BIN_LOG::flush_thread_caches (this=0x2b0d6c0 <mysql_bin_log>, thd=0x7f03b3819000) at /sda/mysql-server_dbg/sql/binlog.cc:8097
#12 0x000000000176568d in MYSQL_BIN_LOG::process_flush_stage_queue (this=0x2b0d6c0 <mysql_bin_log>, total_bytes_var=0x7f03f50ff438, rotate_var=0x7f03f50ff437, out_queue_var=0x7f03f50ff428) at /sda/mysql-server_dbg/sql/binlog.cc:8159
#13 0x0000000001766bca in MYSQL_BIN_LOG::ordered_commit (this=0x2b0d6c0 <mysql_bin_log>, thd=0x7f03b3819000, all=false, skip_commit=false) at /sda/mysql-server_dbg/sql/binlog.cc:8789
#14 0x000000000176534c in MYSQL_BIN_LOG::commit (this=0x2b0d6c0 <mysql_bin_log>, thd=0x7f03b3819000, all=false) at /sda/mysql-server_dbg/sql/binlog.cc:8061
#15 0x00000000015e0971 in trans_commit_stmt (thd=0x7f03b3819000) at /sda/mysql-server_dbg/sql/transaction.cc:463
#16 0x00000000014e9d6e in mysql_execute_command (thd=0x7f03b3819000, first_level=true) at /sda/mysql-server_dbg/sql/sql_parse.cc:4946
#17 0x00000000014eb3dd in mysql_parse (thd=0x7f03b3819000, parser_state=0x7f03f5101560) at /sda/mysql-server_dbg/sql/sql_parse.cc:5508
#18 0x00000000014e0d17 in dispatch_command (thd=0x7f03b3819000, com_data=0x7f03f5101cb0, command=COM_QUERY) at /sda/mysql-server_dbg/sql/sql_parse.cc:1425
#19 0x00000000014dfbe1 in do_command (thd=0x7f03b3819000) at /sda/mysql-server_dbg/sql/sql_parse.cc:993
#20 0x000000000160adc7 in handle_connection (arg=0x7f03de7ff9c0) at /sda/mysql-server_dbg/sql/conn_handler/connection_handler_per_thread.cc:301
#21 0x000000000188e1b8 in pfs_spawn_thread (arg=0x7f03dcbf0220) at /sda/mysql-server_dbg/storage/perfschema/pfs.cc:2192
#22 0x00007f03f4b46dc5 in start_thread () from /lib64/libpthread.so.0
#23 0x00007f03f2d9821d in clone () from /lib64/libc.so.6

How to repeat:
Testcase

startup options :

--server-id=100  --log-bin=binlog --binlog_format=MIXED

DROP DATABASE test;CREATE DATABASE test;USE test;
drop table mysql.event;
SET GTID_NEXT='ANONYMOUS';
DROP DATABASE test;
[9 Mar 2016 7:16] MySQL Verification Team
Hello Ramesh,

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

Thanks,
Umesh