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

Remove provider position from ws_meta and view

Provider position clutters the public interface and is not
required by wsrep-API v26. Remove the position from ws_meta/view
classes and deal with it internally in custom providers.
This commit is contained in:
Teemu Ollakka
2023-09-07 14:55:59 +03:00
parent 41fee48c9e
commit bd1a5c25a9
15 changed files with 70 additions and 121 deletions

View File

@ -135,8 +135,7 @@ wsrep::view db::server_service::get_view(wsrep::client_service&,
stored_view.capabilities(), stored_view.capabilities(),
my_idx, my_idx,
stored_view.protocol_version(), stored_view.protocol_version(),
stored_view.members(), stored_view.members()
0
); );
return my_view; return my_view;
} }

View File

@ -125,25 +125,21 @@ namespace wsrep
, stid_() , stid_()
, depends_on_() , depends_on_()
, flags_() , flags_()
, provider_position_()
{ } { }
ws_meta(const wsrep::gtid& gtid, ws_meta(const wsrep::gtid& gtid,
const wsrep::stid& stid, const wsrep::stid& stid,
wsrep::seqno depends_on, wsrep::seqno depends_on,
int flags, int flags)
int64_t provider_position)
: gtid_(gtid) : gtid_(gtid)
, stid_(stid) , stid_(stid)
, depends_on_(depends_on) , depends_on_(depends_on)
, flags_(flags) , flags_(flags)
, provider_position_(provider_position)
{ } { }
ws_meta(const wsrep::stid& stid) ws_meta(const wsrep::stid& stid)
: gtid_() : gtid_()
, stid_(stid) , stid_(stid)
, depends_on_() , depends_on_()
, flags_() , flags_()
, provider_position_()
{ } { }
const wsrep::gtid& gtid() const { return gtid_; } const wsrep::gtid& gtid() const { return gtid_; }
const wsrep::id& group_id() const const wsrep::id& group_id() const
@ -175,8 +171,6 @@ namespace wsrep
wsrep::seqno depends_on() const { return depends_on_; } wsrep::seqno depends_on() const { return depends_on_; }
int64_t provider_position() const { return provider_position_; }
int flags() const { return flags_; } int flags() const { return flags_; }
bool operator==(const ws_meta& other) const bool operator==(const ws_meta& other) const
@ -193,8 +187,6 @@ namespace wsrep
wsrep::stid stid_; wsrep::stid stid_;
wsrep::seqno depends_on_; wsrep::seqno depends_on_;
int flags_; int flags_;
/** Field reserved for provider to report its internal position. */
int64_t provider_position_;
}; };
std::string flags_to_string(int flags); std::string flags_to_string(int flags);

View File

@ -70,7 +70,6 @@ namespace wsrep
, capabilities_() , capabilities_()
, own_index_(-1) , own_index_(-1)
, protocol_version_(0) , protocol_version_(0)
, provider_position_()
, members_() , members_()
{ } { }
view(const wsrep::gtid& state_id, view(const wsrep::gtid& state_id,
@ -79,15 +78,13 @@ namespace wsrep
int capabilities, int capabilities,
ssize_t own_index, ssize_t own_index,
int protocol_version, int protocol_version,
const std::vector<wsrep::view::member>& members, const std::vector<wsrep::view::member>& members)
int64_t provider_position)
: state_id_(state_id) : state_id_(state_id)
, view_seqno_(view_seqno) , view_seqno_(view_seqno)
, status_(status) , status_(status)
, capabilities_(capabilities) , capabilities_(capabilities)
, own_index_(own_index) , own_index_(own_index)
, protocol_version_(protocol_version) , protocol_version_(protocol_version)
, provider_position_(provider_position)
, members_(members) , members_(members)
{ } { }
@ -114,9 +111,6 @@ namespace wsrep
int protocol_version() const int protocol_version() const
{ return protocol_version_; } { return protocol_version_; }
int64_t provider_position() const
{ return provider_position_; }
const std::vector<member>& members() const const std::vector<member>& members() const
{ return members_; } { return members_; }
@ -153,8 +147,6 @@ namespace wsrep
int capabilities_; int capabilities_;
ssize_t own_index_; ssize_t own_index_;
int protocol_version_; int protocol_version_;
/** Field reserved for provider to report its internal position. */
int64_t provider_position_;
std::vector<wsrep::view::member> members_; std::vector<wsrep::view::member> members_;
}; };

View File

