You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug #18789758 DATA INCONSISTENCIES WHEN MASTER HAS TRUNCATED
BINARY LOG WITH GTID AFTER CRASH
Problem:
Master's dump thread is not detecting the case where Slave's
gtid executed set is having more gtids than Master's gtid
executed set with respective to Master's UUID.
Analysis & Fix:
In normal scenarios, it is not possible that Slave will
contain more gtids than Master with respective to Master's UUID.
But it could be possible case if Master's binary log is
truncated(due to raid failure) or Master's binary log is
deleted but GTID_PURGED was not set properly. That scenario
needs to be validated, i.e., it should *always* be the case that
Slave's gtid executed set (+retrieved set) is a subset of
Master's gtid executed set with respective to Master's UUID.
If it happens, Master's dump thread will be stopped and this
situation will be informed to Slave during the handshake (thus.
slave I/O thread also be stopped with an error
(ER_MASTER_FATAL_ERROR_READING_BINLOG). Otherwise, it can lead
to data inconsistency between Master and Slave.
Copy file name to clipboardExpand all lines: mysql-test/suite/rpl/r/rpl_gtid_validate_slave_gtids.result
+13-2Lines changed: 13 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -3,15 +3,26 @@ Warnings:
3
3
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
4
4
Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
5
5
[connection master]
6
-
SET GLOBAL GTID_PURGED ="master_uuid:1-2";
6
+
SET GLOBAL GTID_PURGED= "master_uuid:1-2";
7
7
CREATE TABLE t1(i INT);
8
8
DROP TABLE t1;
9
9
START SLAVE IO_THREAD;
10
10
include/wait_for_slave_io_error.inc [errno=1236]
11
11
Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requires.''
12
-
SET GLOBAL GTID_PURGED ="master_uuid:1-2";
12
+
SET GLOBAL GTID_PURGED= "master_uuid:1-2";
13
13
include/start_slave.inc
14
14
include/sync_slave_sql_with_master.inc
15
15
include/assert.inc [Slave should be able to get GTID-3 and 4 now.]
16
16
call mtr.add_suppression(".*Master has purged binary logs containing GTIDs that the slave requires.*");
17
+
include/rpl_reset.inc
18
+
CREATE TABLE t1(i INT);
19
+
DROP TABLE t1;
20
+
include/stop_slave.inc
21
+
include/rpl_restart_server.inc [server_number=1]
22
+
START SLAVE IO_THREAD;
23
+
include/wait_for_slave_io_error.inc [errno=1236]
24
+
Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'Slave has more GTIDs than the master has, using the master's SERVER_UUID. This may indicate that the end of the binary log was truncated or that the last binary log file was lost, e.g., after a power or disk failure when sync_binlog != 1. The master may or may not have rolled back transactions that were already replica''
25
+
call mtr.add_suppression(".*Slave has more GTIDs than the master has.*");
0 commit comments