1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-30 07:23:07 +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:
sjaakola
2018-11-24 15:14:26 +02:00
parent 31f09ca4aa
commit cfcf34e70f
5 changed files with 29 additions and 3 deletions

View File

@ -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);