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

Fixes to local streaming replication processing.

This commit is contained in:
Teemu Ollakka
2018-07-08 15:27:49 +03:00
parent 2913aecebd
commit 7c424d8337
12 changed files with 122 additions and 75 deletions

View File

@ -28,29 +28,30 @@ wsrep::mock_storage_service::~mock_storage_service()
client_state_.cleanup();
}
int wsrep::mock_storage_service::start_transaction()
int wsrep::mock_storage_service::start_transaction(const wsrep::ws_handle& ws_handle)
{
return client_state_.start_transaction(
server_state_.next_transaction_id());
return client_state_.start_transaction(ws_handle.transaction_id());
}
int wsrep::mock_storage_service::commit(const wsrep::ws_handle& ws_handle,
const wsrep::ws_meta& ws_meta)
{
return client_state_.prepare_for_fragment_ordering(
ws_handle, ws_meta, true) ||
client_state_.before_commit() ||
client_state_.ordered_commit() ||
client_state_.after_commit() ||
client_state_.after_statement();
int ret(client_state_.prepare_for_fragment_ordering(
ws_handle, ws_meta, true) ||
client_state_.before_commit() ||
client_state_.ordered_commit() ||
client_state_.after_commit());
client_state_.after_applying();
return ret;
}
int wsrep::mock_storage_service::rollback(const wsrep::ws_handle& ws_handle,
const wsrep::ws_meta& ws_meta)
{
return client_state_.prepare_for_fragment_ordering(
ws_handle, ws_meta, false) ||
client_state_.before_rollback() ||
client_state_.after_rollback() ||
client_state_.after_statement();
int ret(client_state_.prepare_for_fragment_ordering(
ws_handle, ws_meta, false) ||
client_state_.before_rollback() ||
client_state_.after_rollback());
client_state_.after_applying();
return ret;
}