Merge branch '2.3' into develop

This commit is contained in:
Markus Mäkelä
2019-06-14 09:38:07 +03:00
2 changed files with 21 additions and 15 deletions

View File

@ -60,14 +60,14 @@ int main(int argc, char** argv)
print_gtids(test); print_gtids(test);
cout << "Bringing old master back online..." << endl; cout << "Bringing old master back online..." << endl;
test.repl->start_node(master_index, (char*) ""); test.repl->start_node(master_index, (char*) "");
test.maxscales->wait_for_monitor(); test.maxscales->wait_for_monitor(2);
test.repl->connect();
get_output(test); get_output(test);
test.tprintf("and manually rejoining it to cluster."); test.tprintf("and manually rejoining it to cluster.");
const char REJOIN_CMD[] = "maxadmin call command mariadbmon rejoin MySQL-Monitor server1"; const char REJOIN_CMD[] = "maxadmin call command mariadbmon rejoin MySQL-Monitor server1";
test.maxscales->ssh_node_output(0, REJOIN_CMD, true, &ec); test.maxscales->ssh_node_output(0, REJOIN_CMD, true, &ec);
test.maxscales->wait_for_monitor(); test.maxscales->wait_for_monitor(2);
get_output(test); get_output(test);
test.repl->connect();
string gtid_old_master; string gtid_old_master;
test.repl->connect(); test.repl->connect();
@ -88,10 +88,9 @@ int main(int argc, char** argv)
"Old master did not successfully rejoin the cluster (%s != %s).", "Old master did not successfully rejoin the cluster (%s != %s).",
gtid_final.c_str(), gtid_old_master.c_str()); gtid_final.c_str(), gtid_old_master.c_str());
// Switch master back to server1 so last check is faster // Switch master back to server1 so last check is faster
int ec; test.maxscales->ssh_node_output(0,
test.maxscales->ssh_node_output(0, "maxadmin call command mysqlmon switchover " "maxadmin call command mysqlmon switchover MySQL-Monitor server1 server2", true, &ec);
"MySQL-Monitor server1 server2", true, &ec); test.maxscales->wait_for_monitor(2);
test.maxscales->wait_for_monitor();
get_output(test); get_output(test);
master_id = get_master_server_id(test); master_id = get_master_server_id(test);
test.expect(master_id == old_master_id, "Switchover back to server1 failed."); test.expect(master_id == old_master_id, "Switchover back to server1 failed.");
@ -115,10 +114,11 @@ int main(int argc, char** argv)
test.expect(row.empty() || row[0].empty(), test.expect(row.empty() || row[0].empty(),
"server3 gtid is not empty as it should (%s).", row[0].c_str()); "server3 gtid is not empty as it should (%s).", row[0].c_str());
cout << "Rejoining server3.\n"; cout << "Rejoining server3.\n";
test.maxscales->ssh_node_output(0, "maxadmin call command mysqlmon rejoin " test.maxscales->ssh_node_output(0,
"MySQL-Monitor server3", true, &ec); "maxadmin call command mysqlmon rejoin MySQL-Monitor server3", true, &ec);
test.maxscales->wait_for_monitor(); test.maxscales->wait_for_monitor(2);
get_output(test); get_output(test);
test.repl->connect();
char result[100]; char result[100];
test.repl->connect(); test.repl->connect();
if (find_field(conn, sstatus_query.c_str(), "Master_Host", result) == 0) if (find_field(conn, sstatus_query.c_str(), "Master_Host", result) == 0)

View File

@ -325,9 +325,16 @@ void RWBackend::process_packets(GWBUF* result)
break; break;
case REPLY_STATE_DONE: case REPLY_STATE_DONE:
if (cmd == MYSQL_REPLY_ERR)
{
update_error(++it, end);
}
else
{
// This should never happen // This should never happen
MXS_ERROR("Unexpected result state. cmd: 0x%02hhx, len: %u", cmd, len); MXS_ERROR("Unexpected result state. cmd: 0x%02hhx, len: %u", cmd, len);
mxb_assert(!true); mxb_assert(!true);
}
break; break;
case REPLY_STATE_RSET_COLDEF: case REPLY_STATE_RSET_COLDEF:
@ -468,5 +475,4 @@ void RWBackend::update_error(Iter it, Iter end)
m_error.set(code, sql_state_begin, sql_state_end, message_begin, message_end); m_error.set(code, sql_state_begin, sql_state_end, message_begin, message_end);
} }
} }