Skip to content

Commit

Permalink
Fixes according to review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sjaakola committed Apr 13, 2023
1 parent 1cf5ca7 commit e20e53f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions include/wsrep/server_service.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ namespace wsrep

/**
* Perform a background rollback for a transaction.
* @return true if rollbacker was not started, false otherwise
*/
virtual bool background_rollback(wsrep::client_state&) = 0;

Expand Down
13 changes: 11 additions & 2 deletions src/transaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1076,8 +1076,17 @@ bool wsrep::transaction::bf_abort(
lock.unlock();
/* if background rollback is skipped, reset rollbacker activity */
if (server_service_.background_rollback(client_state_))
client_state_.set_rollbacker_active(false);
lock.lock();
{
lock.lock();
client_state_.set_rollbacker_active(false);

/* release the victim from waiting, if it has advanced to
wait_rollback_complete_and_acquire_ownership stage */
if (client_state_.state() == wsrep::client_state::s_idle)
client_state_.cond_.notify_all();
}
else
lock.lock();
}
}
return ret;
Expand Down

0 comments on commit e20e53f

Please sign in to comment.