@ -530,7 +530,7 @@ int wsrep::client_state::total_order_bf_abort(
{ {
assert(lock.owns_lock()); assert(lock.owns_lock());
assert(mode_ == m_local || transaction_.is_streaming()); assert(mode_ == m_local || transaction_.is_streaming());
auto ret = transaction_.total_order_bf_abort(lock, bf_seqno); auto ret = transaction_.total_order_bf_abort(lock, bf_seqno, victim_ctx);
assert(lock.owns_lock()); assert(lock.owns_lock());
return ret; return ret;
} }

View File

@ -1554,7 +1554,7 @@ void wsrep::server_state::close_orphaned_sr_transactions(
wsrep::ws_meta ws_meta( wsrep::ws_meta ws_meta(
wsrep::gtid(), wsrep::gtid(),
wsrep::stid(server_id, transaction_id, wsrep::client_id()), wsrep::stid(server_id, transaction_id, wsrep::client_id()),
wsrep::seqno::undefined(), 0, 0); wsrep::seqno::undefined(), 0);
lock.unlock(); lock.unlock();
if (adopt_error == 0) if (adopt_error == 0)
{ {

View File

@ -242,7 +242,7 @@ namespace
sizeof(trx_meta_.stid.node.data)), sizeof(trx_meta_.stid.node.data)),
wsrep::transaction_id(trx_meta_.stid.trx), wsrep::transaction_id(trx_meta_.stid.trx),
wsrep::client_id(trx_meta_.stid.conn)), wsrep::client_id(trx_meta_.stid.conn)),
seqno_from_native(trx_meta_.depends_on), flags_, 0); seqno_from_native(trx_meta_.depends_on), flags_);
} }
wsrep_trx_meta* native() { return &trx_meta_; } wsrep_trx_meta* native() { return &trx_meta_; }
@ -347,7 +347,7 @@ namespace
map_capabilities_from_native(view_info.capabilities), map_capabilities_from_native(view_info.capabilities),
own_idx, own_idx,
view_info.proto_ver, view_info.proto_ver,
members, 0); members);
} }
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
@ -501,7 +501,7 @@ namespace
wsrep::transaction_id(meta->stid.trx), wsrep::transaction_id(meta->stid.trx),
wsrep::client_id(meta->stid.conn)), wsrep::client_id(meta->stid.conn)),
wsrep::seqno(seqno_from_native(meta->depends_on)), wsrep::seqno(seqno_from_native(meta->depends_on)),
map_flags_from_native(flags), 0); map_flags_from_native(flags));
try try
{ {
if (high_priority_service->apply(ws_handle, ws_meta, data)) if (high_priority_service->apply(ws_handle, ws_meta, data))

View File

@ -176,8 +176,7 @@ namespace
wsrep::stid(sc.id(), wsrep::transaction_id(1), cc.id()), wsrep::stid(sc.id(), wsrep::transaction_id(1), cc.id()),
wsrep::seqno(0), wsrep::seqno(0),
wsrep::provider::flag::start_transaction wsrep::provider::flag::start_transaction
| wsrep::provider::flag::commit, | wsrep::provider::flag::commit);
0);
BOOST_REQUIRE(cc.start_transaction(ws_handle, ws_meta) == 0); BOOST_REQUIRE(cc.start_transaction(ws_handle, ws_meta) == 0);
BOOST_REQUIRE(tc.active() == true); BOOST_REQUIRE(tc.active() == true);
BOOST_REQUIRE(tc.certified() == true); BOOST_REQUIRE(tc.certified() == true);
@ -212,8 +211,7 @@ namespace
wsrep::stid(sc.id(), wsrep::transaction_id(1), cc.id()), wsrep::stid(sc.id(), wsrep::transaction_id(1), cc.id()),
wsrep::seqno(0), wsrep::seqno(0),
wsrep::provider::flag::start_transaction wsrep::provider::flag::start_transaction
| wsrep::provider::flag::commit, | wsrep::provider::flag::commit);
0);
BOOST_REQUIRE(cc.start_transaction(ws_handle, ws_meta) == 0); BOOST_REQUIRE(cc.start_transaction(ws_handle, ws_meta) == 0);
BOOST_REQUIRE(tc.active() == true); BOOST_REQUIRE(tc.active() == true);
BOOST_REQUIRE(tc.certified() == true); BOOST_REQUIRE(tc.certified() == true);

View File

