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#20471216: 5.6 WITH GTID_MODE=X CANT CONNECT TO 5.7.6 WITH GTID_MODE=X_PERMISSIVE
This is the 5.7 version of this patch. Tests needed to be rewritten
and source code is a little bit different, so null-merged from 5.6 and
created a new changeset (this one) for 5.7.
Background:
In 5.6, GTID_MODE can only take two values: ON and OFF. In 5.7,
GTID_MODE can take four values: ON, ON_PERMISSIVE, OFF_PERMISSIVE, and
OFF. A 5.7 master should be able to replicate to a 5.6 slave if master
uses X_PERMISSIVE and slave uses X.
Problem:
Due to a sanity check on the slave where the slave explicitly checks
the master's GTID_MODE, the slave refuses to start replication.
The 5.6 server was actually prepared to handle the new modes
introduced by 5.7, but in the end the names of the modes were changed:
5.6 allows a master to have modes UPGRADE_STEP_1 and UPGRADE_STEP_2
but not ON_PERMISSIVE or OFF_PERMISSIVE.
Fix:
- Allow slave to replicate if the master's GTID_MODE *begins* with ON
or OFF. The slave in this case will ignore the remainder of the
GTID_MODE string and treat master as being ON or OFF.
- Report a warning if the master's GTID_MODE begins with ON or OFF but
is not equal to ON or OFF.
@sql/rpl_slave.cc
- Allow master's GTID_MODE to be any string that begins with ON or
OFF.
- Report a warning if the master's GTID_MODE begins with ON or OFF but
is not equal to ON or OFF.
@mysql-test/include/assert_grep.inc
- Improve debug info.
@mysql-test/suite/rpl/t/rpl_gtid_mode.test
- In 5.7, this is a more appropriate place for the test. Also, the
test is rewritten to avoid server restarts since restarts are not
needed in 5.7. Also removed the .opt file for the test.
Copy file name to clipboardExpand all lines: mysql-test/suite/rpl/r/rpl_gtid_mode.result
+31-2
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,19 @@ Note #### Storing MySQL user name or password information in the master info rep
6
6
==== Initialize ====
7
7
call mtr.add_suppression("Slave I/O for channel '': The replication receiver thread cannot start");
8
8
call mtr.add_suppression("Slave I/O for channel '': The slave IO thread stops");
9
+
call mtr.add_suppression("Slave I/O for channel '': Got fatal error 1236 from master when reading data from binary log: 'Cannot replicate GTID-transaction when @@GLOBAL.GTID_MODE = OFF");
10
+
call mtr.add_suppression("Slave I/O for channel '': Cannot replicate GTID-transaction when @@GLOBAL.GTID_MODE = OFF");
11
+
call mtr.add_suppression("GTID_LOG_EVENT or ANONYMOUS_GTID_LOG_EVENT is not expected in an event stream after a GTID_LOG_EVENT or an ANONYMOUS_GTID_LOG_EVENT.");
12
+
call mtr.add_suppression("An unexpected event sequence was detected by the IO thread while queuing the event received from master");
13
+
call mtr.add_suppression("Detected misconfiguration: replication channel '' was configured with AUTO_POSITION = 1, but the server was started with --gtid-mode=off.");
14
+
call mtr.add_suppression("Slave I/O for channel '': Relay log write failure: could not queue event from master");
15
+
call mtr.add_suppression("Got fatal error 1236 from master when reading data from binary log: 'Cannot replicate anonymous transaction when @@GLOBAL.GTID_MODE = ON");
16
+
call mtr.add_suppression("Slave I/O for channel '': Cannot replicate anonymous transaction when @@GLOBAL.GTID_MODE = ON");
17
+
call mtr.add_suppression("Slave I/O for channel '': Cannot replicate anonymous transaction when AUTO_POSITION = 1");
18
+
call mtr.add_suppression("Got fatal error 1236 from master when reading data from binary log: 'Cannot replicate anonymous transaction when AUTO_POSITION = 1,");
19
+
call mtr.add_suppression("Slave I/O for channel '': The master uses an unknown GTID_MODE 'on_something'. Treating it as 'ON'.");
20
+
call mtr.add_suppression("Slave I/O for channel '': The master uses an unknown GTID_MODE 'off_something'. Treating it as 'OFF'.");
21
+
call mtr.add_suppression("Could not open .* for logging.*. Turning logging off for the whole duration of the MySQL server process.");
9
22
include/sync_slave_sql_with_master.inc
10
23
include/stop_slave.inc
11
24
==== Checks performed at server start ====
@@ -160,6 +173,7 @@ include/rpl_set_gtid_mode.inc [OFF on servers 1,2]
include/assert.inc [sender thread should report - Cannot replicate anonymous transaction when AUTO_POSITION = 1.]
279
+
include/assert_grep.inc [While AUTO_POSITION is enabled, Master sends an anonymous transaction resulting into ER_CANT_REPLICATE_ANONYMOUS_WITH_AUTO_POSITION.]
Copy file name to clipboardExpand all lines: mysql-test/suite/rpl/t/rpl_gtid_mode.test
+73-13
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,20 @@
48
48
49
49
call mtr.add_suppression("Slave I/O for channel '': The replication receiver thread cannot start");
50
50
call mtr.add_suppression("Slave I/O for channel '': The slave IO thread stops");
51
+
call mtr.add_suppression("Slave I/O for channel '': Got fatal error 1236 from master when reading data from binary log: 'Cannot replicate GTID-transaction when @@GLOBAL.GTID_MODE = OFF");
52
+
call mtr.add_suppression("Slave I/O for channel '': Cannot replicate GTID-transaction when @@GLOBAL.GTID_MODE = OFF");
53
+
call mtr.add_suppression("GTID_LOG_EVENT or ANONYMOUS_GTID_LOG_EVENT is not expected in an event stream after a GTID_LOG_EVENT or an ANONYMOUS_GTID_LOG_EVENT.");
54
+
call mtr.add_suppression("An unexpected event sequence was detected by the IO thread while queuing the event received from master");
55
+
call mtr.add_suppression("Detected misconfiguration: replication channel '' was configured with AUTO_POSITION = 1, but the server was started with --gtid-mode=off.");
56
+
call mtr.add_suppression("Slave I/O for channel '': Relay log write failure: could not queue event from master");
57
+
call mtr.add_suppression("Got fatal error 1236 from master when reading data from binary log: 'Cannot replicate anonymous transaction when @@GLOBAL.GTID_MODE = ON");
58
+
call mtr.add_suppression("Slave I/O for channel '': Cannot replicate anonymous transaction when @@GLOBAL.GTID_MODE = ON");
59
+
call mtr.add_suppression("Slave I/O for channel '': Cannot replicate anonymous transaction when AUTO_POSITION = 1");
60
+
call mtr.add_suppression("Got fatal error 1236 from master when reading data from binary log: 'Cannot replicate anonymous transaction when AUTO_POSITION = 1,");
61
+
call mtr.add_suppression("Slave I/O for channel '': The master uses an unknown GTID_MODE 'on_something'. Treating it as 'ON'.");
62
+
call mtr.add_suppression("Slave I/O for channel '': The master uses an unknown GTID_MODE 'off_something'. Treating it as 'OFF'.");
63
+
call mtr.add_suppression("Could not open .* for logging.*. Turning logging off for the whole duration of the MySQL server process.");
--let $assert_cond= COUNT(*) = 1 FROM performance_schema.replication_connection_status WHERE LAST_ERROR_MESSAGE LIKE "%Cannot replicate GTID-transaction when @@GLOBAL.GTID_MODE = OFF%";
226
240
--source include/assert.inc
227
241
242
+
--let $assert_text= Receiver thread should report - Cannot replicate GTID-transaction when @@GLOBAL.GTID_MODE = OFF.
--let $assert_select= Cannot replicate GTID-transaction when @@GLOBAL.GTID_MODE = OFF
267
-
--let $assert_count= 3
288
+
--let $assert_only_after= Slave I/O thread for channel '': connected to master
289
+
--let $assert_count= 1
268
290
--source include/assert_grep.inc
269
291
270
292
--source include/rpl_connection_master.inc
@@ -298,7 +320,7 @@ CHANGE MASTER TO MASTER_AUTO_POSITION= 1;
298
320
SET GLOBAL ENFORCE_GTID_CONSISTENCY = ON;
299
321
300
322
--let $assert_text= While AUTO_POSITION is set, attempt to restart the slave with gtid-mode= off to get ER_STARTING_WITH_GTID_MODE_OFF_AND_AUTO_POSITION.
--let $assert_select= Detected misconfiguration: replication channel '' was configured with AUTO_POSITION = 1, but the server was started with --gtid-mode=off
303
325
--let $assert_count= 1
304
326
--source include/assert_grep.inc
@@ -345,6 +367,13 @@ START SLAVE IO_THREAD;
345
367
--let $assert_cond= COUNT(*) = 1 FROM performance_schema.replication_connection_status WHERE LAST_ERROR_MESSAGE LIKE "%Cannot replicate anonymous transaction when @@GLOBAL.GTID_MODE = ON%";
346
368
--source include/assert.inc
347
369
370
+
--let $assert_text= While gtid-mode=on, slave expects an anonymous event to get ER_CANT_REPLICATE_ANONYMOUS_WITH_GTID_MODE_ON.
--let $assert_select= Cannot replicate anonymous transaction when @@GLOBAL.GTID_MODE = ON
372
-
--let $assert_count= 3
401
+
--let $assert_only_after= Slave I/O thread for channel '': connected to master
402
+
--let $assert_count= 1
373
403
--source include/assert_grep.inc
374
404
375
405
--source include/stop_slave_sql.inc
@@ -443,6 +473,12 @@ START SLAVE IO_THREAD;
443
473
--let $assert_cond= COUNT(*) = 1 FROM performance_schema.replication_connection_status WHERE LAST_ERROR_MESSAGE LIKE "%Cannot replicate anonymous transaction when AUTO_POSITION = 1%";
444
474
--source include/assert.inc
445
475
476
+
--let $assert_text= While AUTO_POSITION is enabled, Master sends an anonymous transaction resulting into ER_CANT_REPLICATE_ANONYMOUS_WITH_AUTO_POSITION.
--let $assert_select= Cannot replicate anonymous transaction when AUTO_POSITION = 1
479
+
--let $assert_count= 1
480
+
--source include/assert_grep.inc
481
+
446
482
--let $rpl_server_number=1
447
483
--let $rpl_start_with_gtids= 0
448
484
--source include/rpl_restart_server.inc
@@ -523,9 +559,9 @@ START SLAVE IO_THREAD;
523
559
--source include/wait_for_slave_io_error.inc
524
560
525
561
--let $assert_text= While AUTO_POSITION is enabled, Master sends an anonymous transaction resulting into ER_CANT_REPLICATE_ANONYMOUS_WITH_AUTO_POSITION.
0 commit comments