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

Initial support for XA

Force fragment replication when XA transaction is prepared, with
prepare fragment. Commit fragment happens in before_commit().
Adjusted fragment removal, which cannot happen in atomically with the
executing transaction.
This commit is contained in:
Daniele Sciascia
2019-02-04 08:45:00 +01:00
parent 5c27d6dafa
commit 9c9323e2a5
4 changed files with 122 additions and 26 deletions

View File

@ -177,11 +177,20 @@ static int commit_fragment(wsrep::server_state& server_state,
{
assert(err.size() == 0);
}
streaming_applier->debug_crash(
"crash_apply_cb_before_fragment_removal");
ret = ret || streaming_applier->remove_fragments(ws_meta);
streaming_applier->debug_crash(
"crash_apply_cb_after_fragment_removal");
const wsrep::transaction& trx(streaming_applier->transaction());
// Fragment removal for XA is going to happen in after_commit
if (!trx.is_xa())
{
streaming_applier->debug_crash(
"crash_apply_cb_before_fragment_removal");
ret = ret || streaming_applier->remove_fragments(ws_meta);
streaming_applier->debug_crash(
"crash_apply_cb_after_fragment_removal");
}
streaming_applier->debug_crash(
"crash_commit_cb_before_last_fragment_commit");
ret = ret || streaming_applier->commit(ws_handle, ws_meta);
@ -427,7 +436,7 @@ static int apply_write_set(wsrep::server_state& server_state,
}
if (ret)
{
wsrep::log_info() << "Failed to apply write set: " << ws_meta;
wsrep::log_error() << "Failed to apply write set: " << ws_meta;
}
return ret;
}