1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-06-14 15:02:27 +03:00

Refs codership/wsrep-API#21 added support for the IMPLICIT_DEPS WS flag

This commit is contained in:
Alexey Yurchenko
2018-11-22 17:16:28 +02:00
committed by Daniele Sciascia
parent 8ffad51822
commit fd07ff12e4
6 changed files with 28 additions and 3 deletions

View File

@ -219,6 +219,7 @@ namespace wsrep
static const int native = (1 << 6); static const int native = (1 << 6);
static const int prepare = (1 << 7); static const int prepare = (1 << 7);
static const int snapshot = (1 << 8); static const int snapshot = (1 << 8);
static const int implicit_deps = (1 << 9);
}; };
/** /**

View File

@ -109,6 +109,9 @@ namespace wsrep
bool pa_unsafe() const { return pa_unsafe_; } bool pa_unsafe() const { return pa_unsafe_; }
void pa_unsafe(bool pa_unsafe) { pa_unsafe_ = pa_unsafe; } void pa_unsafe(bool pa_unsafe) { pa_unsafe_ = pa_unsafe; }
bool implicit_deps() const { return implicit_deps_; }
void implicit_deps(bool implicit) { implicit_deps_ = implicit; }
int start_transaction(const wsrep::transaction_id& id); int start_transaction(const wsrep::transaction_id& id);
int start_transaction(const wsrep::ws_handle& ws_handle, int start_transaction(const wsrep::ws_handle& ws_handle,
@ -204,6 +207,7 @@ namespace wsrep
wsrep::ws_meta ws_meta_; wsrep::ws_meta ws_meta_;
int flags_; int flags_;
bool pa_unsafe_; bool pa_unsafe_;
bool implicit_deps_;
bool certified_; bool certified_;
wsrep::streaming_context streaming_context_; wsrep::streaming_context streaming_context_;
wsrep::sr_key_set sr_keys_; wsrep::sr_key_set sr_keys_;

View File

@ -108,6 +108,8 @@ std::string wsrep::flags_to_string(int flags)
oss << "prepare | "; oss << "prepare | ";
if (flags & provider::flag::snapshot) if (flags & provider::flag::snapshot)
oss << "snapshot | "; oss << "snapshot | ";
if (flags & provider::flag::implicit_deps)
oss << "implicit_deps | ";
std::string ret(oss.str()); std::string ret(oss.str());
if (ret.size() > 3) ret.erase(ret.size() - 3); if (ret.size() > 3) ret.erase(ret.size() - 3);

View File

@ -110,6 +110,7 @@ wsrep::transaction::transaction(
, ws_meta_() , ws_meta_()
, flags_() , flags_()
, pa_unsafe_(false) , pa_unsafe_(false)
, implicit_deps_(false)
, certified_(false) , certified_(false)
, streaming_context_() , streaming_context_()
, sr_keys_() , sr_keys_()
@ -1061,6 +1062,11 @@ int wsrep::transaction::certify_fragment(
client_state_.server_state_.start_streaming_client(&client_state_); client_state_.server_state_.start_streaming_client(&client_state_);
} }
if (implicit_deps())
{
flags(flags() | wsrep::provider::flag::implicit_deps);
}
int ret(0); int ret(0);
enum wsrep::client_error error(wsrep::e_success); enum wsrep::client_error error(wsrep::e_success);
enum wsrep::provider::status cert_ret(wsrep::provider::success); enum wsrep::provider::status cert_ret(wsrep::provider::success);
@ -1241,6 +1247,11 @@ int wsrep::transaction::certify_commit(
flags(flags() | wsrep::provider::flag::pa_unsafe); flags(flags() | wsrep::provider::flag::pa_unsafe);
} }
if (implicit_deps())
{
flags(flags() | wsrep::provider::flag::implicit_deps);
}
flags(flags() | wsrep::provider::flag::commit); flags(flags() | wsrep::provider::flag::commit);
if (client_service_.prepare_data_for_replication()) if (client_service_.prepare_data_for_replication())
@ -1472,6 +1483,7 @@ void wsrep::transaction::cleanup()
flags_ = 0; flags_ = 0;
certified_ = false; certified_ = false;
pa_unsafe_ = false; pa_unsafe_ = false;
implicit_deps_ = false;
sr_keys_.clear(); sr_keys_.clear();
streaming_context_.cleanup(); streaming_context_.cleanup();
client_service_.cleanup_transaction(); client_service_.cleanup_transaction();

View File

@ -125,7 +125,10 @@ namespace
WSREP_FLAG_TRX_PREPARE) | WSREP_FLAG_TRX_PREPARE) |
map_one(flags, map_one(flags,
provider::flag::snapshot, provider::flag::snapshot,
WSREP_FLAG_SNAPSHOT)); WSREP_FLAG_SNAPSHOT) |
map_one(flags,
provider::flag::implicit_deps,
WSREP_FLAG_IMPLICIT_DEPS));
} }
int map_flags_from_native(uint32_t flags) int map_flags_from_native(uint32_t flags)
@ -153,7 +156,10 @@ namespace
provider::flag::prepare) | provider::flag::prepare) |
map_one(flags, map_one(flags,
WSREP_FLAG_SNAPSHOT, WSREP_FLAG_SNAPSHOT,
provider::flag::snapshot)); provider::flag::snapshot) |
map_one(flags,
WSREP_FLAG_IMPLICIT_DEPS,
provider::flag::implicit_deps));
} }
class mutable_ws_handle class mutable_ws_handle