Replace debug assertion with warning

It appears that rollback errors are possible outside of
transactions. Since this was not something we expected to see, logging it
as an error allows us to see why this happens in production deployments.
This commit is contained in:
Markus Mäkelä
2019-12-13 21:12:41 +02:00
parent a2eafc2381
commit 78cc8f17b3

View File

@ -618,7 +618,14 @@ bool RWSplitSession::handle_ignorable_error(RWBackend* backend)
}
else
{
mxb_assert(backend->error().is_wsrep_error());
static bool warn_unexpected_rollback = true;
if (!backend->error().is_wsrep_error() && warn_unexpected_rollback)
{
MXS_WARNING("Expected a WSREP error but got a transaction rollback error: %d, %s",
backend->error().code(), backend->error().message().c_str());
warn_unexpected_rollback = false;
}
if (backend == m_current_master)
{