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:
Timofey Turenko
2019-05-22 15:39:25 +03:00
parent 17fa1ce616
commit 64935573b2
4 changed files with 58 additions and 24 deletions

View File

@ -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;