mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-30 07:23:07 +03:00
Introduced adopt_transaction() for storage_service interface
A SR transaction must be adopted by a storage service instance running in background rollbacker thread while it is aborting a SR transaction.
This commit is contained in:
@ -45,6 +45,12 @@ namespace wsrep
|
||||
wsrep::client_id(++last_client_id_));
|
||||
}
|
||||
|
||||
wsrep::storage_service* storage_service(wsrep::high_priority_service&)
|
||||
{
|
||||
return new wsrep::mock_storage_service(*this,
|
||||
wsrep::client_id(++last_client_id_));
|
||||
}
|
||||
|
||||
void release_storage_service(wsrep::storage_service* storage_service)
|
||||
{
|
||||
delete storage_service;
|
||||
|
@ -28,11 +28,18 @@ wsrep::mock_storage_service::~mock_storage_service()
|
||||
client_state_.cleanup();
|
||||
}
|
||||
|
||||
int wsrep::mock_storage_service::start_transaction(const wsrep::ws_handle& ws_handle)
|
||||
int wsrep::mock_storage_service::start_transaction(
|
||||
const wsrep::ws_handle& ws_handle)
|
||||
{
|
||||
return client_state_.start_transaction(ws_handle.transaction_id());
|
||||
}
|
||||
|
||||
void wsrep::mock_storage_service::adopt_transaction(
|
||||
const wsrep::transaction& transaction)
|
||||
{
|
||||
client_state_.adopt_transaction(transaction);
|
||||
}
|
||||
|
||||
int wsrep::mock_storage_service::commit(const wsrep::ws_handle& ws_handle,
|
||||
const wsrep::ws_meta& ws_meta)
|
||||
{
|
||||
|
@ -20,6 +20,8 @@ class mock_server_state;
|
||||
|
||||
int start_transaction(const wsrep::ws_handle&) WSREP_OVERRIDE;
|
||||
|
||||
void adopt_transaction(const wsrep::transaction&) WSREP_OVERRIDE;
|
||||
|
||||
int append_fragment(const wsrep::id&,
|
||||
wsrep::transaction_id,
|
||||
int,
|
||||
|
Reference in New Issue
Block a user