Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/MariaDB/mysql-test/suite/rpl/t/   (MariaDB Server Version 8.1-8.4©)  Datei vom 1.9.2026 mit Größe 2 kB image not shown  

Quelle  rpl_mdev13831.test  Sprache: unbekannt

 
Spracherkennung für: .test vermutete Sprache: SQL {SQL[123] VDM[82] ABAP[72]} [Methode: maximale Elemente, drei Dimensionen]

--source include/have_debug.inc
--source include/have_innodb.inc
--source include/have_binlog_format_statement.inc
--source include/master-slave.inc

--echo *** MDEV-13831: Assertion on event group missing XID/COMMIT event

--connection slave
--source include/stop_slave.inc
# Use non-GTID mode. In GTID mode, the IO thread will fail if it sees an
# incomplete event group after MDEV-27697 patch.
CHANGE MASTER TO Master_use_gtid= No;
--source include/start_slave.inc

--connection master
# The dbug injection below is only active in legacy mode.
SET @old_legacy= @@GLOBAL.binlog_legacy_event_pos;
SET GLOBAL binlog_legacy_event_pos= 1;
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);

--connection master1
SET @old_dbug= @@SESSION.debug_dbug;
SET SESSION debug_dbug = '+d,fail_binlog_write_1';
--error ER_ERROR_ON_WRITE
UPDATE t1 SET a = 2;
SET debug_dbug= @old_dbug;
--error ER_BAD_TABLE_ERROR
DROP TEMPORARY TABLE t1;

--connection master
CREATE TEMPORARY TABLE t1 (i INT) ENGINE=InnoDB;

# Since MDEV-34135, the SQL thread no longer silently rolls back the
# incomplete event group left by the write error above; it stops with
# ER_BINLOG_LOGICAL_CORRUPTION instead, to avoid masking possible data loss.
# The original MDEV-13831 assertion/crash must still not happen.
--connection slave
--let $slave_sql_errno= 1866
--source include/wait_for_slave_sql_error.inc
--source include/stop_slave_io.inc

# Recover by repositioning past the incomplete group, as suggested for this
# scenario (no real relay log corruption, just a deliberately incomplete
# group from the injected write error).
--connection master
--let $master_file= query_get_value(SHOW MASTER STATUS, File, 1)
--let $master_pos= query_get_value(SHOW MASTER STATUS, Position, 1)

--connection slave
--replace_result $master_file MASTER_FILE $master_pos MASTER_POS
eval CHANGE MASTER TO MASTER_LOG_FILE='$master_file', MASTER_LOG_POS=$master_pos;
--source include/start_slave.inc
CALL mtr.add_suppression("The binary log file .* is logically corrupted: Incomplete event group found in relay log.*Error_code: 1866");

--connection master
SET GLOBAL binlog_legacy_event_pos= @old_legacy;
CALL mtr.add_suppression("Error writing file.*No space left on device");
DROP TEMPORARY TABLE t1;
DROP TABLE t1;

--sync_slave_with_master
--source include/rpl_end.inc

[Dauer der Verarbeitung: 0.14 Sekunden, vorverarbeitet 2026-10-10]