Add virtual functions check_replication() and start_replication() for Clustrix
Implementations of check_replication() and start_replication() for Clustrix allows to use fix_replication() also for Clustrix nodes without checking it. Also several attempts to check nodes after restart are added - to wait for nodes if they are not running right after server daemon restart
This commit is contained in:
@ -751,6 +751,7 @@ int Mariadb_nodes::check_replication()
|
||||
bool Mariadb_nodes::fix_replication()
|
||||
{
|
||||
bool rval = true;
|
||||
int attempts = 25;
|
||||
|
||||
if (check_replication())
|
||||
{
|
||||
@ -764,6 +765,12 @@ bool Mariadb_nodes::fix_replication()
|
||||
cout << "Starting replication" << endl;
|
||||
start_replication();
|
||||
|
||||
while (check_replication() && (attempts > 0))
|
||||
{
|
||||
cout << "Replication is still broken, waiting" << endl;
|
||||
sleep(10);
|
||||
attempts--;
|
||||
}
|
||||
if (check_replication() == 0)
|
||||
{
|
||||
cout << "Replication is fixed" << endl;
|
||||
|
||||
Reference in New Issue
Block a user