[MDEV-21687] When creating a table in the master database, and then executing stop slave, add index, start slave in the slave database; a replication error occurred from the slave ; but there was no exception in mysql Created: 2020-02-08  Updated: 2020-02-13  Resolved: 2020-02-13

Status: Closed
Project: MariaDB Server
Component/s: Replication
Affects Version/s: 10.3.22
Fix Version/s: N/A

Type: Bug Priority: Critical
Reporter: hongsheng zhou Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: replication
Environment:

OS:Ubuntu 5.4.0-6ubuntu1~16.04.9
master:10.3.8-MariaDB-1:10.3.8+maria~xenial-log
slave:10.3.22-MariaDB-1:10.3.22+maria~xenial-log


Issue Links:
Duplicate
duplicates MDEV-16834 GTID current_pos easily breaks replic... Closed
duplicates MDEV-17031 [GTID current pos]If the slave's pos ... Open

 Description   

When creating a table in the master database, and then executing stop slave, add index, start slave in the slave database; a replication error occurred from the slave ; but there was no exception in mysql

1、Executed master

CREATE TABLE `test_replication_temp` (
`id` int(11) ,
`name` varchar(150) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

insert into test_replication_temp(id,name)value(1,'hello');

2、Executed slave

select * from test_replication_temp;
stop slave;
alter table test_replication_temp add index idx_name(name);
start slave;
show slave status;

Slave_IO_State:
Master_Host: xxx.xx.xxx.xxx
Master_User: replication
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mariadb-bin.035179
Read_Master_Log_Pos: 69239370
Relay_Log_File: mysqld-relay-bin.000001
Relay_Log_Pos: 4
Relay_Master_Log_File: mariadb-bin.035179
Slave_IO_Running: No
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 69239370
Relay_Log_Space: 256
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 1236
Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'Error: connecting slave requested to start from GTID 0-xxxxx-2695522268, which is not in the master's binlog. Since the master's binlog contains GTIDs with higher sequence numbers, it probably means that the slave has diverged due to executing extra erroneous transactions'
Last_SQL_Errno: 0
Last_SQL_Error:
Replicate_Ignore_Server_Ids:
Master_Server_Id: xxxxxxx
Master_SSL_Crl:
Master_SSL_Crlpath:
Using_Gtid: Current_Pos
Gtid_IO_Pos: 0-xxxxx-2695522268
Replicate_Do_Domain_Ids:
Replicate_Ignore_Domain_Ids:
Parallel_Mode: conservative
SQL_Delay: 0
SQL_Remaining_Delay: NULL
Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave I/O thread to update it
Slave_DDL_Groups: 18
Slave_Non_Transactional_Groups: 0
Slave_Transactional_Groups: 84575


Generated at Thu Feb 08 09:09:02 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.