mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
BUG#11809016 - NO WAY TO DISCOVER AN INSTANCE IS NO LONGER A SLAVE FOLLOWING MYSQL BUG#28796
Before BUG#28796, an empty host was used to identify that an instance was no longer a slave. However, BUG#28796 changed this behavior and one cannot set an empty host. Besides, a RESET SLAVE only cleans up information on the next event to retrieve from the master, disables ssl and resets heartbeat period. So a call to SHOW SLAVE STATUS after issuing a RESET SLAVE still returns some valid information, such as host, port, user and password. To fix this problem, we have introduced the command RESET SLAVE ALL that does what a regular RESET SLAVE does and also clears host, port, user and password information thus allowing users to identify when an instance is no longer a slave.
This commit is contained in:
@ -31,6 +31,8 @@ int init_strvar_from_file(char *var, int max_size, IO_CACHE *f,
|
||||
int init_floatvar_from_file(float* var, IO_CACHE* f, float default_val);
|
||||
int init_dynarray_intvar_from_file(DYNAMIC_ARRAY* arr, IO_CACHE* f);
|
||||
|
||||
static void init_master_log_pos(Master_info* mi);
|
||||
|
||||
Master_info::Master_info(bool is_slave_recovery)
|
||||
:Slave_reporting_capability("I/O"),
|
||||
ssl(0), ssl_verify_server_cert(0), fd(-1), io_thd(0),
|
||||
@ -100,6 +102,16 @@ bool Master_info::shall_ignore_server_id(ulong s_id)
|
||||
!= NULL;
|
||||
}
|
||||
|
||||
void Master_info::clear_in_memory_info(bool all)
|
||||
{
|
||||
init_master_log_pos(this);
|
||||
if (all)
|
||||
{
|
||||
port= MYSQL_PORT;
|
||||
host[0] = 0; user[0] = 0; password[0] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void init_master_log_pos(Master_info* mi)
|
||||
{
|
||||
DBUG_ENTER("init_master_log_pos");
|
||||
@ -234,7 +246,7 @@ file '%s')", fname);
|
||||
}
|
||||
|
||||
mi->fd = fd;
|
||||
init_master_log_pos(mi);
|
||||
mi->clear_in_memory_info(false);
|
||||
|
||||
}
|
||||
else // file exists
|
||||
|
Reference in New Issue
Block a user