1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-28 20:02:00 +03:00

MDEV-26266 Fix error handling around remove_fragments()

Handle the case where client_service::remove_fragments() fails,
for reasons other than bf abort. In this case, we want to make
sure that the transaction state is moved to s_must_abort, so
that we satisfy the sanity check at the end of before_prepare():

```
   assert(state() == s_preparing ||
          (is_xa() && state() == s_replaying) ||
          (ret && (state() == s_must_abort ||
                   state() == s_must_replay ||
                   state() == s_cert_failed ||
                   state() == s_aborted)));
```
This commit is contained in:
Daniele Sciascia
2024-10-09 17:31:02 +02:00
parent 31db847676
commit 1c61b809d1
3 changed files with 59 additions and 2 deletions

View File

@ -312,6 +312,12 @@ int wsrep::transaction::before_prepare(
ret = client_service_.remove_fragments();
if (ret)
{
lock.lock();
if (state() == s_executing)
{
state(lock, s_must_abort);
}
lock.unlock();
client_state_.override_error(wsrep::e_deadlock_error);
}
}