mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-30 07:23:07 +03:00
Fixed streaming transaction BF abort
The streaming_rollback() was not called from transaction::bf_abort() if a streaming transaction was BF aborted in executing state. This was because the condition to enter streaming_rollback() checked if the transaction state is executing. However, the transaction state had already been changed to must_abort before. As a fix, save the state to local variable when entering bf_abort() and check against saved state in condition to enter streaming_rollback(). Added unit test for the correct behavior in the case when streaming transaction is BF aborted in executing state. Silenced warning about failing to replicate rollback fragment. This is pretty normal condition and may happen during shutdown/ configuration changes when SR transactions are rolled back.
This commit is contained in:
@ -1082,6 +1082,21 @@ BOOST_FIXTURE_TEST_CASE(transaction_row_streaming_rollback,
|
||||
server_service.release_high_priority_service(hps);
|
||||
}
|
||||
|
||||
//
|
||||
// Test streaming BF abort in executing state.
|
||||
//
|
||||
BOOST_FIXTURE_TEST_CASE(transaction_row_streaming_bf_abort_executing,
|
||||
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);
|
||||
wsrep_test::bf_abort_unordered(cc);
|
||||
BOOST_REQUIRE(tc.streaming_context().rolled_back());
|
||||
BOOST_REQUIRE(cc.before_rollback() == 0);
|
||||
BOOST_REQUIRE(cc.after_rollback() == 0);
|
||||
BOOST_REQUIRE(cc.after_statement());
|
||||
}
|
||||
//
|
||||
// Test streaming certification failure during fragment replication
|
||||
//
|
||||
|
Reference in New Issue
Block a user