@ -117,7 +117,7 @@ namespace wsrep
++group_seqno_; ++group_seqno_;
wsrep::gtid gtid(group_id_, wsrep::seqno(group_seqno_)); wsrep::gtid gtid(group_id_, wsrep::seqno(group_seqno_));
ws_meta = wsrep::ws_meta( ws_meta = wsrep::ws_meta(
gtid, stid, wsrep::seqno(group_seqno_ - 1), flags, 0); gtid, stid, wsrep::seqno(group_seqno_ - 1), flags);
return wsrep::provider::success; return wsrep::provider::success;
} }
else else
@ -126,7 +126,7 @@ namespace wsrep
if (it->second.is_undefined()) if (it->second.is_undefined())
{ {
ws_meta = wsrep::ws_meta(wsrep::gtid(), wsrep::stid(), ws_meta = wsrep::ws_meta(wsrep::gtid(), wsrep::stid(),
wsrep::seqno::undefined(), 0, 0); wsrep::seqno::undefined(), 0);
ret = wsrep::provider::error_certification_failed; ret = wsrep::provider::error_certification_failed;
} }
else else
@ -134,7 +134,7 @@ namespace wsrep
++group_seqno_; ++group_seqno_;
wsrep::gtid gtid(group_id_, wsrep::seqno(group_seqno_)); wsrep::gtid gtid(group_id_, wsrep::seqno(group_seqno_));
ws_meta = wsrep::ws_meta( ws_meta = wsrep::ws_meta(
gtid, stid, wsrep::seqno(group_seqno_ - 1), flags, 0); gtid, stid, wsrep::seqno(group_seqno_ - 1), flags);
ret = wsrep::provider::error_bf_abort; ret = wsrep::provider::error_bf_abort;
} }
bf_abort_map_.erase(it); bf_abort_map_.erase(it);
@ -213,8 +213,7 @@ namespace wsrep
wsrep::stid(server_id_, tc.id(), cc.id()), wsrep::stid(server_id_, tc.id(), cc.id()),
wsrep::seqno(group_seqno_ - 1), wsrep::seqno(group_seqno_ - 1),
wsrep::provider::flag::start_transaction wsrep::provider::flag::start_transaction
| wsrep::provider::flag::commit, | wsrep::provider::flag::commit);
0);
} }
else else
{ {
@ -246,7 +245,7 @@ namespace wsrep
wsrep::stid stid(server_id_, wsrep::transaction_id::undefined(), wsrep::stid stid(server_id_, wsrep::transaction_id::undefined(),
client_id); client_id);
toi_meta = wsrep::ws_meta(gtid, stid, toi_meta = wsrep::ws_meta(gtid, stid,
wsrep::seqno(group_seqno_ - 1), flags, 0); wsrep::seqno(group_seqno_ - 1), flags);
++toi_write_sets_; ++toi_write_sets_;
if (flags & wsrep::provider::flag::start_transaction) if (flags & wsrep::provider::flag::start_transaction)
++toi_start_transaction_; ++toi_start_transaction_;

View File

@ -149,8 +149,7 @@ namespace wsrep
logged_view_.capabilities(), logged_view_.capabilities(),
my_idx, my_idx,
logged_view_.protocol_version(), logged_view_.protocol_version(),
logged_view_.members(), logged_view_.members()
0
); );
return my_view; return my_view;
} }
@ -306,8 +305,7 @@ namespace wsrep
0, 0,
0, 0,
1, 1,
members, members);
0);
server_state::on_connect(bootstrap_view); server_state::on_connect(bootstrap_view);
} }
else else

View File

