MXS-1703 Move more methods to MariaDBServer

These methods only modify or update a single server.
This commit is contained in:
Esa Korhonen
2018-04-16 17:41:37 +03:00
parent 50bc43e4bf
commit 02c57c98e4
5 changed files with 216 additions and 223 deletions

View File

@ -212,6 +212,58 @@ public:
* @return Diagnostics string
*/
std::string diagnostics(bool multimaster) const;
/**
* Check if server is using gtid replication.
*
* @param error_out Error output
* @return True if using gtid-replication. False if not, or if server is not a slave or otherwise does
* not have a gtid_IO_Pos.
*/
bool uses_gtid(json_t** error_out);
/**
* Update replication settings, gtid:s and slave status of the server.
*
* @param server Slave to update
* @return True on success. False on error, or if server is not a slave (slave SQL not running).
*/
bool update_slave_info();
/**
* Checks if this server can replicate from master. Only considers gtid:s and only detects obvious errors.
* The non-detected errors will mostly be detected once the slave tries to start replicating.
*
* @param master_info Master server
* @return True if slave can replicate from master
*/
bool can_replicate_from(MariaDBServer* master);
/**
* Redirect one slave server to another master
*
* @param change_cmd Change master command, usually generated by generate_change_master_cmd()
* @return True if slave accepted all commands
*/
bool redirect_one_slave(const std::string& change_cmd);
/**
* Joins this standalone server to the cluster.
*
* @param change_cmd Change master command
* @return True if commands were accepted by server
*/
bool join_cluster(const std::string& change_cmd);
/**
* Waits until this server has processed all its relay log, or time is up.
*
* @param seconds_remaining How much time left
* @param err_out Json 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(int seconds_remaining, json_t** err_out);
};
/**