mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-28 20:02:00 +03:00
codership/wsrep-lib#23 before_command() wait for ongoing rollbacks leaks
Storing information that background rollbacker in ongoing in client state has_rollback_ This can be used for detecting if there is ongoing background rollback, and client should keep waiting in before_command() entry to avoid conflicts in accessing client state during background rollbacking. transaction::bf_abort() is modified to set has_rollback_ flag when backgroung rollbacking has been assigned for the client sync_rollback_complete() method has been modified to reset the backround rollbacker flag
This commit is contained in:
@ -43,5 +43,4 @@ namespace wsrep_test
|
||||
void bf_abort_provider(wsrep::mock_server_state& sc,
|
||||
const wsrep::transaction& tc,
|
||||
wsrep::seqno bf_seqno);
|
||||
|
||||
}
|
||||
|
@ -899,6 +899,7 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(
|
||||
BOOST_REQUIRE(cc.current_error() == wsrep::e_deadlock_error);
|
||||
BOOST_REQUIRE(tc.active() == true);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_aborted);
|
||||
cc.sync_rollback_complete();
|
||||
BOOST_REQUIRE(cc.before_command() == 1);
|
||||
BOOST_REQUIRE(tc.active() == false);
|
||||
BOOST_REQUIRE(cc.current_error() == wsrep::e_deadlock_error);
|
||||
@ -923,6 +924,7 @@ BOOST_FIXTURE_TEST_CASE(
|
||||
wsrep_test::bf_abort_unordered(cc);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_aborted);
|
||||
BOOST_REQUIRE(tc.active());
|
||||
cc.sync_rollback_complete();
|
||||
BOOST_REQUIRE(cc.before_command() == 1);
|
||||
BOOST_REQUIRE(tc.active() == false);
|
||||
BOOST_REQUIRE(cc.current_error() == wsrep::e_deadlock_error);
|
||||
|
Reference in New Issue
Block a user