1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-30 07:23:07 +03:00

Track commit states for read-only transactions

Read-only transactions which don't produce any changes were
not tracker properly. Added tracking for read-only transaction
commit states. One phase commit is assumed.
This commit is contained in:
Teemu Ollakka
2023-04-04 09:36:17 +03:00
parent 3115584c66
commit 12c8069f09
3 changed files with 60 additions and 2 deletions

View File

@ -1294,8 +1294,28 @@ BOOST_FIXTURE_TEST_CASE(transaction_read_only,
cc.start_transaction(wsrep::transaction_id(1));
BOOST_REQUIRE(cc.before_commit() == 0);
BOOST_REQUIRE(sc.provider().commit_fragments() == 0);
BOOST_REQUIRE(cc.ordered_commit() == 0);
BOOST_REQUIRE(cc.after_commit() == 0);
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_committed);
BOOST_REQUIRE(cc.after_statement() == 0);
}
BOOST_FIXTURE_TEST_CASE(transaction_bf_abort_read_only,
replicating_client_fixture_sync_rm)
{
cc.start_transaction(wsrep::transaction_id(1));
wsrep_test::bf_abort_unordered(cc);
BOOST_REQUIRE(cc.before_commit() == 1);
BOOST_REQUIRE(sc.provider().commit_fragments() == 0);
BOOST_REQUIRE(cc.before_rollback() == 0);
BOOST_REQUIRE(cc.after_rollback() == 0);
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_aborted);
BOOST_REQUIRE(cc.after_statement() == 1);
BOOST_REQUIRE(cc.current_error() == wsrep::client_error::e_deadlock_error);
}
BOOST_FIXTURE_TEST_CASE(transaction_1pc_applying,
applying_client_fixture)
{