@ -107,7 +107,7 @@ BOOST_FIXTURE_TEST_CASE(test_applying_nbo,
wsrep::stid(wsrep::id("s1"), wsrep::stid(wsrep::id("s1"),
wsrep::transaction_id::undefined(), wsrep::transaction_id::undefined(),
wsrep::client_id(1)), wsrep::client_id(1)),
wsrep::seqno(0), nbo_begin_flags, 0); wsrep::seqno(0), nbo_begin_flags);
std::string nbo_begin("nbo_begin"); std::string nbo_begin("nbo_begin");
BOOST_REQUIRE(sc.on_apply(hps, ws_handle, ws_meta, BOOST_REQUIRE(sc.on_apply(hps, ws_handle, ws_meta,
wsrep::const_buffer(nbo_begin.data(), wsrep::const_buffer(nbo_begin.data(),
@ -158,7 +158,7 @@ BOOST_FIXTURE_TEST_CASE(test_applying_nbo_fail,
wsrep::stid(wsrep::id("s1"), wsrep::stid(wsrep::id("s1"),
wsrep::transaction_id::undefined(), wsrep::transaction_id::undefined(),
wsrep::client_id(1)), wsrep::client_id(1)),
wsrep::seqno(0), nbo_begin_flags, 0); wsrep::seqno(0), nbo_begin_flags);
std::string nbo_begin("nbo_begin"); std::string nbo_begin("nbo_begin");
hps.fail_next_toi_ = true; hps.fail_next_toi_ = true;
BOOST_REQUIRE(sc.on_apply(hps, ws_handle, ws_meta, BOOST_REQUIRE(sc.on_apply(hps, ws_handle, ws_meta,

View File

@ -39,8 +39,7 @@ namespace
wsrep::client_id(1)), wsrep::client_id(1)),
wsrep::seqno(0), wsrep::seqno(0),
wsrep::provider::flag::start_transaction | wsrep::provider::flag::start_transaction |
wsrep::provider::flag::commit, wsrep::provider::flag::commit)
0)
, cluster_id("1") , cluster_id("1")
, bootstrap_view() , bootstrap_view()
, second_view() , second_view()
@ -56,8 +55,7 @@ namespace
0, // capabilities 0, // capabilities
0, // own index 0, // own index
1, // protocol version 1, // protocol version
members, members);
0);
members.push_back(wsrep::view::member( members.push_back(wsrep::view::member(
wsrep::id("s2"), "s2", "")); wsrep::id("s2"), "s2", ""));
@ -67,8 +65,7 @@ namespace
0, // capabilities 0, // capabilities
1, // own index 1, // own index
1, // protocol version 1, // protocol version
members, members);
0);
members.push_back(wsrep::view::member( members.push_back(wsrep::view::member(
wsrep::id("s3"), "s3", "")); wsrep::id("s3"), "s3", ""));
@ -79,8 +76,7 @@ namespace
0, // capabilities 0, // capabilities
1, // own index 1, // own index
1, // protocol version 1, // protocol version
members, members);
0);
cc.open(cc.id()); cc.open(cc.id());
BOOST_REQUIRE(cc.before_command() == 0); BOOST_REQUIRE(cc.before_command() == 0);
@ -116,29 +112,28 @@ namespace
members.push_back(wsrep::view::member( members.push_back(wsrep::view::member(
ss.id(), "s1", "")); ss.id(), "s1", ""));
wsrep::view view(wsrep::gtid(), // state_id wsrep::view view(wsrep::gtid(), // state_id
wsrep::seqno::undefined(), // view seqno wsrep::seqno::undefined(), // view seqno
wsrep::view::non_primary, // status wsrep::view::non_primary, // status
0, // capabilities 0, // capabilities
0, // own_index 0, // own_index
0, // protocol ver 0, // protocol ver
members // members members // members
); );
ss.on_view(view, &hps); ss.on_view(view, &hps);
} }
void final_view() void final_view()
{ {
BOOST_REQUIRE(ss.state() != wsrep::server_state::s_disconnected); BOOST_REQUIRE(ss.state() != wsrep::server_state::s_disconnected);
wsrep::view view(wsrep::gtid(), // state_id wsrep::view view(wsrep::gtid(), // state_id
wsrep::seqno::undefined(), // view seqno wsrep::seqno::undefined(), // view seqno
wsrep::view::disconnected, // status wsrep::view::disconnected, // status
0, // capabilities 0, // capabilities
-1, // own_index -1, // own_index
0, // protocol ver 0, // protocol ver
std::vector<wsrep::view::member>(),// members std::vector<wsrep::view::member>() // members
0 );
);
ss.on_view(view, &hps); ss.on_view(view, &hps);
} }
@ -295,8 +290,7 @@ BOOST_FIXTURE_TEST_CASE(server_state_streaming, applying_server_fixture)
wsrep::transaction_id(1), wsrep::transaction_id(1),
wsrep::client_id(1)), wsrep::client_id(1)),
wsrep::seqno(0), wsrep::seqno(0),
wsrep::provider::flag::start_transaction, wsrep::provider::flag::start_transaction);
0);
BOOST_REQUIRE(ss.on_apply(hps, ws_handle, ws_meta, BOOST_REQUIRE(ss.on_apply(hps, ws_handle, ws_meta,
wsrep::const_buffer("1", 1)) == 0); wsrep::const_buffer("1", 1)) == 0);
BOOST_REQUIRE(ss.find_streaming_applier( BOOST_REQUIRE(ss.find_streaming_applier(
@ -306,7 +300,6 @@ BOOST_FIXTURE_TEST_CASE(server_state_streaming, applying_server_fixture)
wsrep::transaction_id(1), wsrep::transaction_id(1),
wsrep::client_id(1)), wsrep::client_id(1)),
wsrep::seqno(1), wsrep::seqno(1),
0,
0); 0);
BOOST_REQUIRE(ss.on_apply(hps, ws_handle, ws_meta, BOOST_REQUIRE(ss.on_apply(hps, ws_handle, ws_meta,
wsrep::const_buffer("1", 1)) == 0); wsrep::const_buffer("1", 1)) == 0);
@ -315,8 +308,7 @@ BOOST_FIXTURE_TEST_CASE(server_state_streaming, applying_server_fixture)
wsrep::transaction_id(1), wsrep::transaction_id(1),
wsrep::client_id(1)), wsrep::client_id(1)),
wsrep::seqno(1), wsrep::seqno(1),
wsrep::provider::flag::commit, wsrep::provider::flag::commit);
0);
BOOST_REQUIRE(ss.on_apply(hps, ws_handle, ws_meta, BOOST_REQUIRE(ss.on_apply(hps, ws_handle, ws_meta,
wsrep::const_buffer("1", 1)) == 0); wsrep::const_buffer("1", 1)) == 0);
BOOST_REQUIRE(ss.find_streaming_applier( BOOST_REQUIRE(ss.find_streaming_applier(
@ -421,8 +413,7 @@ BOOST_FIXTURE_TEST_CASE(
0, // capabilities 0, // capabilities
0, // own index 0, // own index
1, // protocol version 1, // protocol version
members, members);
0);
ss.on_connect(view); ss.on_connect(view);
BOOST_REQUIRE(ss.state() == wsrep::server_state::s_connected); BOOST_REQUIRE(ss.state() == wsrep::server_state::s_connected);
// As storage engines have been initialized, there should not be // As storage engines have been initialized, there should not be
@ -582,8 +573,7 @@ BOOST_FIXTURE_TEST_CASE(
0, // capabilities 0, // capabilities
0, // own index 0, // own index
1, // protocol version 1, // protocol version
members, members);
0);
ss.on_connect(view); ss.on_connect(view);
BOOST_REQUIRE(ss.state() == wsrep::server_state::s_connected); BOOST_REQUIRE(ss.state() == wsrep::server_state::s_connected);
// As storage engines have been initialized, there should not be // As storage engines have been initialized, there should not be
@ -744,8 +734,7 @@ BOOST_FIXTURE_TEST_CASE(server_state_close_orphaned_transactions,
wsrep::transaction_id(1), wsrep::transaction_id(1),
wsrep::client_id(1)), wsrep::client_id(1)),
wsrep::seqno(1), wsrep::seqno(1),
wsrep::provider::flag::start_transaction, wsrep::provider::flag::start_transaction);
0);
BOOST_REQUIRE(ss.on_apply(hps, ws_handle, meta_s2, BOOST_REQUIRE(ss.on_apply(hps, ws_handle, meta_s2,
wsrep::const_buffer("1", 1)) == 0); wsrep::const_buffer("1", 1)) == 0);
@ -758,8 +747,7 @@ BOOST_FIXTURE_TEST_CASE(server_state_close_orphaned_transactions,
wsrep::transaction_id(1), wsrep::transaction_id(1),
wsrep::client_id(1)), wsrep::client_id(1)),
wsrep::seqno(2), wsrep::seqno(2),
wsrep::provider::flag::start_transaction, wsrep::provider::flag::start_transaction);
0);
BOOST_REQUIRE(ss.on_apply(hps, ws_handle, meta_s3, BOOST_REQUIRE(ss.on_apply(hps, ws_handle, meta_s3,
wsrep::const_buffer("1", 1)) == 0); wsrep::const_buffer("1", 1)) == 0);
@ -775,8 +763,7 @@ BOOST_FIXTURE_TEST_CASE(server_state_close_orphaned_transactions,
0, // capabilities 0, // capabilities
0, // own index 0, // own index
1, // protocol version 1, // protocol version
members, members), &hps);
0), &hps);
// transaction from s2 is still present // transaction from s2 is still present
BOOST_REQUIRE(ss.find_streaming_applier( BOOST_REQUIRE(ss.find_streaming_applier(
@ -794,7 +781,7 @@ BOOST_FIXTURE_TEST_CASE(server_state_close_orphaned_transactions,
0, // capabilities 0, // capabilities
0, // own index 0, // own index
1, // protocol version 1, // protocol version
members, 0), &hps); members), &hps);
// no streaming appliers are closed on non-primary view, // no streaming appliers are closed on non-primary view,
// so transaction from s2 is still present // so transaction from s2 is still present
@ -809,8 +796,7 @@ BOOST_FIXTURE_TEST_CASE(server_state_close_orphaned_transactions,
0, // capabilities 0, // capabilities
0, // own index 0, // own index
1, // protocol version 1, // protocol version
members, members), &hps);
0), &hps);
// transaction s2 is still present after non-primary view // transaction s2 is still present after non-primary view
BOOST_REQUIRE(ss.find_streaming_applier( BOOST_REQUIRE(ss.find_streaming_applier(
@ -824,8 +810,7 @@ BOOST_FIXTURE_TEST_CASE(server_state_close_orphaned_transactions,
0, // capabilities 0, // capabilities
0, // own index 0, // own index
1, // protocol version 1, // protocol version
members, members), &hps);
0), &hps);
// finally, transaction from s2 is still present (part of primary view) // finally, transaction from s2 is still present (part of primary view)
// and transaction from s3 is gone // and transaction from s3 is gone
@ -840,8 +825,7 @@ BOOST_FIXTURE_TEST_CASE(server_state_close_orphaned_transactions,
wsrep::transaction_id(1), wsrep::transaction_id(1),
wsrep::client_id(1)), wsrep::client_id(1)),
wsrep::seqno(3), wsrep::seqno(3),
wsrep::provider::flag::commit, wsrep::provider::flag::commit);
0);
BOOST_REQUIRE(ss.on_apply(hps, ws_handle, meta_commit_s2, BOOST_REQUIRE(ss.on_apply(hps, ws_handle, meta_commit_s2,
wsrep::const_buffer("1", 1)) == 0); wsrep::const_buffer("1", 1)) == 0);
@ -868,8 +852,7 @@ BOOST_FIXTURE_TEST_CASE(server_state_equal_consecutive_views,
wsrep::transaction_id(1), wsrep::transaction_id(1),
wsrep::client_id(1)), wsrep::client_id(1)),
wsrep::seqno(1), wsrep::seqno(1),
wsrep::provider::flag::start_transaction, wsrep::provider::flag::start_transaction);
0);
BOOST_REQUIRE(ss.on_apply(hps, ws_handle, meta_s2, BOOST_REQUIRE(ss.on_apply(hps, ws_handle, meta_s2,
wsrep::const_buffer("1", 1)) == 0); wsrep::const_buffer("1", 1)) == 0);
@ -882,8 +865,7 @@ BOOST_FIXTURE_TEST_CASE(server_state_equal_consecutive_views,
wsrep::transaction_id(1), wsrep::transaction_id(1),
wsrep::client_id(1)), wsrep::client_id(1)),
wsrep::seqno(2), wsrep::seqno(2),
wsrep::provider::flag::start_transaction, wsrep::provider::flag::start_transaction);
0);
BOOST_REQUIRE(ss.on_apply(hps, ws_handle, meta_s3, BOOST_REQUIRE(ss.on_apply(hps, ws_handle, meta_s3,
wsrep::const_buffer("1", 1)) == 0); wsrep::const_buffer("1", 1)) == 0);
@ -897,8 +879,7 @@ BOOST_FIXTURE_TEST_CASE(server_state_equal_consecutive_views,
0, // capabilities 0, // capabilities
0, // own index 0, // own index
1, // protocol version 1, // protocol version
ss.current_view().members(), ss.current_view().members()), &hps);
0), &hps);
// transaction from s2 and s3 are gone // transaction from s2 and s3 are gone
BOOST_REQUIRE(not ss.find_streaming_applier( BOOST_REQUIRE(not ss.find_streaming_applier(
@ -927,8 +908,7 @@ BOOST_FIXTURE_TEST_CASE(server_state_xa_not_orphaned,
wsrep::client_id(1)), wsrep::client_id(1)),
wsrep::seqno(1), wsrep::seqno(1),
wsrep::provider::flag::start_transaction | wsrep::provider::flag::start_transaction |
wsrep::provider::flag::prepare, wsrep::provider::flag::prepare);
0);
BOOST_REQUIRE(ss.on_apply(hps, ws_handle, meta_s3, BOOST_REQUIRE(ss.on_apply(hps, ws_handle, meta_s3,
wsrep::const_buffer("1", 1)) == 0); wsrep::const_buffer("1", 1)) == 0);
@ -945,8 +925,7 @@ BOOST_FIXTURE_TEST_CASE(server_state_xa_not_orphaned,
0, // capabilities 0, // capabilities
0, // own index 0, // own index
1, // protocol version 1, // protocol version
members, members), &hps);
0), &hps);
// transaction from s3 is still present // transaction from s3 is still present
BOOST_REQUIRE(ss.find_streaming_applier( BOOST_REQUIRE(ss.find_streaming_applier(
@ -960,8 +939,7 @@ BOOST_FIXTURE_TEST_CASE(server_state_xa_not_orphaned,
0, // capabilities 0, // capabilities
0, // own index 0, // own index
1, // protocol version 1, // protocol version
members, members), &hps);
0), &hps);
// transaction from s3 is still present // transaction from s3 is still present
BOOST_REQUIRE(ss.find_streaming_applier( BOOST_REQUIRE(ss.find_streaming_applier(
@ -973,8 +951,7 @@ BOOST_FIXTURE_TEST_CASE(server_state_xa_not_orphaned,
wsrep::transaction_id(1), wsrep::transaction_id(1),
wsrep::client_id(1)), wsrep::client_id(1)),
wsrep::seqno(3), wsrep::seqno(3),
wsrep::provider::flag::commit, wsrep::provider::flag::commit);
0);
BOOST_REQUIRE(ss.on_apply(hps, ws_handle, meta_commit_s3, BOOST_REQUIRE(ss.on_apply(hps, ws_handle, meta_commit_s3,
wsrep::const_buffer("1", 1)) == 0); wsrep::const_buffer("1", 1)) == 0);

View File

@ -67,7 +67,7 @@ void wsrep_test::terminate_streaming_applier(
wsrep::ws_meta ws_meta( wsrep::ws_meta ws_meta(
wsrep::gtid(wsrep::id("cluster1"), wsrep::seqno(100)), wsrep::gtid(wsrep::id("cluster1"), wsrep::seqno(100)),
wsrep::stid(server_id, transaction_id, wsrep::client_id(1)), wsrep::stid(server_id, transaction_id, wsrep::client_id(1)),
wsrep::seqno(0), wsrep::provider::flag::rollback, 0); wsrep::seqno(0), wsrep::provider::flag::rollback);
wsrep::const_buffer data(0, 0); wsrep::const_buffer data(0, 0);
sc.on_apply(hps, ws_handle, ws_meta, data); sc.on_apply(hps, ws_handle, ws_meta, data);
} }

View File

@ -55,8 +55,7 @@ BOOST_FIXTURE_TEST_CASE(test_toi_applying,
wsrep::stid(sc.id(), wsrep::transaction_id::undefined(), cc.id()), wsrep::stid(sc.id(), wsrep::transaction_id::undefined(), cc.id()),
wsrep::seqno(1), wsrep::seqno(1),
wsrep::provider::flag::start_transaction wsrep::provider::flag::start_transaction
| wsrep::provider::flag::commit, | wsrep::provider::flag::commit);
0);
cc.enter_toi_mode(ws_meta); cc.enter_toi_mode(ws_meta);
BOOST_REQUIRE(cc.in_toi()); BOOST_REQUIRE(cc.in_toi());
BOOST_REQUIRE(cc.toi_mode() == wsrep::client_state::m_high_priority); BOOST_REQUIRE(cc.toi_mode() == wsrep::client_state::m_high_priority);

