mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-28 20:02:00 +03:00
Provider write set handle and meta data for high priority commit
The write set handle and meta data are needed for SR transactions where the commit context is not known when the transaction starts. The passed handle and meta data can be set through client_state prepare_for_ordering() call before performing commit.
This commit is contained in:
@ -313,13 +313,20 @@ namespace wsrep
|
||||
void disable_streaming();
|
||||
|
||||
/**
|
||||
* Prepare write set meta data for fragment storage ordering.
|
||||
* This method should be called from storage service commit
|
||||
* or rollback before performing the operation.
|
||||
* Prepare write set meta data for ordering.
|
||||
* This method should be called before ordered commit or
|
||||
* rollback if the commit time meta data was not known
|
||||
* at the time of the start of the transaction.
|
||||
* This mostly applies to streaming replication.
|
||||
*
|
||||
* @param ws_handle Write set handle
|
||||
* @param ws_meta Write set meta data
|
||||
* @param is_commit Boolean to denote whether the operation
|
||||
* is commit or rollback.
|
||||
*/
|
||||
int prepare_for_fragment_ordering(const wsrep::ws_handle& ws_handle,
|
||||
const wsrep::ws_meta& ws_meta,
|
||||
bool is_commit)
|
||||
int prepare_for_ordering(const wsrep::ws_handle& ws_handle,
|
||||
const wsrep::ws_meta& ws_meta,
|
||||
bool is_commit)
|
||||
{
|
||||
assert(state_ == s_exec);
|
||||
return transaction_.prepare_for_fragment_ordering(
|
||||
|
@ -59,7 +59,7 @@ namespace wsrep
|
||||
/**
|
||||
* Commit a transaction.
|
||||
*/
|
||||
virtual int commit() = 0;
|
||||
virtual int commit(const wsrep::ws_handle&, const wsrep::ws_meta&) = 0;
|
||||
|
||||
/**
|
||||
* Roll back a transaction
|
||||
@ -98,7 +98,18 @@ namespace wsrep
|
||||
virtual void switch_execution_context(
|
||||
wsrep::high_priority_service& orig_hps) = 0;
|
||||
|
||||
virtual int log_dummy_write_set(const ws_handle&, const ws_meta&) = 0;
|
||||
/**
|
||||
* Log a dummy write set which is either SR transaction fragment
|
||||
* or roll back fragment. The implementation must release
|
||||
* commit order inside the call.
|
||||
*
|
||||
* @params ws_handle Write set handle
|
||||
* @params ws_meta Write set meta data
|
||||
*
|
||||
* @return Zero in case of success, non-zero on failure
|
||||
*/
|
||||
virtual int log_dummy_write_set(const ws_handle& ws_handle,
|
||||
const ws_meta& ws_meta) = 0;
|
||||
|
||||
virtual bool is_replaying() const = 0;
|
||||
|
||||
|
Reference in New Issue
Block a user