1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-31779 Server crash in Rows_log_event::update_sequence upon replaying binary log

The crash at running mysqlbinlog on a SEQUENCE containing binlog file
was caused MDEV-29621 fixes that did not check which of the slave
or binlog applier executes a block introduced there.

The block is meaningful only for the parallel slave applier, so
it's safe to fix this bug with identified the actual applier and
skipping the block when it's the mysqlbinlog one.
This commit is contained in:
Andrei
2024-04-10 18:19:43 +03:00
parent b697dce8ca
commit 0da1653f1b
3 changed files with 29 additions and 0 deletions

View File

@ -127,4 +127,14 @@ CREATE SEQUENCE s4;
DROP SEQUENCE s2,s3,s4;
DROP TABLE ti;
connection slave;
connection master;
CREATE SEQUENCE s;
SELECT NEXTVAL(s);
NEXTVAL(s)
1
flush binary logs;
DROP SEQUENCE s;
DROP SEQUENCE s;
connection slave;
connection master;
include/rpl_end.inc

View File

@ -195,4 +195,22 @@ DROP TABLE ti;
--sync_slave_with_master
# MDEV-31779 server crash in Rows_log_event::update_sequence at replaying binlog
--connection master
--let $binlog_file = query_get_value(SHOW MASTER STATUS, File, 1)
--let $binlog_start = query_get_value(SHOW MASTER STATUS, Position, 1)
CREATE SEQUENCE s;
--disable_ps2_protocol
SELECT NEXTVAL(s);
--enable_ps2_protocol
flush binary logs;
DROP SEQUENCE s;
--exec $MYSQL_BINLOG $datadir/$binlog_file | $MYSQL test
DROP SEQUENCE s;
--sync_slave_with_master
--connection master
--source include/rpl_end.inc

View File

@ -7544,6 +7544,7 @@ int Rows_log_event::update_sequence()
#if defined(WITH_WSREP)
! WSREP(thd) &&
#endif
table->in_use->rgi_slave &&
!(table->in_use->rgi_slave->gtid_ev_flags2 & Gtid_log_event::FL_DDL) &&
!(old_master=
rpl_master_has_bug(thd->rgi_slave->rli,