1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-31 18:24:25 +03:00

Implemented SR transaction rollback.

This commit is contained in:
Teemu Ollakka
2018-07-10 14:01:41 +03:00
parent e916453e6d
commit 80ca03daaf
17 changed files with 362 additions and 91 deletions

View File

@ -35,11 +35,12 @@ int wsrep::mock_high_priority_service::apply_write_set(
return (fail_next_applying_ ? 1 : 0);
}
int wsrep::mock_high_priority_service::commit(const wsrep::ws_handle&,
const wsrep::ws_meta&)
int wsrep::mock_high_priority_service::commit(
const wsrep::ws_handle& ws_handle,
const wsrep::ws_meta& ws_meta)
{
int ret(0);
client_state_->prepare_for_ordering(ws_handle, ws_meta, true);
if (client_state_->client_service().do_2pc())
{
ret = client_state_->before_prepare() ||

View File

@ -31,6 +31,8 @@ namespace wsrep
int start_transaction(const wsrep::ws_handle&, const wsrep::ws_meta&)
WSREP_OVERRIDE;
const wsrep::transaction& transaction() const
{ return client_state_->transaction(); }
void adopt_transaction(const wsrep::transaction&) WSREP_OVERRIDE;
int apply_write_set(const wsrep::ws_meta&,
const wsrep::const_buffer&) WSREP_OVERRIDE;

View File

@ -131,11 +131,11 @@ namespace wsrep
enum wsrep::provider::status
append_data(wsrep::ws_handle&, const wsrep::const_buffer&)
{ return wsrep::provider::success; }
int rollback(const wsrep::transaction_id)
enum wsrep::provider::status rollback(const wsrep::transaction_id)
{
++fragments_;
++rollback_fragments_;
return 0;
return wsrep::provider::success;
}
enum wsrep::provider::status
commit_order_enter(const wsrep::ws_handle& ws_handle,