MXS-2223 Log a message when a slave is discriminated due to replication lag

Both the replication lag and the message printing state are saved in SERVER,
although the values are mostly used by readwritesplit. A log message is printed
both when a server goes over the limit and when it comes back below.
Because of concurrency issues, a message may be printed multiple times before
different threads detect the new message state.

Documentation updated to explain the change.
This commit is contained in:
Esa Korhonen
2019-01-16 14:58:08 +02:00
parent 0dfdff1f95
commit 7f978f275f
4 changed files with 72 additions and 16 deletions

View File

@ -183,6 +183,7 @@ SERVER* server_alloc(const char* name, MXS_CONFIG_PARAMETER* params)
server->master_id = -1;
server->master_err_is_logged = false;
server->warn_ssl_not_enabled = true;
server->rlag_state = RLAG_NONE;
server->disk_space_threshold = NULL;
if (*monuser && *monpw)