Details
-
Bug
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
10.11
-
None
-
Unexpected results
Description
To Reproduce
|
.opt |
--init-rpl-role=SLAVE
|
--source include/have_log_bin.inc
|
|
|
--connect (master1, 127.0.0.1, root, , , $SERVER_MYPORT_1)
|
--connect (master2, 127.0.0.1, root, , , $SERVER_MYPORT_2)
|
--connect ( slave, 127.0.0.1, root, , , $SERVER_MYPORT_3)
|
|
|
|
|
--replace_result $SERVER_MYPORT_1 MYPORT_1
|
evalp CHANGE MASTER 'master1' TO
|
master_host='127.0.0.1', master_port=$SERVER_MYPORT_1,
|
master_user='root';
|
evalp CHANGE MASTER 'master2' TO
|
master_host='127.0.0.1', master_port=$SERVER_MYPORT_2,
|
master_user='root';
|
|
|
SELECT variable_value
|
FROM information_schema.global_status
|
WHERE variable_name='RPL_STATUS';
|
#=> IDLE_SLAVE
|
|
|
|
|
SET @@SESSION.default_master_connection = 'master1';
|
--source include/start_slave.inc
|
SELECT variable_value
|
FROM information_schema.global_status
|
WHERE variable_name='RPL_STATUS';
|
#=> ACTIVE_SLAVE
|
|
|
SET @@SESSION.default_master_connection = 'master2';
|
--source include/start_slave.inc
|
SELECT variable_value
|
FROM information_schema.global_status
|
WHERE variable_name='RPL_STATUS';
|
#=> ACTIVE_SLAVE
|
|
|
|
|
--source include/stop_slave.inc
|
SELECT variable_value
|
FROM information_schema.global_status
|
WHERE variable_name='RPL_STATUS';
|
SET @@SESSION.default_master_connection = 'master1';
|
#=> IDLE_SLAVE
|
|
|
--source include/stop_slave.inc
|
SELECT variable_value
|
FROM information_schema.global_status
|
WHERE variable_name='RPL_STATUS';
|
#=> IDLE_SLAVE
|
|
|
|
|
# Cleanup
|
--source include/reset_master_slave.inc
|
|
|
--disconnect master1
|
--disconnect master2
|
--disconnect slave
|
Solution suggestions
- Restrict the updates to Rpl_status, change_rpl_status() to the blank-name connection only.
This requires the fewest changes, but loses multi-source replication support for Rpl_status. - Move the code behind Rpl_status, rpl_status, to per-connection data (similar to what the code comment suggests) and have the status variable redirect according to @@default_master_connection:
TODO: make rpl_status part of Master_info
This matches how system variables were migrated to multi-source replication, but requires some work.
- Keep Rpl_status a global view of all connections, after defining which states are "any" and which require "all".
This concept first needs discussion. - Deprecate Rpl_status altogether in favour of SHOW SLAVE STATUS (or information_schema.slave_status as of 11.6 (
MDEV-33526)).
MySQL has already removed this in version 5.6.
Attachments
Issue Links
- is part of
-
MDEV-37212 What's up with sql/repl_failsafe.cc?
-
- Stalled
-