From 750052b64053dcc4692502239820669029c72d0c Mon Sep 17 00:00:00 2001 From: Teemu Ollakka Date: Fri, 6 Sep 2019 17:03:27 +0300 Subject: [PATCH] Fixed timeout condition in poll_enter_toi() --- src/client_state.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/client_state.cpp b/src/client_state.cpp index f59b41c..ad22d34 100644 --- a/src/client_state.cpp +++ b/src/client_state.cpp @@ -339,6 +339,12 @@ wsrep::client_state::poll_enter_toi( int flags, std::chrono::time_point wait_until) { + WSREP_LOG_DEBUG(debug_log_level(), + wsrep::log::debug_level_client_state, + "poll_enter_toi: " + << flags + << "," + << wait_until.time_since_epoch().count()); enum wsrep::provider::status status; do { @@ -366,8 +372,9 @@ wsrep::client_state::poll_enter_toi( } while (status == wsrep::provider::error_certification_failed && wait_until.time_since_epoch().count() && - wait_until < wsrep::clock::now() && + wsrep::clock::now() < wait_until && not client_service_.interrupted(lock)); + /** @todo should report timeout error if wait times out */ return status; } @@ -405,7 +412,7 @@ int wsrep::client_state::enter_toi_local(const wsrep::key_array& keys, } default: override_error(wsrep::e_error_during_commit, - wsrep::provider::error_certification_failed); + status); ret = 1; break; } @@ -723,6 +730,7 @@ void wsrep::client_state::debug_log_state(const char* context) const << "," << to_c_string(state_) << "," << to_c_string(mode_) << "," << wsrep::to_string(current_error_) + << "," << current_error_status_ << ",toi: " << toi_meta_.seqno() << ",nbo: " << nbo_meta_.seqno() << ")"); }