sql/binlog.cc:7987: virtual int MYSQL_BIN_LOG::prepare(THD*, bool): Assertion `thd->slave_thread ? opt_log_slave_updates : thd->variables.sql_log_bin' failed.

Bug #1534249 reported by George Ormond Lorch III
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL Server
Unknown
Unknown
Percona Server moved to https://jira.percona.com/projects/PS
Status tracked in 5.7
5.6
Invalid
Undecided
Unassigned
5.7
Fix Released
High
George Ormond Lorch III

Bug Description

stack_bottom = 7f82e420f980 thread_stack 0x40000
/ssd/toku/5.7-laurynas/percona-server-install/sql/mysqld(my_print_stacktrace+0x38)[0x17a88a4]
/ssd/toku/5.7-laurynas/percona-server-install/sql/mysqld(handle_fatal_signal+0x3b7)[0xe1abd8]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x10340)[0x7f83021ba340]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x39)[0x7f83015fbcc9]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x148)[0x7f83015ff0d8]
/lib/x86_64-linux-gnu/libc.so.6(+0x2fb86)[0x7f83015f4b86]
/lib/x86_64-linux-gnu/libc.so.6(+0x2fc32)[0x7f83015f4c32]
/ssd/toku/5.7-laurynas/percona-server-install/sql/mysqld(_ZN13MYSQL_BIN_LOG7prepareEP3THDb+0x9e)[0x171b4de]
/ssd/toku/5.7-laurynas/percona-server-install/sql/mysqld(_Z15ha_commit_transP3THDbb+0x5fc)[0xe9ddb7]
/ssd/toku/5.7-laurynas/percona-server-install/sql/mysqld(_Z12trans_commitP3THD+0xba)[0x15a32ca]
/ssd/toku/5.7-laurynas/percona-server-install/sql/mysqld(_ZN13Xid_log_event9do_commitEP3THD+0x43)[0x16e4607]
/ssd/toku/5.7-laurynas/percona-server-install/sql/mysqld(_ZN19Xid_apply_log_event14do_apply_eventEPK14Relay_log_info+0x766)[0x16e50f4]
/ssd/toku/5.7-laurynas/percona-server-install/sql/mysqld(_ZN9Log_event11apply_eventEP14Relay_log_info+0x473)[0x16d9501]
/ssd/toku/5.7-laurynas/percona-server-install/sql/mysqld(_Z26apply_event_and_update_posPP9Log_eventP3THDP14Relay_log_info+0x441)[0x1747db5]
/ssd/toku/5.7-laurynas/percona-server-install/sql/mysqld[0x17494a8]
/ssd/toku/5.7-laurynas/percona-server-install/sql/mysqld(handle_slave_sql+0xebc)[0x174fcc5]
/ssd/toku/5.7-laurynas/percona-server-install/sql/mysqld(pfs_spawn_thread+0x170)[0x1c1c07d]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x8182)[0x7f83021b2182]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f83016bf47d]

Setup basic master-slave w/ binlog replication.

Master options:
server-id=1
log-bin=mysql-bin
max_connections=1000
plugin-load=TokuDB=ha_tokudb.so;TokuDB_trx=ha_tokudb.so;TokuDB_locks=ha_tokudb.so;TokuDB_lock_waits=ha_tokudb.so;TokuDB_file_map=ha_tokudb.so;TokuDB_fractal_tree_info=ha_tokudb.so;TokuDB_fractal_tree_block_map=ha_tokudb.so;TokuDB_background_job_status=ha_tokudb.so

Slave options:
server-id=2
log-bin=mysql-bin
log-slave-updates=0 ### Note, this is critical to reproducing the bug ###
max_connections=1000
plugin-load=TokuDB=ha_tokudb.so;TokuDB_trx=ha_tokudb.so;TokuDB_locks=ha_tokudb.so;TokuDB_lock_waits=ha_tokudb.so;TokuDB_file_map=ha_tokudb.so;TokuDB_fractal_tree_info=ha_tokudb.so;TokuDB_fractal_tree_block_map=ha_tokudb.so;TokuDB_background_job_status=ha_tokudb.so

On the master:
CREATE TABLE t1(`a` INT) ENGINE=TokuDB;
CREATE TABLE t2(`a` INT) ENGINE=InnoDB;
begin;
insert into t1 values (1);
insert into t2 values (1);
commit;

The slave will crash as it processes the commit.

1) Slave is started with binlog enabled, but with slave updates not being logged, thus, it has chosen binlog not mmap as the transaction coordinator.
1) Use two different transactional engines within one transaction
3) A mixed engine transaction comes from the master. It should not be binlogged, but binlog acts as the transaction coordinator and asserts.

This is a new assertion in 5.7 in sql/binlog.cc : MYSQL_BIN_LOG::prepare introduced with this upstream commit https://github.com/percona/percona-server/commit/c60ac300ad2e5d1396694fb9f642b78b10bc3c93

Revision history for this message
George Ormond Lorch III (gl-az) wrote :
tags: added: upstream
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-3361

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.