Detect dropped system tables
If a test breaks the system by dropping a system database, the replication check wouldn't detect it.
This commit is contained in:
@ -726,10 +726,21 @@ int Mariadb_nodes::check_replication()
|
|||||||
if ((res = get_versions()) != 0)
|
if ((res = get_versions()) != 0)
|
||||||
{
|
{
|
||||||
cout << "Failed to get versions" << endl;
|
cout << "Failed to get versions" << endl;
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < N && res == 0; i++)
|
for (int i = 0; i < N && res == 0; i++)
|
||||||
{
|
{
|
||||||
|
if (mysql_query(nodes[i], "SELECT COUNT(*) FROM mysql.user") == 0)
|
||||||
|
{
|
||||||
|
mysql_free_result(mysql_store_result(nodes[i]));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cout << mysql_error(nodes[i]) << endl;
|
||||||
|
res = 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (i == master)
|
if (i == master)
|
||||||
{
|
{
|
||||||
if (!check_master_node(nodes[i]))
|
if (!check_master_node(nodes[i]))
|
||||||
@ -782,8 +793,7 @@ bool Mariadb_nodes::fix_replication()
|
|||||||
if (check_replication() == 0)
|
if (check_replication() == 0)
|
||||||
{
|
{
|
||||||
cout << "Replication is fixed" << endl;
|
cout << "Replication is fixed" << endl;
|
||||||
flush_hosts();
|
rval = flush_hosts();
|
||||||
rval = true;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user