View File

@ -1423,7 +1423,7 @@ BOOST_FIXTURE_TEST_CASE(
// TO BF abort must not replicate rollback fragment, // TO BF abort must not replicate rollback fragment,
// rollback must complete before TO is allowed to // rollback must complete before TO is allowed to
// continue. // continue.
BOOST_REQUIRE(sc.provider().rollback_fragments() == 0); BOOST_REQUIRE(sc.mock_provider().rollback_fragments() == 0);
BOOST_REQUIRE(tc.streaming_context().rolled_back()); BOOST_REQUIRE(tc.streaming_context().rolled_back());
BOOST_REQUIRE(cc.before_rollback() == 0); BOOST_REQUIRE(cc.before_rollback() == 0);
BOOST_REQUIRE(cc.after_rollback() == 0); BOOST_REQUIRE(cc.after_rollback() == 0);
@ -1502,10 +1502,10 @@ BOOST_FIXTURE_TEST_CASE(
BOOST_REQUIRE(cc.start_transaction(wsrep::transaction_id(1)) == 0); BOOST_REQUIRE(cc.start_transaction(wsrep::transaction_id(1)) == 0);
BOOST_REQUIRE(cc.after_row() == 0); BOOST_REQUIRE(cc.after_row() == 0);
BOOST_REQUIRE(tc.streaming_context().fragments_certified() == 1); BOOST_REQUIRE(tc.streaming_context().fragments_certified() == 1);
sc.provider().commit_order_enter_result_ = wsrep::provider::error_bf_abort; sc.mock_provider().commit_order_enter_result_ = wsrep::provider::error_bf_abort;
BOOST_REQUIRE(cc.before_commit()); BOOST_REQUIRE(cc.before_commit());
BOOST_REQUIRE_EQUAL(tc.state(), wsrep::transaction::s_must_replay); BOOST_REQUIRE_EQUAL(tc.state(), wsrep::transaction::s_must_replay);
sc.provider().commit_order_enter_result_ = wsrep::provider::success; sc.mock_provider().commit_order_enter_result_ = wsrep::provider::success;
BOOST_REQUIRE(cc.before_rollback() == 0); BOOST_REQUIRE(cc.before_rollback() == 0);
BOOST_REQUIRE(cc.after_rollback() == 0); BOOST_REQUIRE(cc.after_rollback() == 0);
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_must_replay); BOOST_REQUIRE(tc.state() == wsrep::transaction::s_must_replay);
@ -1529,8 +1529,8 @@ BOOST_FIXTURE_TEST_CASE(
BOOST_REQUIRE(cc.after_row() == 0); BOOST_REQUIRE(cc.after_row() == 0);
BOOST_REQUIRE(tc.streaming_context().fragments_certified() == 1); BOOST_REQUIRE(tc.streaming_context().fragments_certified() == 1);
sc.provider().certify_result_ = wsrep::provider::error_bf_abort; sc.mock_provider().certify_result_ = wsrep::provider::error_bf_abort;
sc.provider().replay_result_ = wsrep::provider::success; sc.mock_provider().replay_result_ = wsrep::provider::success;
BOOST_REQUIRE(cc.before_commit()); BOOST_REQUIRE(cc.before_commit());
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_must_replay); BOOST_REQUIRE(tc.state() == wsrep::transaction::s_must_replay);
@ -1553,8 +1553,8 @@ BOOST_FIXTURE_TEST_CASE(
BOOST_REQUIRE(cc.after_row() == 0); BOOST_REQUIRE(cc.after_row() == 0);
BOOST_REQUIRE(tc.streaming_context().fragments_certified() == 1); BOOST_REQUIRE(tc.streaming_context().fragments_certified() == 1);
sc.provider().certify_result_ = wsrep::provider::error_bf_abort; sc.mock_provider().certify_result_ = wsrep::provider::error_bf_abort;
sc.provider().replay_result_ = wsrep::provider::error_certification_failed; sc.mock_provider().replay_result_ = wsrep::provider::error_certification_failed;
BOOST_REQUIRE(cc.before_commit()); BOOST_REQUIRE(cc.before_commit());
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_must_replay); BOOST_REQUIRE(tc.state() == wsrep::transaction::s_must_replay);

View File

@ -33,8 +33,7 @@ BOOST_AUTO_TEST_CASE(view_test_member_index)
0, 0,
1, 1,
0, 0,
members, members);
0);
BOOST_REQUIRE(view.member_index(wsrep::id("1")) == 0); BOOST_REQUIRE(view.member_index(wsrep::id("1")) == 0);
BOOST_REQUIRE(view.member_index(wsrep::id("2")) == 1); BOOST_REQUIRE(view.member_index(wsrep::id("2")) == 1);
BOOST_REQUIRE(view.member_index(wsrep::id("3")) == 2); BOOST_REQUIRE(view.member_index(wsrep::id("3")) == 2);
@ -65,8 +64,7 @@ BOOST_AUTO_TEST_CASE(view_test_equal_membership)
0, 0,
1, 1,
0, 0,
m1, m1);
0);
wsrep::view v2(wsrep::gtid(wsrep::id("cluster"), wsrep::seqno(1)), wsrep::view v2(wsrep::gtid(wsrep::id("cluster"), wsrep::seqno(1)),
wsrep::seqno(1), wsrep::seqno(1),
@ -74,8 +72,7 @@ BOOST_AUTO_TEST_CASE(view_test_equal_membership)
0, 0,
1, 1,
0, 0,
m2, m2);
0);
wsrep::view v3(wsrep::gtid(wsrep::id("cluster"), wsrep::seqno(1)), wsrep::view v3(wsrep::gtid(wsrep::id("cluster"), wsrep::seqno(1)),
wsrep::seqno(1), wsrep::seqno(1),
@ -83,8 +80,7 @@ BOOST_AUTO_TEST_CASE(view_test_equal_membership)
0, 0,
1, 1,
0, 0,
m3, m3);
0);
BOOST_REQUIRE(v1.equal_membership(v2)); BOOST_REQUIRE(v1.equal_membership(v2));
BOOST_REQUIRE(v2.equal_membership(v1)); BOOST_REQUIRE(v2.equal_membership(v1));
@ -101,8 +97,7 @@ BOOST_AUTO_TEST_CASE(view_test_is_member)
1, 1,
0, 0,
{ wsrep::view::member(wsrep::id("1"), "", ""), { wsrep::view::member(wsrep::id("1"), "", ""),
wsrep::view::member(wsrep::id("2"), "", "") }, wsrep::view::member(wsrep::id("2"), "", "") });
0);
BOOST_REQUIRE(view.is_member(wsrep::id("2"))); BOOST_REQUIRE(view.is_member(wsrep::id("2")));
BOOST_REQUIRE(view.is_member(wsrep::id("1"))); BOOST_REQUIRE(view.is_member(wsrep::id("1")));