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

TOI replicating and applying codepaths

This commit is contained in:
Teemu Ollakka
2018-06-25 09:28:51 +03:00
parent 6a369a5d0e
commit cad9176474
11 changed files with 324 additions and 169 deletions

View File

@ -6,15 +6,23 @@
#include "mock_client_state.hpp"
int wsrep::mock_client_service::apply(
int wsrep::mock_client_service::apply_write_set(
const wsrep::const_buffer&)
{
assert(client_state_.toi_meta().seqno().is_undefined());
assert(client_state_.transaction().state() == wsrep::transaction::s_executing ||
client_state_.transaction().state() == wsrep::transaction::s_replaying);
return (fail_next_applying_ ? 1 : 0);
}
int wsrep::mock_client_service::apply_toi(const wsrep::const_buffer&)
{
assert(client_state_.transaction().active() == false);
assert(client_state_.toi_meta().seqno().is_undefined() == false);
return (fail_next_toi_ ? 1 : 0);
}
int wsrep::mock_client_service::commit(
const wsrep::ws_handle&, const wsrep::ws_meta&)
{

View File

@ -47,6 +47,7 @@ namespace wsrep
, is_autocommit_()
, do_2pc_()
, fail_next_applying_()
, fail_next_toi_()
, bf_abort_during_wait_()
, error_during_prepare_data_()
, killed_before_certify_()
@ -58,7 +59,9 @@ namespace wsrep
, aborts_()
{ }
int apply(const wsrep::const_buffer&) WSREP_OVERRIDE;
int apply_write_set(const wsrep::const_buffer&) WSREP_OVERRIDE;
int apply_toi(const wsrep::const_buffer&) WSREP_OVERRIDE;
int commit(const wsrep::ws_handle&, const wsrep::ws_meta&)
WSREP_OVERRIDE;
@ -169,6 +172,7 @@ namespace wsrep
bool is_autocommit_;
bool do_2pc_;
bool fail_next_applying_;
bool fail_next_toi_;
bool bf_abort_during_wait_;
bool error_during_prepare_data_;
bool killed_before_certify_;