From 7d8583983f1f2648d1f4c27771f1dfd4a528ce98 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 40a0e33..15d5349 100644 --- a/include/wsrep/client_state.hpp +++ b/include/wsrep/client_state.hpp @@ -669,7 +669,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 @@ -749,7 +749,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 @@ -789,6 +789,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 48687d8..d971d0f 100644 --- a/src/client_state.cpp +++ b/src/client_state.cpp @@ -371,7 +371,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() && @@ -811,10 +811,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_); @@ -843,10 +841,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;