Relay log waiting is part of failover_prepare
Since the servers are not modified before or during the wait, the waiting can be done in the preparation method. This simplifies the actual failover somewhat, and allows the monitor to keep running normally while waiting for the log to clear.
This commit is contained in:
@ -176,13 +176,12 @@ public:
|
||||
void check_permissions();
|
||||
|
||||
/**
|
||||
* Calculate how many events are left in the relay log of the slave connection to 'master'.
|
||||
* Calculate how many events are left in the relay log of the slave connection.
|
||||
*
|
||||
* @param master The master server from which the slave connection is replicating from
|
||||
* @return Number of events in relay log according to latest queried info. Negative on error,
|
||||
* e.g. the slave connection didn't exist.
|
||||
* @param slave_conn The slave connection to calculate for
|
||||
* @return Number of events in relay log. Always 0 or greater.
|
||||
*/
|
||||
int64_t relay_log_events(const MariaDBServer* master);
|
||||
uint64_t relay_log_events(const SlaveStatus& slave_conn);
|
||||
|
||||
/**
|
||||
* Execute a query which returns data. The results are returned as a unique pointer to a QueryResult
|
||||
@ -398,17 +397,6 @@ public:
|
||||
*/
|
||||
bool join_cluster(const std::string& change_cmd);
|
||||
|
||||
/**
|
||||
* Waits until this server has processed all its relay log, or time is up.
|
||||
*
|
||||
* @param master The master (or relay) whose relay log should be waited on
|
||||
* @param seconds_remaining Maximum wait time
|
||||
* @param err_out Error output
|
||||
* @return True if relay log was processed within time limit, or false if time ran out
|
||||
* or an error occurred.
|
||||
*/
|
||||
bool failover_wait_relay_log(const MariaDBServer* master, int seconds_remaining, json_t** err_out);
|
||||
|
||||
/**
|
||||
* Check if the server can be demoted by switchover.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user