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

allowing application to set transaction as PA unsafe

* Removed transaction::p_unsafe_ member
* Changed transaction::pa_unsafe(bool) to modify flags member directly
* Modified transaction.cpp to use transaction.pa_unsafe(bool) rather than
  directly changing transaction's flag
* added method mark_transaction_pa_unsafe() for client_state,
  application will use this
This commit is contained in:
sjaakola
2021-05-14 14:56:02 +03:00
parent f271ad0c6e
commit 608ee82b26
3 changed files with 27 additions and 9 deletions

View File

@ -927,6 +927,22 @@ namespace wsrep
return transaction_;
}
/**
* Mark the transaction associated with the client state
* (if any), as unsafe for parallel applying
*
* @return Zero on success, non-zero on error.
*/
int mark_transaction_pa_unsafe()
{
if (transaction_.active())
{
transaction_.pa_unsafe(true);
return 0;
}
return 1;
}
const wsrep::ws_meta& toi_meta() const
{
return toi_meta_;

View File

@ -143,9 +143,14 @@ namespace wsrep
int xa_replay(wsrep::unique_lock<wsrep::mutex>&);
bool pa_unsafe() const { return pa_unsafe_; }
void pa_unsafe(bool pa_unsafe) { pa_unsafe_ = pa_unsafe; }
bool pa_unsafe() const { return (flags() & wsrep::provider::flag::pa_unsafe); }
void pa_unsafe(bool pa_unsafe) {
if (pa_unsafe) {
flags(flags() | wsrep::provider::flag::pa_unsafe);
} else {
flags(flags() & ~wsrep::provider::flag::pa_unsafe);
}
}
bool implicit_deps() const { return implicit_deps_; }
void implicit_deps(bool implicit) { implicit_deps_ = implicit; }
@ -265,7 +270,6 @@ namespace wsrep
wsrep::ws_handle ws_handle_;
wsrep::ws_meta ws_meta_;
int flags_;
bool pa_unsafe_;
bool implicit_deps_;
bool certified_;
size_t fragments_certified_for_statement_;