1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-02 05:22:26 +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

@ -357,8 +357,6 @@ namespace
const wsrep_trx_meta_t* meta,
wsrep_bool_t* exit_loop __attribute__((unused)))
{
wsrep_cb_status_t ret(WSREP_CB_SUCCESS);
wsrep::client_state* client_state(
reinterpret_cast<wsrep::client_state*>(ctx));
assert(client_state);
@ -375,13 +373,22 @@ namespace
meta->stid.trx,
meta->stid.conn), wsrep::seqno(seqno_from_native(meta->depends_on)),
map_flags_from_native(flags));
if (ret == WSREP_CB_SUCCESS &&
client_state->server_state().on_apply(
*client_state, ws_handle, ws_meta, data))
try
{
ret = WSREP_CB_FAILURE;
if (client_state->server_state().on_apply(
*client_state, ws_handle, ws_meta, data))
{
return WSREP_CB_FAILURE;
}
return WSREP_CB_SUCCESS;
}
catch (const wsrep::runtime_error& e)
{
wsrep::log_error() << "Caught runtime error while applying "
<< ws_meta.flags() << ": "
<< e.what();
return WSREP_CB_FAILURE;
}
return ret;
}
wsrep_cb_status_t synced_cb(void* app_ctx)