mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-30 07:23:07 +03:00
Renamed transcation_context to transaction
This commit is contained in:
@ -7,8 +7,8 @@ add_executable(wsrep-lib_test
|
||||
test_utils.cpp
|
||||
id_test.cpp
|
||||
server_context_test.cpp
|
||||
transaction_context_test.cpp
|
||||
transaction_context_test_2pc.cpp
|
||||
transaction_test.cpp
|
||||
transaction_test_2pc.cpp
|
||||
wsrep-lib_test.cpp
|
||||
)
|
||||
target_link_libraries(wsrep-lib_test wsrep-lib)
|
||||
|
@ -25,11 +25,11 @@ namespace
|
||||
BOOST_REQUIRE(cc.before_statement() == 0);
|
||||
// Verify initial state
|
||||
BOOST_REQUIRE(tc.active() == false);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_executing);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_executing);
|
||||
}
|
||||
wsrep::mock_server_context sc;
|
||||
wsrep::mock_client_state cc;
|
||||
const wsrep::transaction_context& tc;
|
||||
const wsrep::transaction& tc;
|
||||
};
|
||||
|
||||
struct replicating_client_fixture_async_rm
|
||||
@ -44,11 +44,11 @@ namespace
|
||||
BOOST_REQUIRE(cc.before_statement() == 0);
|
||||
// Verify initial state
|
||||
BOOST_REQUIRE(tc.active() == false);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_executing);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_executing);
|
||||
}
|
||||
wsrep::mock_server_context sc;
|
||||
wsrep::mock_client_state cc;
|
||||
const wsrep::transaction_context& tc;
|
||||
const wsrep::transaction& tc;
|
||||
};
|
||||
|
||||
struct replicating_client_fixture_2pc
|
||||
@ -64,11 +64,11 @@ namespace
|
||||
BOOST_REQUIRE(cc.before_statement() == 0);
|
||||
// Verify initial state
|
||||
BOOST_REQUIRE(tc.active() == false);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_executing);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_executing);
|
||||
}
|
||||
wsrep::mock_server_context sc;
|
||||
wsrep::mock_client_state cc;
|
||||
const wsrep::transaction_context& tc;
|
||||
const wsrep::transaction& tc;
|
||||
};
|
||||
|
||||
struct replicating_client_fixture_autocommit
|
||||
@ -84,11 +84,11 @@ namespace
|
||||
BOOST_REQUIRE(cc.before_statement() == 0);
|
||||
// Verify initial state
|
||||
BOOST_REQUIRE(tc.active() == false);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_executing);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_executing);
|
||||
}
|
||||
wsrep::mock_server_context sc;
|
||||
wsrep::mock_client_state cc;
|
||||
const wsrep::transaction_context& tc;
|
||||
const wsrep::transaction& tc;
|
||||
};
|
||||
|
||||
struct applying_client_fixture
|
||||
@ -116,7 +116,7 @@ namespace
|
||||
}
|
||||
wsrep::mock_server_context sc;
|
||||
wsrep::mock_client_state cc;
|
||||
const wsrep::transaction_context& tc;
|
||||
const wsrep::transaction& tc;
|
||||
};
|
||||
|
||||
struct applying_client_fixture_2pc
|
||||
@ -145,7 +145,7 @@ namespace
|
||||
}
|
||||
wsrep::mock_server_context sc;
|
||||
wsrep::mock_client_state cc;
|
||||
const wsrep::transaction_context& tc;
|
||||
const wsrep::transaction& tc;
|
||||
};
|
||||
|
||||
struct streaming_client_fixture_row
|
||||
@ -160,12 +160,12 @@ namespace
|
||||
BOOST_REQUIRE(cc.before_statement() == 0);
|
||||
// Verify initial state
|
||||
BOOST_REQUIRE(tc.active() == false);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_executing);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_executing);
|
||||
cc.enable_streaming(wsrep::streaming_context::row, 1);
|
||||
}
|
||||
wsrep::mock_server_context sc;
|
||||
wsrep::mock_client_state cc;
|
||||
const wsrep::transaction_context& tc;
|
||||
const wsrep::transaction& tc;
|
||||
};
|
||||
|
||||
struct streaming_client_fixture_byte
|
||||
@ -180,12 +180,12 @@ namespace
|
||||
BOOST_REQUIRE(cc.before_statement() == 0);
|
||||
// Verify initial state
|
||||
BOOST_REQUIRE(tc.active() == false);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_executing);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_executing);
|
||||
cc.enable_streaming(wsrep::streaming_context::bytes, 1);
|
||||
}
|
||||
wsrep::mock_server_context sc;
|
||||
wsrep::mock_client_state cc;
|
||||
const wsrep::transaction_context& tc;
|
||||
const wsrep::transaction& tc;
|
||||
};
|
||||
|
||||
struct streaming_client_fixture_statement
|
||||
@ -200,13 +200,13 @@ namespace
|
||||
BOOST_REQUIRE(cc.before_statement() == 0);
|
||||
// Verify initial state
|
||||
BOOST_REQUIRE(tc.active() == false);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_executing);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_executing);
|
||||
cc.enable_streaming(wsrep::streaming_context::row, 1);
|
||||
}
|
||||
|
||||
wsrep::mock_server_context sc;
|
||||
wsrep::mock_client_state cc;
|
||||
const wsrep::transaction_context& tc;
|
||||
const wsrep::transaction& tc;
|
||||
};
|
||||
}
|
||||
#endif // WSREP_TEST_CLIENT_CONTEXT_FIXTURE_HPP
|
||||
|
@ -2,7 +2,7 @@
|
||||
// Copyright (C) 2018 Codership Oy <info@codership.com>
|
||||
//
|
||||
|
||||
#include "wsrep/transaction_context.hpp"
|
||||
#include "wsrep/transaction.hpp"
|
||||
#include "mock_client_state.hpp"
|
||||
|
||||
|
||||
@ -11,8 +11,8 @@ int wsrep::mock_client_service::apply(
|
||||
const wsrep::const_buffer&)
|
||||
|
||||
{
|
||||
assert(client_state.transaction().state() == wsrep::transaction_context::s_executing ||
|
||||
client_state.transaction().state() == wsrep::transaction_context::s_replaying);
|
||||
assert(client_state.transaction().state() == wsrep::transaction::s_executing ||
|
||||
client_state.transaction().state() == wsrep::transaction::s_replaying);
|
||||
return (fail_next_applying_ ? 1 : 0);
|
||||
}
|
||||
|
||||
|
@ -76,17 +76,17 @@ namespace wsrep
|
||||
void reset_globals() WSREP_OVERRIDE { }
|
||||
void emergency_shutdown() WSREP_OVERRIDE { ++aborts_; }
|
||||
|
||||
int append_fragment(const wsrep::transaction_context&,
|
||||
int append_fragment(const wsrep::transaction&,
|
||||
int, const wsrep::const_buffer&) WSREP_OVERRIDE
|
||||
{ return 0; }
|
||||
void remove_fragments(const wsrep::transaction_context& )
|
||||
void remove_fragments(const wsrep::transaction& )
|
||||
WSREP_OVERRIDE { }
|
||||
void will_replay(const wsrep::transaction_context&)
|
||||
void will_replay(const wsrep::transaction&)
|
||||
WSREP_OVERRIDE { }
|
||||
|
||||
enum wsrep::provider::status
|
||||
replay(wsrep::client_state& client_state,
|
||||
wsrep::transaction_context& tc) WSREP_OVERRIDE
|
||||
wsrep::transaction& tc) WSREP_OVERRIDE
|
||||
{
|
||||
enum wsrep::provider::status ret(
|
||||
provider_.replay(tc.ws_handle(), &client_state));
|
||||
@ -109,7 +109,7 @@ namespace wsrep
|
||||
|
||||
int prepare_data_for_replication(
|
||||
wsrep::client_state& client_state,
|
||||
const wsrep::transaction_context&) WSREP_OVERRIDE
|
||||
const wsrep::transaction&) WSREP_OVERRIDE
|
||||
{
|
||||
if (error_during_prepare_data_)
|
||||
{
|
||||
@ -127,7 +127,7 @@ namespace wsrep
|
||||
|
||||
int prepare_fragment_for_replication(
|
||||
wsrep::client_state& client_state,
|
||||
const wsrep::transaction_context&,
|
||||
const wsrep::transaction&,
|
||||
wsrep::mutable_buffer& buffer)
|
||||
WSREP_OVERRIDE
|
||||
{
|
||||
|
@ -157,7 +157,7 @@ namespace wsrep
|
||||
wsrep::client_state& cc(
|
||||
*static_cast<wsrep::client_state*>(ctx));
|
||||
wsrep::high_priority_context high_priority_context(cc);
|
||||
const wsrep::transaction_context& tc(cc.transaction());
|
||||
const wsrep::transaction& tc(cc.transaction());
|
||||
wsrep::ws_meta ws_meta;
|
||||
if (replay_result_ == wsrep::provider::success)
|
||||
{
|
||||
|
@ -67,8 +67,8 @@ namespace wsrep
|
||||
client_state.after_rollback();
|
||||
}
|
||||
// void sst_received(const wsrep_gtid_t&, int) WSREP_OVERRIDE { }
|
||||
// void on_apply(wsrep::transaction_context&) { }
|
||||
// void on_commit(wsrep::transaction_context&) { }
|
||||
// void on_apply(wsrep::transaction&) { }
|
||||
// void on_commit(wsrep::transaction&) { }
|
||||
wsrep::mock_client_service& client_service()
|
||||
{
|
||||
return client_service_;
|
||||
|
@ -38,10 +38,10 @@ BOOST_FIXTURE_TEST_CASE(server_context_applying_1pc,
|
||||
char buf[1] = { 1 };
|
||||
BOOST_REQUIRE(sc.on_apply(cc, ws_handle, ws_meta,
|
||||
wsrep::const_buffer(buf, 1)) == 0);
|
||||
const wsrep::transaction_context& txc(cc.transaction());
|
||||
const wsrep::transaction& txc(cc.transaction());
|
||||
// ::abort();
|
||||
BOOST_REQUIRE_MESSAGE(
|
||||
txc.state() == wsrep::transaction_context::s_committed,
|
||||
txc.state() == wsrep::transaction::s_committed,
|
||||
"Transaction state " << txc.state() << " not committed");
|
||||
}
|
||||
|
||||
@ -52,8 +52,8 @@ BOOST_FIXTURE_TEST_CASE(server_context_applying_2pc,
|
||||
char buf[1] = { 1 };
|
||||
BOOST_REQUIRE(sc.on_apply(cc, ws_handle, ws_meta,
|
||||
wsrep::const_buffer(buf, 1)) == 0);
|
||||
const wsrep::transaction_context& txc(cc.transaction());
|
||||
BOOST_REQUIRE(txc.state() == wsrep::transaction_context::s_committed);
|
||||
const wsrep::transaction& txc(cc.transaction());
|
||||
BOOST_REQUIRE(txc.state() == wsrep::transaction::s_committed);
|
||||
}
|
||||
|
||||
// Test on_apply() method for 1pc transaction which
|
||||
@ -65,8 +65,8 @@ BOOST_FIXTURE_TEST_CASE(server_context_applying_1pc_rollback,
|
||||
char buf[1] = { 1 };
|
||||
BOOST_REQUIRE(sc.on_apply(cc, ws_handle, ws_meta,
|
||||
wsrep::const_buffer(buf, 1)) == 1);
|
||||
const wsrep::transaction_context& txc(cc.transaction());
|
||||
BOOST_REQUIRE(txc.state() == wsrep::transaction_context::s_aborted);
|
||||
const wsrep::transaction& txc(cc.transaction());
|
||||
BOOST_REQUIRE(txc.state() == wsrep::transaction::s_aborted);
|
||||
}
|
||||
|
||||
// Test on_apply() method for 2pc transaction which
|
||||
@ -78,8 +78,8 @@ BOOST_FIXTURE_TEST_CASE(server_context_applying_2pc_rollback,
|
||||
char buf[1] = { 1 };
|
||||
BOOST_REQUIRE(sc.on_apply(cc, ws_handle, ws_meta,
|
||||
wsrep::const_buffer(buf, 1)) == 1);
|
||||
const wsrep::transaction_context& txc(cc.transaction());
|
||||
BOOST_REQUIRE(txc.state() == wsrep::transaction_context::s_aborted);
|
||||
const wsrep::transaction& txc(cc.transaction());
|
||||
BOOST_REQUIRE(txc.state() == wsrep::transaction::s_aborted);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(server_context_streaming)
|
||||
|
@ -21,7 +21,7 @@ void wsrep_test::bf_abort_ordered(wsrep::client_state& cc)
|
||||
}
|
||||
// BF abort method to abort transactions via provider
|
||||
void wsrep_test::bf_abort_provider(wsrep::mock_server_context& sc,
|
||||
const wsrep::transaction_context& tc,
|
||||
const wsrep::transaction& tc,
|
||||
wsrep::seqno bf_seqno)
|
||||
{
|
||||
wsrep::seqno victim_seqno;
|
||||
|
@ -9,7 +9,7 @@ namespace wsrep
|
||||
class mock_server_context;
|
||||
}
|
||||
|
||||
#include "wsrep/transaction_context.hpp"
|
||||
#include "wsrep/transaction.hpp"
|
||||
#include "wsrep/provider.hpp"
|
||||
|
||||
//
|
||||
@ -26,7 +26,7 @@ namespace wsrep_test
|
||||
|
||||
// BF abort method to abort transactions via provider
|
||||
void bf_abort_provider(wsrep::mock_server_context& sc,
|
||||
const wsrep::transaction_context& tc,
|
||||
const wsrep::transaction& tc,
|
||||
wsrep::seqno bf_seqno);
|
||||
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -7,23 +7,23 @@
|
||||
//
|
||||
// Test a succesful 2PC transaction lifecycle
|
||||
//
|
||||
BOOST_FIXTURE_TEST_CASE(transaction_context_2pc,
|
||||
BOOST_FIXTURE_TEST_CASE(transaction_2pc,
|
||||
replicating_client_fixture_2pc)
|
||||
{
|
||||
cc.start_transaction(1);
|
||||
BOOST_REQUIRE(tc.active());
|
||||
BOOST_REQUIRE(tc.id() == wsrep::transaction_id(1));
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_executing);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_executing);
|
||||
BOOST_REQUIRE(cc.before_prepare() == 0);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_preparing);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_preparing);
|
||||
BOOST_REQUIRE(cc.after_prepare() == 0);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_committing);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_committing);
|
||||
BOOST_REQUIRE(cc.before_commit() == 0);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_committing);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_committing);
|
||||
BOOST_REQUIRE(cc.ordered_commit() == 0);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_ordered_commit);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_ordered_commit);
|
||||
BOOST_REQUIRE(cc.after_commit() == 0);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_committed);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_committed);
|
||||
BOOST_REQUIRE(cc.after_statement() == wsrep::client_state::asr_success);
|
||||
BOOST_REQUIRE(tc.active() == false);
|
||||
BOOST_REQUIRE(tc.ordered() == false);
|
||||
@ -35,22 +35,22 @@ BOOST_FIXTURE_TEST_CASE(transaction_context_2pc,
|
||||
// Test a 2PC transaction which gets BF aborted before before_prepare
|
||||
//
|
||||
BOOST_FIXTURE_TEST_CASE(
|
||||
transaction_context_2pc_bf_before_before_prepare,
|
||||
transaction_2pc_bf_before_before_prepare,
|
||||
replicating_client_fixture_2pc)
|
||||
{
|
||||
cc.start_transaction(1);
|
||||
BOOST_REQUIRE(tc.active());
|
||||
BOOST_REQUIRE(tc.id() == wsrep::transaction_id(1));
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_executing);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_executing);
|
||||
wsrep_test::bf_abort_unordered(cc);
|
||||
BOOST_REQUIRE(cc.before_prepare());
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_must_abort);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_must_abort);
|
||||
BOOST_REQUIRE(tc.certified() == false);
|
||||
BOOST_REQUIRE(tc.ordered() == false);
|
||||
BOOST_REQUIRE(cc.before_rollback() == 0);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_aborting);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_aborting);
|
||||
BOOST_REQUIRE(cc.after_rollback() == 0);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_aborted);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_aborted);
|
||||
BOOST_REQUIRE(cc.after_statement() == wsrep::client_state::asr_error);
|
||||
BOOST_REQUIRE(tc.active() == false);
|
||||
BOOST_REQUIRE(tc.ordered() == false);
|
||||
@ -62,24 +62,24 @@ BOOST_FIXTURE_TEST_CASE(
|
||||
// Test a 2PC transaction which gets BF aborted before before_prepare
|
||||
//
|
||||
BOOST_FIXTURE_TEST_CASE(
|
||||
transaction_context_2pc_bf_before_after_prepare,
|
||||
transaction_2pc_bf_before_after_prepare,
|
||||
replicating_client_fixture_2pc)
|
||||
{
|
||||
cc.start_transaction(1);
|
||||
BOOST_REQUIRE(tc.active());
|
||||
BOOST_REQUIRE(tc.id() == wsrep::transaction_id(1));
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_executing);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_executing);
|
||||
BOOST_REQUIRE(cc.before_prepare() == 0);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_preparing);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_preparing);
|
||||
wsrep_test::bf_abort_unordered(cc);
|
||||
BOOST_REQUIRE(cc.after_prepare());
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_must_abort);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_must_abort);
|
||||
BOOST_REQUIRE(tc.certified() == false);
|
||||
BOOST_REQUIRE(tc.ordered() == false);
|
||||
BOOST_REQUIRE(cc.before_rollback() == 0);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_aborting);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_aborting);
|
||||
BOOST_REQUIRE(cc.after_rollback() == 0);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_aborted);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_aborted);
|
||||
BOOST_REQUIRE(cc.after_statement() == wsrep::client_state::asr_error);
|
||||
BOOST_REQUIRE(tc.active() == false);
|
||||
BOOST_REQUIRE(tc.ordered() == false);
|
||||
@ -92,22 +92,22 @@ BOOST_FIXTURE_TEST_CASE(
|
||||
// the rollback takes place before entering before_commit().
|
||||
//
|
||||
BOOST_FIXTURE_TEST_CASE(
|
||||
transaction_context_2pc_bf_after_after_prepare,
|
||||
transaction_2pc_bf_after_after_prepare,
|
||||
replicating_client_fixture_2pc)
|
||||
{
|
||||
cc.start_transaction(1);
|
||||
BOOST_REQUIRE(tc.active());
|
||||
BOOST_REQUIRE(tc.id() == wsrep::transaction_id(1));
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_executing);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_executing);
|
||||
BOOST_REQUIRE(cc.before_prepare() == 0);
|
||||
BOOST_REQUIRE(cc.after_prepare() == 0);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_committing);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_committing);
|
||||
wsrep_test::bf_abort_ordered(cc);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_must_abort);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_must_abort);
|
||||
BOOST_REQUIRE(cc.before_rollback() == 0);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_must_replay);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_must_replay);
|
||||
BOOST_REQUIRE(cc.after_rollback() == 0);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_must_replay);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_must_replay);
|
||||
BOOST_REQUIRE(cc.after_statement() == wsrep::client_state::asr_success);
|
||||
BOOST_REQUIRE(tc.active() == false);
|
||||
BOOST_REQUIRE(tc.ordered() == false);
|
||||
@ -120,26 +120,26 @@ BOOST_FIXTURE_TEST_CASE(
|
||||
// and before_commit()
|
||||
//
|
||||
BOOST_FIXTURE_TEST_CASE(
|
||||
transaction_context_2pc_bf_before_before_commit,
|
||||
transaction_2pc_bf_before_before_commit,
|
||||
replicating_client_fixture_2pc)
|
||||
{
|
||||
cc.start_transaction(1);
|
||||
BOOST_REQUIRE(tc.active());
|
||||
BOOST_REQUIRE(tc.id() == wsrep::transaction_id(1));
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_executing);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_executing);
|
||||
BOOST_REQUIRE(cc.before_prepare() == 0);
|
||||
BOOST_REQUIRE(cc.after_prepare() == 0);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_committing);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_committing);
|
||||
wsrep_test::bf_abort_ordered(cc);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_must_abort);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_must_abort);
|
||||
BOOST_REQUIRE(cc.before_commit());
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_must_replay);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_must_replay);
|
||||
BOOST_REQUIRE(tc.certified() == true);
|
||||
BOOST_REQUIRE(tc.ordered() == true);
|
||||
BOOST_REQUIRE(cc.before_rollback() == 0);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_must_replay);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_must_replay);
|
||||
BOOST_REQUIRE(cc.after_rollback() == 0);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_must_replay);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_must_replay);
|
||||
BOOST_REQUIRE(cc.after_statement() == wsrep::client_state::asr_success);
|
||||
BOOST_REQUIRE(tc.active() == false);
|
||||
BOOST_REQUIRE(tc.ordered() == false);
|
||||
@ -153,25 +153,25 @@ BOOST_FIXTURE_TEST_CASE(
|
||||
// commit order.
|
||||
//
|
||||
BOOST_FIXTURE_TEST_CASE(
|
||||
transaction_context_2pc_bf_during_commit_order_enter,
|
||||
transaction_2pc_bf_during_commit_order_enter,
|
||||
replicating_client_fixture_2pc)
|
||||
{
|
||||
cc.start_transaction(1);
|
||||
BOOST_REQUIRE(tc.active());
|
||||
BOOST_REQUIRE(tc.id() == wsrep::transaction_id(1));
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_executing);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_executing);
|
||||
BOOST_REQUIRE(cc.before_prepare() == 0);
|
||||
BOOST_REQUIRE(cc.after_prepare() == 0);
|
||||
sc.provider().commit_order_enter_result_ = wsrep::provider::error_bf_abort;
|
||||
BOOST_REQUIRE(cc.before_commit());
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_must_replay);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_must_replay);
|
||||
BOOST_REQUIRE(tc.certified() == true);
|
||||
BOOST_REQUIRE(tc.ordered() == true);
|
||||
sc.provider().commit_order_enter_result_ = wsrep::provider::success;
|
||||
BOOST_REQUIRE(cc.before_rollback() == 0);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_must_replay);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_must_replay);
|
||||
BOOST_REQUIRE(cc.after_rollback() == 0);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_must_replay);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_must_replay);
|
||||
BOOST_REQUIRE(cc.after_statement() == wsrep::client_state::asr_success);
|
||||
BOOST_REQUIRE(tc.active() == false);
|
||||
BOOST_REQUIRE(tc.ordered() == false);
|
||||
@ -184,7 +184,7 @@ BOOST_FIXTURE_TEST_CASE(
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
BOOST_FIXTURE_TEST_CASE(transaction_context_streaming_2pc_commit,
|
||||
BOOST_FIXTURE_TEST_CASE(transaction_streaming_2pc_commit,
|
||||
streaming_client_fixture_row)
|
||||
{
|
||||
BOOST_REQUIRE(cc.start_transaction(1) == 0);
|
||||
@ -201,7 +201,7 @@ BOOST_FIXTURE_TEST_CASE(transaction_context_streaming_2pc_commit,
|
||||
BOOST_REQUIRE(sc.provider().commit_fragments() == 1);
|
||||
}
|
||||
|
||||
BOOST_FIXTURE_TEST_CASE(transaction_context_streaming_2pc_commit_two_statements,
|
||||
BOOST_FIXTURE_TEST_CASE(transaction_streaming_2pc_commit_two_statements,
|
||||
streaming_client_fixture_row)
|
||||
{
|
||||
BOOST_REQUIRE(cc.start_transaction(1) == 0);
|
||||
@ -226,21 +226,21 @@ BOOST_FIXTURE_TEST_CASE(transaction_context_streaming_2pc_commit_two_statements,
|
||||
// APPLYING //
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
BOOST_FIXTURE_TEST_CASE(transaction_context_2pc_applying,
|
||||
BOOST_FIXTURE_TEST_CASE(transaction_2pc_applying,
|
||||
applying_client_fixture_2pc)
|
||||
{
|
||||
BOOST_REQUIRE(cc.before_prepare() == 0);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_preparing);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_preparing);
|
||||
BOOST_REQUIRE(cc.after_prepare() == 0);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_committing);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_committing);
|
||||
BOOST_REQUIRE(cc.before_commit() == 0);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_committing);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_committing);
|
||||
BOOST_REQUIRE(cc.ordered_commit() == 0);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_ordered_commit);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_ordered_commit);
|
||||
BOOST_REQUIRE(cc.after_commit() == 0);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_committed);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_committed);
|
||||
BOOST_REQUIRE(cc.after_statement() == wsrep::client_state::asr_success);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_committed);
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_committed);
|
||||
BOOST_REQUIRE(tc.active() == false);
|
||||
BOOST_REQUIRE(cc.current_error() == wsrep::e_success);
|
||||
}
|
Reference in New Issue
Block a user