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

codership/wsrep-lib#100 Support for assign_read_view() wsrep API call

Marshall the call from the `client_state` interface down to provider.
This commit is contained in:
Alexey Yurchenko
2019-04-30 21:31:30 +03:00
parent e9dafb7373
commit 4285ff99ea
9 changed files with 67 additions and 3 deletions

View File

@ -270,6 +270,25 @@ namespace wsrep
return transaction_.start_transaction(id);
}
/**
* Establish read view ID of the transaction.
*
* This method should be preferably called immediately before any
* first read or write operation in the transaction is performed,
* Then it can be called with default NULL parameter and will use
* the current last committed GTID.
* Alternatively it can be called at any time before commit with an
* explicit GTID that corresponds to transaction read view.
*
* @param gtid optional explicit GTID of the transaction read view.
*/
int assign_read_view(const wsrep::gtid* const gtid = NULL)
{
assert(mode_ == m_local);
assert(state_ == s_exec);
return transaction_.assign_read_view(gtid);
}
/**
* Append a key into transaction write set.
*/

View File

@ -274,6 +274,8 @@ namespace wsrep
// Write set replication
// TODO: Rename to assing_read_view()
virtual int start_transaction(wsrep::ws_handle&) = 0;
virtual enum status assign_read_view(
wsrep::ws_handle&, const wsrep::gtid*) = 0;
virtual int append_key(wsrep::ws_handle&, const wsrep::key&) = 0;
virtual enum status append_data(
wsrep::ws_handle&, const wsrep::const_buffer&) = 0;

View File

@ -138,6 +138,8 @@ namespace wsrep
const wsrep::ws_meta& ws_meta,
bool is_commit);
int assign_read_view(const wsrep::gtid* gtid);
int append_key(const wsrep::key&);
int append_data(const wsrep::const_buffer&);