mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-28 20:02:00 +03:00
* Unit test for idle client BF abort.
* Fixes to seqno conversion between provider and provider library. * Server context applying side fixes.
This commit is contained in:
@ -210,6 +210,7 @@ namespace wsrep
|
||||
assert(state_ == s_exec);
|
||||
return transaction_.start_transaction();
|
||||
}
|
||||
|
||||
int start_transaction(const wsrep::transaction_id& id)
|
||||
{
|
||||
assert(state_ == s_exec);
|
||||
@ -265,12 +266,12 @@ namespace wsrep
|
||||
}
|
||||
int before_rollback()
|
||||
{
|
||||
assert(state_ == s_exec);
|
||||
assert(state_ == s_idle || state_ == s_exec || state_ == s_result);
|
||||
return transaction_.before_rollback();
|
||||
}
|
||||
int after_rollback()
|
||||
{
|
||||
assert(state_ == s_exec);
|
||||
assert(state_ == s_idle || state_ == s_exec || state_ == s_result);
|
||||
return transaction_.after_rollback();
|
||||
}
|
||||
|
||||
@ -319,6 +320,14 @@ namespace wsrep
|
||||
* \return Client mode.
|
||||
*/
|
||||
enum mode mode() const { return mode_; }
|
||||
/*!
|
||||
* Get Client state.
|
||||
*
|
||||
* \todo Enforce mutex protection if called from other threads.
|
||||
*
|
||||
* \return Client state
|
||||
*/
|
||||
enum state state() const { return state_; }
|
||||
|
||||
const wsrep::transaction_context& transaction() const
|
||||
{
|
||||
@ -369,20 +378,14 @@ namespace wsrep
|
||||
* Friend declarations
|
||||
*/
|
||||
friend int server_context::on_apply(client_context&,
|
||||
const wsrep::ws_handle&,
|
||||
const wsrep::ws_meta&,
|
||||
const wsrep::data&);
|
||||
friend class client_context_switch;
|
||||
friend class client_applier_mode;
|
||||
friend class client_toi_mode;
|
||||
friend class transaction_context;
|
||||
|
||||
/*!
|
||||
* Get Client state.
|
||||
*
|
||||
* \todo Enforce mutex protection if called from other threads.
|
||||
*
|
||||
* \return Client state
|
||||
*/
|
||||
enum state state() const { return state_; }
|
||||
|
||||
/*!
|
||||
* Set client state.
|
||||
|
@ -69,6 +69,7 @@ namespace wsrep
|
||||
{
|
||||
return &mutex_;
|
||||
}
|
||||
|
||||
private:
|
||||
pthread_mutex_t mutex_;
|
||||
};
|
||||
|
@ -295,7 +295,7 @@ namespace wsrep
|
||||
const wsrep::gtid& gtid,
|
||||
bool bypass) = 0;
|
||||
|
||||
|
||||
virtual void background_rollback(wsrep::client_context&) = 0;
|
||||
/*!
|
||||
*
|
||||
*/
|
||||
@ -333,6 +333,8 @@ namespace wsrep
|
||||
* \return Zero on success, non-zero on failure.
|
||||
*/
|
||||
int on_apply(wsrep::client_context& client_context,
|
||||
const wsrep::ws_handle& ws_handle,
|
||||
const wsrep::ws_meta& ws_meta,
|
||||
const wsrep::data& data);
|
||||
|
||||
/*!
|
||||
|
@ -83,6 +83,7 @@ namespace wsrep
|
||||
assert(ws_meta_.transaction_id() != transaction_id::invalid());
|
||||
return start_transaction(ws_meta_.transaction_id());
|
||||
}
|
||||
|
||||
int start_transaction(const wsrep::transaction_id& id);
|
||||
|
||||
int start_transaction(const wsrep::ws_handle& ws_handle,
|
||||
@ -121,8 +122,8 @@ namespace wsrep
|
||||
}
|
||||
|
||||
wsrep::mutex& mutex();
|
||||
|
||||
wsrep::ws_handle& ws_handle() { return ws_handle_; }
|
||||
const wsrep::ws_handle& ws_handle() const { return ws_handle_; }
|
||||
const wsrep::ws_meta& ws_meta() const { return ws_meta_; }
|
||||
private:
|
||||
transaction_context(const transaction_context&);
|
||||
|
Reference in New Issue
Block a user