mirror of
https://github.com/MariaDB/server.git
synced 2025-12-09 08:01:34 +03:00
Problem - The default port number shown in SHOW SLAVE HOSTS is always 3306
though the slave is actually listening on a different port number.
This is a problem as the user can not be sure whether this port
value can be trusted and so client trying to read replication
topology can get confused.
Fix - 3306 ceases to be the default value of report-port. Moreover report-port
does not have a static default any longer.
Instead we initialize report-port to 0 as the new default value and change
it based on two checks :
1) If report_port is not set, the slave reports the port number its listening
on. (i.e. if report-port is not set we get the actual value of the slave's
port number).
2) If report-port is set, we show the value report-port is set to, as the slave's
port number.
16 lines
401 B
Plaintext
16 lines
401 B
Plaintext
include/master-slave.inc
|
|
[connection master]
|
|
RESET SLAVE;
|
|
CHANGE MASTER TO master_host='127.0.0.1',master_port=MASTER_PORT,master_user='root';
|
|
START SLAVE IO_THREAD;
|
|
include/wait_for_slave_io_to_start.inc
|
|
SHOW SLAVE HOSTS;
|
|
Server_id Host Port Master_id
|
|
3 slave2 SLAVE_PORT 1
|
|
2 SLAVE_PORT 1
|
|
include/stop_slave_io.inc
|
|
SHOW SLAVE HOSTS;
|
|
Server_id Host Port Master_id
|
|
2 SLAVE_PORT 1
|
|
include/rpl_end.inc
|