mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-30 07:23:07 +03:00
codership/wsrep-lib#90 Fixed assertion in before_commit()
Added unit test which makes assertion to fail if the fix is not present.
This commit is contained in:
@ -1056,6 +1056,27 @@ BOOST_FIXTURE_TEST_CASE(
|
||||
BOOST_REQUIRE(sc.provider().commit_fragments() == 1);
|
||||
}
|
||||
|
||||
//
|
||||
// Fragments are removed in before_prepare in running transaction context.
|
||||
// In 1pc the before_prepare() is called from before_commit().
|
||||
// However, the BF abort may arrive during this removal and the
|
||||
// client_service::remove_fragments() may roll back the transaction
|
||||
// internally. This will cause the transaction to leave before_prepare()
|
||||
// in aborted state.
|
||||
//
|
||||
BOOST_FIXTURE_TEST_CASE(transaction_streaming_1pc_bf_abort_during_fragment_removal,
|
||||
streaming_client_fixture_row)
|
||||
{
|
||||
BOOST_REQUIRE(cc.start_transaction(wsrep::transaction_id(1)) == 0);
|
||||
BOOST_REQUIRE(cc.after_row() == 0);
|
||||
BOOST_REQUIRE(tc.streaming_context().fragments_certified() == 1);
|
||||
cc.bf_abort_during_fragment_removal_ = true;
|
||||
BOOST_REQUIRE(cc.before_commit());
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_aborted);
|
||||
BOOST_REQUIRE(cc.after_statement());
|
||||
BOOST_REQUIRE(tc.active() == false);
|
||||
}
|
||||
|
||||
//
|
||||
// Test streaming rollback
|
||||
//
|
||||
|
Reference in New Issue
Block a user