mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-28 20:02:00 +03:00
Do not abort prepared transaction when statement is interrupted
In `transaction::abort_or_interrupt()` handle the case were a statement is interrupted while transaction is in prepared state. In which case, the transaction must remain in prepared state, until it is committed (or rolled back). Also in this patch: remove check for reduntant `s_must_abort` state.
This commit is contained in:
@ -1400,10 +1400,19 @@ bool wsrep::transaction::abort_or_interrupt(
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else if (client_service_.interrupted(lock))
|
||||
|
||||
if (client_service_.interrupted(lock))
|
||||
{
|
||||
assert(state() != s_must_abort &&
|
||||
state() != s_aborting &&
|
||||
state() != s_aborted);
|
||||
|
||||
// Client was interrupted. Set the appropriate error and abort.
|
||||
// For transactions in prepared state, it is OK to interrupt the
|
||||
// statement, but transaction must remain in prepared state until
|
||||
// commit or rollback.
|
||||
client_state_.override_error(wsrep::e_interrupted_error);
|
||||
if (state() != s_must_abort)
|
||||
if (state() != s_prepared)
|
||||
{
|
||||
state(lock, s_must_abort);
|
||||
}
|
||||
|
Reference in New Issue
Block a user