1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-06-04 09:02:12 +03:00

Attempting to reproduce assertion in transaction cleanup

Assertion is seen with MTR with modified Galera which returns
WSREP_BF_ABORT for final SR transaction fragment.
This commit is contained in:
Teemu Ollakka 2023-05-11 10:51:02 +03:00
parent 5185ad3481
commit c458510b4b
4 changed files with 24 additions and 3 deletions

View File

@ -267,7 +267,6 @@ namespace wsrep
enum state state_;
std::vector<enum state> state_hist_;
enum state bf_abort_state_;
enum wsrep::provider::status bf_abort_provider_status_;
int bf_abort_client_state_;
bool bf_aborted_in_total_order_;
wsrep::ws_handle ws_handle_;

View File

@ -98,7 +98,6 @@ wsrep::transaction::transaction(
, state_(s_executing)
, state_hist_()
, bf_abort_state_(s_executing)
, bf_abort_provider_status_()
, bf_abort_client_state_()
, bf_aborted_in_total_order_()
, ws_handle_()
@ -1799,6 +1798,8 @@ int wsrep::transaction::certify_commit(
lock.lock();
wsrep::log_info() << "Certify commit ret: " << cert_ret;
assert(state() == s_certifying || state() == s_must_abort);
int ret(1);
@ -2084,7 +2085,6 @@ void wsrep::transaction::cleanup()
client_state_.update_last_written_gtid(ws_meta_.gtid());
}
bf_abort_state_ = s_executing;
bf_abort_provider_status_ = wsrep::provider::success;
bf_abort_client_state_ = 0;
bf_aborted_in_total_order_ = false;
ws_meta_ = wsrep::ws_meta();

View File

@ -106,6 +106,7 @@ namespace wsrep
static_cast<mock_high_priority_service*>(high_priority_service));
wsrep::mock_client* cs(&static_cast<wsrep::mock_client&>(
mhps->client_state()));
cs->after_applying();
cs->after_command_before_result();
cs->after_command_after_result();
cs->close();

View File

@ -1488,6 +1488,27 @@ BOOST_FIXTURE_TEST_CASE(transaction_row_streaming_cert_fail_commit,
server_service.release_high_priority_service(hps);
}
//
// Test streaming BF abort on commit fragment which fails certification
//
BOOST_FIXTURE_TEST_CASE(transaction_row_streaming_bf_abort_commit_cert_fail,
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);
sc.provider().certify_result_ = wsrep::provider::error_bf_abort;
BOOST_REQUIRE(cc.before_commit() == 1);
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_must_replay);
sc.provider().replay_result_ = wsrep::provider::error_certification_failed;
BOOST_REQUIRE(cc.before_rollback() == 0);
BOOST_REQUIRE(cc.after_rollback() == 0);
BOOST_REQUIRE(cc.after_statement() );
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_aborted);
BOOST_REQUIRE(sc.provider().fragments() == 1);
BOOST_REQUIRE(sc.provider().start_fragments() == 1);
}
//
// Test streaming BF abort after succesful certification
//