MXS-3487: Close old master connection

When a transaction migration starts, the old master must be
unconditionally closed. This is the simplest way of resetting the
connection state and it also helps close unused connections.
This commit is contained in:
Markus Mäkelä 2021-04-09 08:49:40 +03:00
parent 7643dd1445
commit 38cdade698
No known key found for this signature in database
GPG Key ID: 5CE746D557ACC499

View File

@ -359,6 +359,12 @@ bool RWSplitSession::route_single_stmt(GWBUF* querybuf)
if (!succp && should_migrate_trx(target))
{
if (m_current_master && m_current_master->in_use())
{
m_current_master->close();
m_current_master->set_close_reason("The original master is not available");
}
return start_trx_migration(target, querybuf);
}
}