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

Fixed BF abort in sync rollback mode.

* Pass condition variable for client_state
* Notify all cond waiters when changing the transcation status to
  aborted
* Wait for aborting transaction state aborted in before_command
This commit is contained in:
Teemu Ollakka
2018-07-02 10:09:48 +03:00
parent db18e91c42
commit 658a84a7d4
7 changed files with 25 additions and 21 deletions

View File

@ -65,15 +65,12 @@ int wsrep::client_state::before_command()
wsrep::unique_lock<wsrep::mutex> lock(mutex_);
debug_log_state("before_command: enter");
assert(state_ == s_idle);
if (server_state_.rollback_mode() == wsrep::server_state::rm_sync)
if (transaction_.active() &&
server_state_.rollback_mode() == wsrep::server_state::rm_sync)
{
/**
* @todo Wait until the possible synchronous rollback
* has been finished.
*/
while (transaction_.state() == wsrep::transaction::s_aborting)
{
// cond_.wait(lock);
cond_.wait(lock);
}
}
state(lock, s_exec);

View File

@ -452,6 +452,7 @@ int wsrep::transaction::after_rollback()
if (state() == s_aborting)
{
state(lock, s_aborted);
client_state_.cond_.notify_all();
}
// Releasing the transaction from provider is postponed into
@ -820,9 +821,8 @@ int wsrep::transaction::certify_commit(
if (client_service_.prepare_data_for_replication())
{
// Note: Error must be set by prepare_data_for_replication()
lock.lock();
client_state_.override_error(wsrep::e_error_during_commit);
client_state_.override_error(wsrep::e_size_exceeded_error);
state(lock, s_must_abort);
return 1;
}