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

Pass certification keys also for NBO end.

Certification keys are needed for NBO end to resolve dependencies
for the write sets which follow NBO end. Without keys the following
write sets do not detect dependency to NBO event and may start applying
too early.
This commit is contained in:
Teemu Ollakka
2019-09-06 11:57:56 +03:00
parent 58cea10577
commit 3a1b194741
5 changed files with 34 additions and 5 deletions

View File

@ -512,6 +512,7 @@ int wsrep::client_state::begin_nbo_phase_one(
std::chrono::time_point<wsrep::clock> wait_until)
{
debug_log_state("begin_nbo_phase_one: enter");
debug_log_keys(keys);
wsrep::unique_lock<wsrep::mutex> lock(mutex_);
assert(state_ == s_exec);
assert(mode_ == m_local);
@ -583,9 +584,10 @@ int wsrep::client_state::enter_nbo_mode(const wsrep::ws_meta& ws_meta)
return 0;
}
int wsrep::client_state::begin_nbo_phase_two()
int wsrep::client_state::begin_nbo_phase_two(const wsrep::key_array& keys)
{
debug_log_state("begin_nbo_phase_two: enter");
debug_log_keys(keys);
assert(state_ == s_exec);
assert(mode_ == m_nbo);
assert(toi_mode_ == m_undefined);
@ -597,7 +599,7 @@ int wsrep::client_state::begin_nbo_phase_two()
// Output stored in nbo_meta_ is copied to toi_meta_ for
// phase two end.
enum wsrep::provider::status status(
provider().enter_toi(id_, wsrep::key_array(),
provider().enter_toi(id_, keys,
wsrep::const_buffer(), nbo_meta_,
wsrep::provider::flag::commit));
int ret;
@ -725,6 +727,18 @@ void wsrep::client_state::debug_log_state(const char* context) const
<< ",nbo: " << nbo_meta_.seqno() << ")");
}
void wsrep::client_state::debug_log_keys(const wsrep::key_array& keys) const
{
for (const auto& k : keys)
{
WSREP_LOG_DEBUG(debug_log_level(),
wsrep::log::debug_level_client_state,
"TOI keys: "
<< " id: " << id_
<< "key: " << k);
}
}
void wsrep::client_state::state(
wsrep::unique_lock<wsrep::mutex>& lock WSREP_UNUSED,
enum wsrep::client_state::state state)

View File

@ -1790,7 +1790,7 @@ void wsrep::transaction::debug_log_state(
<< "");
}
void wsrep::transaction::debug_log_key_append(const wsrep::key& key)
void wsrep::transaction::debug_log_key_append(const wsrep::key& key) const
{
WSREP_LOG_DEBUG(client_state_.debug_log_level(),
wsrep::log::debug_level_transaction,