mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-4937: sql_slave_skip_counter does not work with GTID
As a side-effect of purge_relay_logs(), sql_slave_skip_counter was silently ignored in GTID mode. But sql_slave_skip_counter in fact is not a good match with GTID. And it is not really needed either, as users can explicitly set @@gtid_slave_pos to skip specific GTIDs, in a way that matches well how GTID replication works. So with this patch, we give an error on attempts to set sql_slave_skip_counter when using GTID, with a suggestion to use gtid_slave_pos instead, if needed.
This commit is contained in:
@@ -61,7 +61,13 @@ include/stop_slave.inc
|
||||
INSERT INTO t1 VALUES (5, "m1a");
|
||||
INSERT INTO t2 VALUES (5, "i1a");
|
||||
CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT,
|
||||
MASTER_USE_GTID=SLAVE_POS;
|
||||
SET GLOBAL sql_slave_skip_counter=1;
|
||||
ERROR HY000: When using GTID, @@sql_slave_skip_counter can not be used. Instead, setting @@gtid_slave_pos explicitly can be used to skip to after a given GTID position.
|
||||
CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT,
|
||||
MASTER_USE_GTID=CURRENT_POS;
|
||||
SET GLOBAL sql_slave_skip_counter=10;
|
||||
ERROR HY000: When using GTID, @@sql_slave_skip_counter can not be used. Instead, setting @@gtid_slave_pos explicitly can be used to skip to after a given GTID position.
|
||||
include/start_slave.inc
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
a b
|
||||
|
Reference in New Issue
Block a user