1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-24 10:42:31 +03:00

More graceful error handling in abort_or_interrupt()

If abort_or_interrupt() is called in aborting or aborted state,
investigate if the transaction was BF aborted. If yes, raise the
deadlock error if error has not been set yet and assert in debug build.
This commit is contained in:
Teemu Ollakka
2019-02-20 09:49:04 +02:00
parent d52f43c049
commit 9bec7d940c

View File

@ -1013,7 +1013,16 @@ bool wsrep::transaction::abort_or_interrupt(
}
else if (state() == s_aborting || state() == s_aborted)
{
assert(client_state_.current_error());
// Somehow we got there after BF abort without setting error
// status. This may happen if the DBMS side aborts the transaction
// but still tries to continue processing rows. Raise the error here
// and assert so that the error will be caught in debug builds.
if (bf_abort_client_state_ &&
client_state_.current_error() == wsrep::e_success)
{
client_state_.override_error(wsrep::e_deadlock_error);
assert(0);
}
return true;
}
else if (client_service_.interrupted(lock))