mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-28 20:02:00 +03:00
codership/wsrep-lib#52 Removed client_service do_2pc()
This commit is contained in:
@ -27,11 +27,6 @@ db::client_service::client_service(db::client& client)
|
|||||||
, client_state_(client_.client_state())
|
, client_state_(client_.client_state())
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
bool db::client_service::do_2pc() const
|
|
||||||
{
|
|
||||||
return client_.do_2pc();
|
|
||||||
}
|
|
||||||
|
|
||||||
int db::client_service::bf_rollback()
|
int db::client_service::bf_rollback()
|
||||||
{
|
{
|
||||||
int ret(client_state_.before_rollback());
|
int ret(client_state_.before_rollback());
|
||||||
|
@ -33,7 +33,6 @@ namespace db
|
|||||||
public:
|
public:
|
||||||
client_service(db::client& client);
|
client_service(db::client& client);
|
||||||
|
|
||||||
bool do_2pc() const override;
|
|
||||||
bool interrupted() const override { return false; }
|
bool interrupted() const override { return false; }
|
||||||
void reset_globals() override { }
|
void reset_globals() override { }
|
||||||
void store_globals() override { }
|
void store_globals() override { }
|
||||||
|
@ -40,15 +40,6 @@ namespace wsrep
|
|||||||
public:
|
public:
|
||||||
client_service() { }
|
client_service() { }
|
||||||
virtual ~client_service() { }
|
virtual ~client_service() { }
|
||||||
/**
|
|
||||||
* Return true if two pahase commit is required for transaction
|
|
||||||
* to commit.
|
|
||||||
*
|
|
||||||
* @todo This interface method should be deprecated, 1pc vs 2pc
|
|
||||||
* will be deduced from transaction states in
|
|
||||||
* transaction::before_commit() call.
|
|
||||||
*/
|
|
||||||
virtual bool do_2pc() const = 0;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return true if the current transaction has been interrupted
|
* Return true if the current transaction has been interrupted
|
||||||
|
@ -374,7 +374,6 @@ int wsrep::transaction::before_commit()
|
|||||||
case wsrep::client_state::m_local:
|
case wsrep::client_state::m_local:
|
||||||
if (state() == s_executing)
|
if (state() == s_executing)
|
||||||
{
|
{
|
||||||
assert(client_service_.do_2pc() == false);
|
|
||||||
ret = before_prepare(lock) || after_prepare(lock);
|
ret = before_prepare(lock) || after_prepare(lock);
|
||||||
assert((ret == 0 && state() == s_committing)
|
assert((ret == 0 && state() == s_committing)
|
||||||
||
|
||
|
||||||
|
@ -77,9 +77,6 @@ namespace wsrep
|
|||||||
|
|
||||||
int bf_rollback() WSREP_OVERRIDE;
|
int bf_rollback() WSREP_OVERRIDE;
|
||||||
|
|
||||||
bool do_2pc() const WSREP_OVERRIDE
|
|
||||||
{ return do_2pc_; }
|
|
||||||
|
|
||||||
bool interrupted() const WSREP_OVERRIDE
|
bool interrupted() const WSREP_OVERRIDE
|
||||||
{ return killed_before_certify_; }
|
{ return killed_before_certify_; }
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ int wsrep::mock_high_priority_service::commit(
|
|||||||
{
|
{
|
||||||
int ret(0);
|
int ret(0);
|
||||||
client_state_->prepare_for_ordering(ws_handle, ws_meta, true);
|
client_state_->prepare_for_ordering(ws_handle, ws_meta, true);
|
||||||
if (client_state_->client_service().do_2pc())
|
if (do_2pc_)
|
||||||
{
|
{
|
||||||
ret = client_state_->before_prepare() ||
|
ret = client_state_->before_prepare() ||
|
||||||
client_state_->after_prepare();
|
client_state_->after_prepare();
|
||||||
|
@ -33,6 +33,7 @@ namespace wsrep
|
|||||||
wsrep::mock_client_state* client_state,
|
wsrep::mock_client_state* client_state,
|
||||||
bool replaying)
|
bool replaying)
|
||||||
: wsrep::high_priority_service(server_state)
|
: wsrep::high_priority_service(server_state)
|
||||||
|
, do_2pc_()
|
||||||
, fail_next_applying_()
|
, fail_next_applying_()
|
||||||
, fail_next_toi_()
|
, fail_next_toi_()
|
||||||
, client_state_(client_state)
|
, client_state_(client_state)
|
||||||
@ -74,6 +75,7 @@ namespace wsrep
|
|||||||
{
|
{
|
||||||
return client_state_;
|
return client_state_;
|
||||||
}
|
}
|
||||||
|
bool do_2pc_;
|
||||||
bool fail_next_applying_;
|
bool fail_next_applying_;
|
||||||
bool fail_next_toi_;
|
bool fail_next_toi_;
|
||||||
private:
|
private:
|
||||||
|
@ -226,6 +226,7 @@ BOOST_FIXTURE_TEST_CASE(server_state_applying_1pc,
|
|||||||
BOOST_FIXTURE_TEST_CASE(server_state_applying_2pc,
|
BOOST_FIXTURE_TEST_CASE(server_state_applying_2pc,
|
||||||
applying_server_fixture)
|
applying_server_fixture)
|
||||||
{
|
{
|
||||||
|
hps.do_2pc_ = true;
|
||||||
char buf[1] = { 1 };
|
char buf[1] = { 1 };
|
||||||
BOOST_REQUIRE(ss.on_apply(hps, ws_handle, ws_meta,
|
BOOST_REQUIRE(ss.on_apply(hps, ws_handle, ws_meta,
|
||||||
wsrep::const_buffer(buf, 1)) == 0);
|
wsrep::const_buffer(buf, 1)) == 0);
|
||||||
@ -251,6 +252,7 @@ BOOST_FIXTURE_TEST_CASE(server_state_applying_1pc_rollback,
|
|||||||
BOOST_FIXTURE_TEST_CASE(server_state_applying_2pc_rollback,
|
BOOST_FIXTURE_TEST_CASE(server_state_applying_2pc_rollback,
|
||||||
applying_server_fixture)
|
applying_server_fixture)
|
||||||
{
|
{
|
||||||
|
hps.do_2pc_ = true;
|
||||||
hps.fail_next_applying_ = true;
|
hps.fail_next_applying_ = true;
|
||||||
char buf[1] = { 1 };
|
char buf[1] = { 1 };
|
||||||
BOOST_REQUIRE(ss.on_apply(hps, ws_handle, ws_meta,
|
BOOST_REQUIRE(ss.on_apply(hps, ws_handle, ws_meta,
|
||||||
|
Reference in New Issue
Block a user