From fb2b8d3e5120bf5126e53c2705c0972b0a09491a Mon Sep 17 00:00:00 2001 From: Teemu Ollakka Date: Thu, 19 Sep 2019 14:08:27 +0300 Subject: [PATCH] Fixes to review comments - Increased loop sleep in poll_enter_toi() - Fixed typos in comments - Got rid of unnecessary ostringstreams --- include/wsrep/client_state.hpp | 9 +++++++-- src/client_state.cpp | 14 +++++--------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/include/wsrep/client_state.hpp b/include/wsrep/client_state.hpp index dd9259c..eb97a1d 100644 --- a/include/wsrep/client_state.hpp +++ b/include/wsrep/client_state.hpp @@ -573,7 +573,7 @@ namespace wsrep * Enter total order isolation critical section. If the wait_until * is given non-default value, the operation is retried until * successful, the given time point is reached or the client is - * interupted. + * interrupted. * * @param key_array Array of keys * @param buffer Buffer containing the action to execute inside @@ -653,7 +653,7 @@ namespace wsrep * * If the wait_until is given non-default value, the operation is * retried until successful, the given time point is reached or the - * client is interupted. + * client is interrupted. * * @param keys Array of keys for NBO operation. * @param buffer NBO write set @@ -693,6 +693,11 @@ namespace wsrep * passed to this call must contain the same keys which were * passed to begin_nbo_phase_one(). * + * + * If the wait_until is given non-default value, the operation is + * retried until successful, the given time point is reached or the + * client is interrupted. + * * @param keys Key array. * @param wait_until Time point to wait until for entering TOI for * phase two. diff --git a/src/client_state.cpp b/src/client_state.cpp index f659e95..444c035 100644 --- a/src/client_state.cpp +++ b/src/client_state.cpp @@ -370,7 +370,7 @@ wsrep::client_state::poll_enter_toi( if (status == wsrep::provider::error_certification_failed || status == wsrep::provider::error_connection_failed) { - ::usleep(100000); + ::usleep(300000); } lock.lock(); timed_out = !(wait_until.time_since_epoch().count() && @@ -810,10 +810,8 @@ void wsrep::client_state::state( }; if (!allowed[state_][state]) { - std::ostringstream os; - os << "client_state: Unallowed state transition: " - << state_ << " -> " << state; - wsrep::log_warning() << os.str(); + wsrep::log_warning() << "client_state: Unallowed state transition: " + << state_ << " -> " << state; assert(0); } state_hist_.push_back(state_); @@ -842,10 +840,8 @@ void wsrep::client_state::mode( }; if (!allowed[mode_][mode]) { - std::ostringstream os; - os << "client_state: Unallowed mode transition: " - << mode_ << " -> " << mode; - wsrep::log_warning() << os.str(); + wsrep::log_warning() << "client_state: Unallowed mode transition: " + << mode_ << " -> " << mode; assert(0); } mode_ = mode;