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:
@ -135,8 +135,7 @@ wsrep::view db::server_service::get_view(wsrep::client_service&,
|
||||
stored_view.capabilities(),
|
||||
my_idx,
|
||||
stored_view.protocol_version(),
|
||||
stored_view.members(),
|
||||
0
|
||||
stored_view.members()
|
||||
);
|
||||
return my_view;
|
||||
}
|
||||
|
@ -125,25 +125,21 @@ namespace wsrep
|
||||
, stid_()
|
||||
, depends_on_()
|
||||
, flags_()
|
||||
, provider_position_()
|
||||
{ }
|
||||
ws_meta(const wsrep::gtid& gtid,
|
||||
const wsrep::stid& stid,
|
||||
wsrep::seqno depends_on,
|
||||
int flags,
|
||||
int64_t provider_position)
|
||||
int flags)
|
||||
: gtid_(gtid)
|
||||
, stid_(stid)
|
||||
, depends_on_(depends_on)
|
||||
, flags_(flags)
|
||||
, provider_position_(provider_position)
|
||||
{ }
|
||||
ws_meta(const wsrep::stid& stid)
|
||||
: gtid_()
|
||||
, stid_(stid)
|
||||
, depends_on_()
|
||||
, flags_()
|
||||
, provider_position_()
|
||||
{ }
|
||||
const wsrep::gtid& gtid() const { return gtid_; }
|
||||
const wsrep::id& group_id() const
|
||||
@ -175,8 +171,6 @@ namespace wsrep
|
||||
|
||||
wsrep::seqno depends_on() const { return depends_on_; }
|
||||
|
||||
int64_t provider_position() const { return provider_position_; }
|
||||
|
||||
int flags() const { return flags_; }
|
||||
|
||||
bool operator==(const ws_meta& other) const
|
||||
@ -193,8 +187,6 @@ namespace wsrep
|
||||
wsrep::stid stid_;
|
||||
wsrep::seqno depends_on_;
|
||||
int flags_;
|
||||
/** Field reserved for provider to report its internal position. */
|
||||
int64_t provider_position_;
|
||||
};
|
||||
|
||||
std::string flags_to_string(int flags);
|
||||
|
@ -70,7 +70,6 @@ namespace wsrep
|
||||
, capabilities_()
|
||||
, own_index_(-1)
|
||||
, protocol_version_(0)
|
||||
, provider_position_()
|
||||
, members_()
|
||||
{ }
|
||||
view(const wsrep::gtid& state_id,
|
||||
@ -79,15 +78,13 @@ namespace wsrep
|
||||
int capabilities,
|
||||
ssize_t own_index,
|
||||
int protocol_version,
|
||||
const std::vector<wsrep::view::member>& members,
|
||||
int64_t provider_position)
|
||||
const std::vector<wsrep::view::member>& members)
|
||||
: state_id_(state_id)
|
||||
, view_seqno_(view_seqno)
|
||||
, status_(status)
|
||||
, capabilities_(capabilities)
|
||||
, own_index_(own_index)
|
||||
, protocol_version_(protocol_version)
|
||||
, provider_position_(provider_position)
|
||||
, members_(members)
|
||||
{ }
|
||||
|
||||
@ -114,9 +111,6 @@ namespace wsrep
|
||||
int protocol_version() const
|
||||
{ return protocol_version_; }
|
||||
|
||||
int64_t provider_position() const
|
||||
{ return provider_position_; }
|
||||
|
||||
const std::vector<member>& members() const
|
||||
{ return members_; }
|
||||
|
||||
@ -153,8 +147,6 @@ namespace wsrep
|
||||
int capabilities_;
|
||||
ssize_t own_index_;
|
||||
int protocol_version_;
|
||||
/** Field reserved for provider to report its internal position. */
|
||||
int64_t provider_position_;
|
||||
std::vector<wsrep::view::member> members_;
|
||||
};
|
||||
|
||||
|
@ -530,7 +530,7 @@ int wsrep::client_state::total_order_bf_abort(
|
||||
{
|
||||
assert(lock.owns_lock());
|
||||
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());
|
||||
return ret;
|
||||
}
|
||||
|
@ -1554,7 +1554,7 @@ void wsrep::server_state::close_orphaned_sr_transactions(
|
||||
wsrep::ws_meta ws_meta(
|
||||
wsrep::gtid(),
|
||||
wsrep::stid(server_id, transaction_id, wsrep::client_id()),
|
||||
wsrep::seqno::undefined(), 0, 0);
|
||||
wsrep::seqno::undefined(), 0);
|
||||
lock.unlock();
|
||||
if (adopt_error == 0)
|
||||
{
|
||||
|
@ -242,7 +242,7 @@ namespace
|
||||
sizeof(trx_meta_.stid.node.data)),
|
||||
wsrep::transaction_id(trx_meta_.stid.trx),
|
||||
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_; }
|
||||
@ -347,7 +347,7 @@ namespace
|
||||
map_capabilities_from_native(view_info.capabilities),
|
||||
own_idx,
|
||||
view_info.proto_ver,
|
||||
members, 0);
|
||||
members);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
@ -501,7 +501,7 @@ namespace
|
||||
wsrep::transaction_id(meta->stid.trx),
|
||||
wsrep::client_id(meta->stid.conn)),
|
||||
wsrep::seqno(seqno_from_native(meta->depends_on)),
|
||||
map_flags_from_native(flags), 0);
|
||||
map_flags_from_native(flags));
|
||||
try
|
||||
{
|
||||
if (high_priority_service->apply(ws_handle, ws_meta, data))
|
||||
|
@ -176,8 +176,7 @@ namespace
|
||||
wsrep::stid(sc.id(), wsrep::transaction_id(1), cc.id()),
|
||||
wsrep::seqno(0),
|
||||
wsrep::provider::flag::start_transaction
|
||||
| wsrep::provider::flag::commit,
|
||||
0);
|
||||
| wsrep::provider::flag::commit);
|
||||
BOOST_REQUIRE(cc.start_transaction(ws_handle, ws_meta) == 0);
|
||||
BOOST_REQUIRE(tc.active() == true);
|
||||
BOOST_REQUIRE(tc.certified() == true);
|
||||
@ -212,8 +211,7 @@ namespace
|
||||
wsrep::stid(sc.id(), wsrep::transaction_id(1), cc.id()),
|
||||
wsrep::seqno(0),
|
||||
wsrep::provider::flag::start_transaction
|
||||
| wsrep::provider::flag::commit,
|
||||
0);
|
||||
| wsrep::provider::flag::commit);
|
||||
BOOST_REQUIRE(cc.start_transaction(ws_handle, ws_meta) == 0);
|
||||
BOOST_REQUIRE(tc.active() == true);
|
||||
BOOST_REQUIRE(tc.certified() == true);
|
||||
|
@ -117,7 +117,7 @@ namespace wsrep
|
||||
++group_seqno_;
|
||||
wsrep::gtid gtid(group_id_, wsrep::seqno(group_seqno_));
|
||||
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;
|
||||
}
|
||||
else
|
||||
@ -126,7 +126,7 @@ namespace wsrep
|
||||
if (it->second.is_undefined())
|
||||
{
|
||||
ws_meta = wsrep::ws_meta(wsrep::gtid(), wsrep::stid(),
|
||||
wsrep::seqno::undefined(), 0, 0);
|
||||
wsrep::seqno::undefined(), 0);
|
||||
ret = wsrep::provider::error_certification_failed;
|
||||
}
|
||||
else
|
||||
@ -134,7 +134,7 @@ namespace wsrep
|
||||
++group_seqno_;
|
||||
wsrep::gtid gtid(group_id_, wsrep::seqno(group_seqno_));
|
||||
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;
|
||||
}
|
||||
bf_abort_map_.erase(it);
|
||||
@ -213,8 +213,7 @@ namespace wsrep
|
||||
wsrep::stid(server_id_, tc.id(), cc.id()),
|
||||
wsrep::seqno(group_seqno_ - 1),
|
||||
wsrep::provider::flag::start_transaction
|
||||
| wsrep::provider::flag::commit,
|
||||
0);
|
||||
| wsrep::provider::flag::commit);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -246,7 +245,7 @@ namespace wsrep
|
||||
wsrep::stid stid(server_id_, wsrep::transaction_id::undefined(),
|
||||
client_id);
|
||||
toi_meta = wsrep::ws_meta(gtid, stid,
|
||||
wsrep::seqno(group_seqno_ - 1), flags, 0);
|
||||
wsrep::seqno(group_seqno_ - 1), flags);
|
||||
++toi_write_sets_;
|
||||
if (flags & wsrep::provider::flag::start_transaction)
|
||||
++toi_start_transaction_;
|
||||
|
@ -149,8 +149,7 @@ namespace wsrep
|
||||
logged_view_.capabilities(),
|
||||
my_idx,
|
||||
logged_view_.protocol_version(),
|
||||
logged_view_.members(),
|
||||
0
|
||||
logged_view_.members()
|
||||
);
|
||||
return my_view;
|
||||
}
|
||||
@ -306,8 +305,7 @@ namespace wsrep
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
members,
|
||||
0);
|
||||
members);
|
||||
server_state::on_connect(bootstrap_view);
|
||||
}
|
||||
else
|
||||
|
@ -107,7 +107,7 @@ BOOST_FIXTURE_TEST_CASE(test_applying_nbo,
|
||||
wsrep::stid(wsrep::id("s1"),
|
||||
wsrep::transaction_id::undefined(),
|
||||
wsrep::client_id(1)),
|
||||
wsrep::seqno(0), nbo_begin_flags, 0);
|
||||
wsrep::seqno(0), nbo_begin_flags);
|
||||
std::string nbo_begin("nbo_begin");
|
||||
BOOST_REQUIRE(sc.on_apply(hps, ws_handle, ws_meta,
|
||||
wsrep::const_buffer(nbo_begin.data(),
|
||||
@ -158,7 +158,7 @@ BOOST_FIXTURE_TEST_CASE(test_applying_nbo_fail,
|
||||
wsrep::stid(wsrep::id("s1"),
|
||||
wsrep::transaction_id::undefined(),
|
||||
wsrep::client_id(1)),
|
||||
wsrep::seqno(0), nbo_begin_flags, 0);
|
||||
wsrep::seqno(0), nbo_begin_flags);
|
||||
std::string nbo_begin("nbo_begin");
|
||||
hps.fail_next_toi_ = true;
|
||||
BOOST_REQUIRE(sc.on_apply(hps, ws_handle, ws_meta,
|
||||
|
@ -39,8 +39,7 @@ namespace
|
||||
wsrep::client_id(1)),
|
||||
wsrep::seqno(0),
|
||||
wsrep::provider::flag::start_transaction |
|
||||
wsrep::provider::flag::commit,
|
||||
0)
|
||||
wsrep::provider::flag::commit)
|
||||
, cluster_id("1")
|
||||
, bootstrap_view()
|
||||
, second_view()
|
||||
@ -56,8 +55,7 @@ namespace
|
||||
0, // capabilities
|
||||
0, // own index
|
||||
1, // protocol version
|
||||
members,
|
||||
0);
|
||||
members);
|
||||
|
||||
members.push_back(wsrep::view::member(
|
||||
wsrep::id("s2"), "s2", ""));
|
||||
@ -67,8 +65,7 @@ namespace
|
||||
0, // capabilities
|
||||
1, // own index
|
||||
1, // protocol version
|
||||
members,
|
||||
0);
|
||||
members);
|
||||
|
||||
members.push_back(wsrep::view::member(
|
||||
wsrep::id("s3"), "s3", ""));
|
||||
@ -79,8 +76,7 @@ namespace
|
||||
0, // capabilities
|
||||
1, // own index
|
||||
1, // protocol version
|
||||
members,
|
||||
0);
|
||||
members);
|
||||
|
||||
cc.open(cc.id());
|
||||
BOOST_REQUIRE(cc.before_command() == 0);
|
||||
@ -136,8 +132,7 @@ namespace
|
||||
0, // capabilities
|
||||
-1, // own_index
|
||||
0, // protocol ver
|
||||
std::vector<wsrep::view::member>(),// members
|
||||
0
|
||||
std::vector<wsrep::view::member>() // members
|
||||
);
|
||||
ss.on_view(view, &hps);
|
||||
}
|
||||
@ -295,8 +290,7 @@ BOOST_FIXTURE_TEST_CASE(server_state_streaming, applying_server_fixture)
|
||||
wsrep::transaction_id(1),
|
||||
wsrep::client_id(1)),
|
||||
wsrep::seqno(0),
|
||||
wsrep::provider::flag::start_transaction,
|
||||
0);
|
||||
wsrep::provider::flag::start_transaction);
|
||||
BOOST_REQUIRE(ss.on_apply(hps, ws_handle, ws_meta,
|
||||
wsrep::const_buffer("1", 1)) == 0);
|
||||
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::client_id(1)),
|
||||
wsrep::seqno(1),
|
||||
0,
|
||||
0);
|
||||
BOOST_REQUIRE(ss.on_apply(hps, ws_handle, ws_meta,
|
||||
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::client_id(1)),
|
||||
wsrep::seqno(1),
|
||||
wsrep::provider::flag::commit,
|
||||
0);
|
||||
wsrep::provider::flag::commit);
|
||||
BOOST_REQUIRE(ss.on_apply(hps, ws_handle, ws_meta,
|
||||
wsrep::const_buffer("1", 1)) == 0);
|
||||
BOOST_REQUIRE(ss.find_streaming_applier(
|
||||
@ -421,8 +413,7 @@ BOOST_FIXTURE_TEST_CASE(
|
||||
0, // capabilities
|
||||
0, // own index
|
||||
1, // protocol version
|
||||
members,
|
||||
0);
|
||||
members);
|
||||
ss.on_connect(view);
|
||||
BOOST_REQUIRE(ss.state() == wsrep::server_state::s_connected);
|
||||
// As storage engines have been initialized, there should not be
|
||||
@ -582,8 +573,7 @@ BOOST_FIXTURE_TEST_CASE(
|
||||
0, // capabilities
|
||||
0, // own index
|
||||
1, // protocol version
|
||||
members,
|
||||
0);
|
||||
members);
|
||||
ss.on_connect(view);
|
||||
BOOST_REQUIRE(ss.state() == wsrep::server_state::s_connected);
|
||||
// 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::client_id(1)),
|
||||
wsrep::seqno(1),
|
||||
wsrep::provider::flag::start_transaction,
|
||||
0);
|
||||
wsrep::provider::flag::start_transaction);
|
||||
|
||||
BOOST_REQUIRE(ss.on_apply(hps, ws_handle, meta_s2,
|
||||
wsrep::const_buffer("1", 1)) == 0);
|
||||
@ -758,8 +747,7 @@ BOOST_FIXTURE_TEST_CASE(server_state_close_orphaned_transactions,
|
||||
wsrep::transaction_id(1),
|
||||
wsrep::client_id(1)),
|
||||
wsrep::seqno(2),
|
||||
wsrep::provider::flag::start_transaction,
|
||||
0);
|
||||
wsrep::provider::flag::start_transaction);
|
||||
|
||||
BOOST_REQUIRE(ss.on_apply(hps, ws_handle, meta_s3,
|
||||
wsrep::const_buffer("1", 1)) == 0);
|
||||
@ -775,8 +763,7 @@ BOOST_FIXTURE_TEST_CASE(server_state_close_orphaned_transactions,
|
||||
0, // capabilities
|
||||
0, // own index
|
||||
1, // protocol version
|
||||
members,
|
||||
0), &hps);
|
||||
members), &hps);
|
||||
|
||||
// transaction from s2 is still present
|
||||
BOOST_REQUIRE(ss.find_streaming_applier(
|
||||
@ -794,7 +781,7 @@ BOOST_FIXTURE_TEST_CASE(server_state_close_orphaned_transactions,
|
||||
0, // capabilities
|
||||
0, // own index
|
||||
1, // protocol version
|
||||
members, 0), &hps);
|
||||
members), &hps);
|
||||
|
||||
// no streaming appliers are closed on non-primary view,
|
||||
// so transaction from s2 is still present
|
||||
@ -809,8 +796,7 @@ BOOST_FIXTURE_TEST_CASE(server_state_close_orphaned_transactions,
|
||||
0, // capabilities
|
||||
0, // own index
|
||||
1, // protocol version
|
||||
members,
|
||||
0), &hps);
|
||||
members), &hps);
|
||||
|
||||
// transaction s2 is still present after non-primary view
|
||||
BOOST_REQUIRE(ss.find_streaming_applier(
|
||||
@ -824,8 +810,7 @@ BOOST_FIXTURE_TEST_CASE(server_state_close_orphaned_transactions,
|
||||
0, // capabilities
|
||||
0, // own index
|
||||
1, // protocol version
|
||||
members,
|
||||
0), &hps);
|
||||
members), &hps);
|
||||
|
||||
// finally, transaction from s2 is still present (part of primary view)
|
||||
// and transaction from s3 is gone
|
||||
@ -840,8 +825,7 @@ BOOST_FIXTURE_TEST_CASE(server_state_close_orphaned_transactions,
|
||||
wsrep::transaction_id(1),
|
||||
wsrep::client_id(1)),
|
||||
wsrep::seqno(3),
|
||||
wsrep::provider::flag::commit,
|
||||
0);
|
||||
wsrep::provider::flag::commit);
|
||||
|
||||
BOOST_REQUIRE(ss.on_apply(hps, ws_handle, meta_commit_s2,
|
||||
wsrep::const_buffer("1", 1)) == 0);
|
||||
@ -868,8 +852,7 @@ BOOST_FIXTURE_TEST_CASE(server_state_equal_consecutive_views,
|
||||
wsrep::transaction_id(1),
|
||||
wsrep::client_id(1)),
|
||||
wsrep::seqno(1),
|
||||
wsrep::provider::flag::start_transaction,
|
||||
0);
|
||||
wsrep::provider::flag::start_transaction);
|
||||
|
||||
BOOST_REQUIRE(ss.on_apply(hps, ws_handle, meta_s2,
|
||||
wsrep::const_buffer("1", 1)) == 0);
|
||||
@ -882,8 +865,7 @@ BOOST_FIXTURE_TEST_CASE(server_state_equal_consecutive_views,
|
||||
wsrep::transaction_id(1),
|
||||
wsrep::client_id(1)),
|
||||
wsrep::seqno(2),
|
||||
wsrep::provider::flag::start_transaction,
|
||||
0);
|
||||
wsrep::provider::flag::start_transaction);
|
||||
|
||||
BOOST_REQUIRE(ss.on_apply(hps, ws_handle, meta_s3,
|
||||
wsrep::const_buffer("1", 1)) == 0);
|
||||
@ -897,8 +879,7 @@ BOOST_FIXTURE_TEST_CASE(server_state_equal_consecutive_views,
|
||||
0, // capabilities
|
||||
0, // own index
|
||||
1, // protocol version
|
||||
ss.current_view().members(),
|
||||
0), &hps);
|
||||
ss.current_view().members()), &hps);
|
||||
|
||||
// transaction from s2 and s3 are gone
|
||||
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::seqno(1),
|
||||
wsrep::provider::flag::start_transaction |
|
||||
wsrep::provider::flag::prepare,
|
||||
0);
|
||||
wsrep::provider::flag::prepare);
|
||||
|
||||
BOOST_REQUIRE(ss.on_apply(hps, ws_handle, meta_s3,
|
||||
wsrep::const_buffer("1", 1)) == 0);
|
||||
@ -945,8 +925,7 @@ BOOST_FIXTURE_TEST_CASE(server_state_xa_not_orphaned,
|
||||
0, // capabilities
|
||||
0, // own index
|
||||
1, // protocol version
|
||||
members,
|
||||
0), &hps);
|
||||
members), &hps);
|
||||
|
||||
// transaction from s3 is still present
|
||||
BOOST_REQUIRE(ss.find_streaming_applier(
|
||||
@ -960,8 +939,7 @@ BOOST_FIXTURE_TEST_CASE(server_state_xa_not_orphaned,
|
||||
0, // capabilities
|
||||
0, // own index
|
||||
1, // protocol version
|
||||
members,
|
||||
0), &hps);
|
||||
members), &hps);
|
||||
|
||||
// transaction from s3 is still present
|
||||
BOOST_REQUIRE(ss.find_streaming_applier(
|
||||
@ -973,8 +951,7 @@ BOOST_FIXTURE_TEST_CASE(server_state_xa_not_orphaned,
|
||||
wsrep::transaction_id(1),
|
||||
wsrep::client_id(1)),
|
||||
wsrep::seqno(3),
|
||||
wsrep::provider::flag::commit,
|
||||
0);
|
||||
wsrep::provider::flag::commit);
|
||||
|
||||
BOOST_REQUIRE(ss.on_apply(hps, ws_handle, meta_commit_s3,
|
||||
wsrep::const_buffer("1", 1)) == 0);
|
||||
|
@ -67,7 +67,7 @@ void wsrep_test::terminate_streaming_applier(
|
||||
wsrep::ws_meta ws_meta(
|
||||
wsrep::gtid(wsrep::id("cluster1"), wsrep::seqno(100)),
|
||||
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);
|
||||
sc.on_apply(hps, ws_handle, ws_meta, data);
|
||||
}
|
||||
|
@ -55,8 +55,7 @@ BOOST_FIXTURE_TEST_CASE(test_toi_applying,
|
||||
wsrep::stid(sc.id(), wsrep::transaction_id::undefined(), cc.id()),
|
||||
wsrep::seqno(1),
|
||||
wsrep::provider::flag::start_transaction
|
||||
| wsrep::provider::flag::commit,
|
||||
0);
|
||||
| wsrep::provider::flag::commit);
|
||||
cc.enter_toi_mode(ws_meta);
|
||||
BOOST_REQUIRE(cc.in_toi());
|
||||
BOOST_REQUIRE(cc.toi_mode() == wsrep::client_state::m_high_priority);
|
||||
|
@ -1423,7 +1423,7 @@ BOOST_FIXTURE_TEST_CASE(
|
||||
// TO BF abort must not replicate rollback fragment,
|
||||
// rollback must complete before TO is allowed to
|
||||
// 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(cc.before_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.after_row() == 0);
|
||||
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_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.after_rollback() == 0);
|
||||
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(tc.streaming_context().fragments_certified() == 1);
|
||||
|
||||
sc.provider().certify_result_ = wsrep::provider::error_bf_abort;
|
||||
sc.provider().replay_result_ = wsrep::provider::success;
|
||||
sc.mock_provider().certify_result_ = wsrep::provider::error_bf_abort;
|
||||
sc.mock_provider().replay_result_ = wsrep::provider::success;
|
||||
|
||||
BOOST_REQUIRE(cc.before_commit());
|
||||
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(tc.streaming_context().fragments_certified() == 1);
|
||||
|
||||
sc.provider().certify_result_ = wsrep::provider::error_bf_abort;
|
||||
sc.provider().replay_result_ = wsrep::provider::error_certification_failed;
|
||||
sc.mock_provider().certify_result_ = wsrep::provider::error_bf_abort;
|
||||
sc.mock_provider().replay_result_ = wsrep::provider::error_certification_failed;
|
||||
|
||||
BOOST_REQUIRE(cc.before_commit());
|
||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_must_replay);
|
||||
|
@ -33,8 +33,7 @@ BOOST_AUTO_TEST_CASE(view_test_member_index)
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
members,
|
||||
0);
|
||||
members);
|
||||
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("3")) == 2);
|
||||
@ -65,8 +64,7 @@ BOOST_AUTO_TEST_CASE(view_test_equal_membership)
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
m1,
|
||||
0);
|
||||
m1);
|
||||
|
||||
wsrep::view v2(wsrep::gtid(wsrep::id("cluster"), wsrep::seqno(1)),
|
||||
wsrep::seqno(1),
|
||||
@ -74,8 +72,7 @@ BOOST_AUTO_TEST_CASE(view_test_equal_membership)
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
m2,
|
||||
0);
|
||||
m2);
|
||||
|
||||
wsrep::view v3(wsrep::gtid(wsrep::id("cluster"), wsrep::seqno(1)),
|
||||
wsrep::seqno(1),
|
||||
@ -83,8 +80,7 @@ BOOST_AUTO_TEST_CASE(view_test_equal_membership)
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
m3,
|
||||
0);
|
||||
m3);
|
||||
|
||||
BOOST_REQUIRE(v1.equal_membership(v2));
|
||||
BOOST_REQUIRE(v2.equal_membership(v1));
|
||||
@ -101,8 +97,7 @@ BOOST_AUTO_TEST_CASE(view_test_is_member)
|
||||
1,
|
||||
0,
|
||||
{ wsrep::view::member(wsrep::id("1"), "", ""),
|
||||
wsrep::view::member(wsrep::id("2"), "", "") },
|
||||
0);
|
||||
wsrep::view::member(wsrep::id("2"), "", "") });
|
||||
|
||||
BOOST_REQUIRE(view.is_member(wsrep::id("2")));
|
||||
BOOST_REQUIRE(view.is_member(wsrep::id("1")));
|
||||
|
Reference in New Issue
Block a user