1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-11-01 17:51:06 +03:00

SR Rollback handling fixes

* Handle BF rollback also in after_statement() call.
* Added missing after_apply() call when handling rollback fragment.
* Fixed state changes when rollback is starated during preparing state.
This commit is contained in:
Teemu Ollakka
2018-07-11 11:39:55 +03:00
parent d03736c4c3
commit 3b9e9e0d0c
3 changed files with 22 additions and 7 deletions

View File

@@ -192,15 +192,22 @@ int wsrep::client_state::before_statement()
int wsrep::client_state::after_statement()
{
// wsrep::unique_lock<wsrep::mutex> lock(mutex_);
wsrep::unique_lock<wsrep::mutex> lock(mutex_);
debug_log_state("after_statement: enter");
assert(state() == s_exec);
assert(mode() == m_local);
#if 0
/**
* @todo Check for replay state, do rollback if requested.
*/
#endif // 0
if (transaction_.active() &&
transaction_.state() == wsrep::transaction::s_must_abort)
{
lock.unlock();
client_service_.bf_rollback();
lock.lock();
assert(transaction_.state() == wsrep::transaction::s_aborted);
override_error(wsrep::e_deadlock_error);
}
lock.unlock();
(void)transaction_.after_statement();
if (current_error() == wsrep::e_deadlock_error)
{
@@ -368,8 +375,10 @@ int wsrep::client_state::end_rsu()
return ret;
}
///////////////////////////////////////////////////////////////////////////////
// TOI //
// Misc //
///////////////////////////////////////////////////////////////////////////////
int wsrep::client_state::sync_wait(int timeout)