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

Fixes to review comments

- Increased loop sleep in poll_enter_toi()
- Fixed typos in comments
- Got rid of unnecessary ostringstreams
This commit is contained in:
Teemu Ollakka
2019-09-19 14:08:27 +03:00
parent 3fd20c4e4d
commit 7d8583983f
2 changed files with 12 additions and 11 deletions

View File

@ -669,7 +669,7 @@ namespace wsrep
* Enter total order isolation critical section. If the wait_until * Enter total order isolation critical section. If the wait_until
* is given non-default value, the operation is retried until * is given non-default value, the operation is retried until
* successful, the given time point is reached or the client is * successful, the given time point is reached or the client is
* interupted. * interrupted.
* *
* @param key_array Array of keys * @param key_array Array of keys
* @param buffer Buffer containing the action to execute inside * @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 * If the wait_until is given non-default value, the operation is
* retried until successful, the given time point is reached or the * 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 keys Array of keys for NBO operation.
* @param buffer NBO write set * @param buffer NBO write set
@ -789,6 +789,11 @@ namespace wsrep
* passed to this call must contain the same keys which were * passed to this call must contain the same keys which were
* passed to begin_nbo_phase_one(). * 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 keys Key array.
* @param wait_until Time point to wait until for entering TOI for * @param wait_until Time point to wait until for entering TOI for
* phase two. * phase two.

View File

@ -371,7 +371,7 @@ wsrep::client_state::poll_enter_toi(
if (status == wsrep::provider::error_certification_failed || if (status == wsrep::provider::error_certification_failed ||
status == wsrep::provider::error_connection_failed) status == wsrep::provider::error_connection_failed)
{ {
::usleep(100000); ::usleep(300000);
} }
lock.lock(); lock.lock();
timed_out = !(wait_until.time_since_epoch().count() && timed_out = !(wait_until.time_since_epoch().count() &&
@ -811,10 +811,8 @@ void wsrep::client_state::state(
}; };
if (!allowed[state_][state]) if (!allowed[state_][state])
{ {
std::ostringstream os; wsrep::log_warning() << "client_state: Unallowed state transition: "
os << "client_state: Unallowed state transition: "
<< state_ << " -> " << state; << state_ << " -> " << state;
wsrep::log_warning() << os.str();
assert(0); assert(0);
} }
state_hist_.push_back(state_); state_hist_.push_back(state_);
@ -843,10 +841,8 @@ void wsrep::client_state::mode(
}; };
if (!allowed[mode_][mode]) if (!allowed[mode_][mode])
{ {
std::ostringstream os; wsrep::log_warning() << "client_state: Unallowed mode transition: "
os << "client_state: Unallowed mode transition: "
<< mode_ << " -> " << mode; << mode_ << " -> " << mode;
wsrep::log_warning() << os.str();
assert(0); assert(0);
} }
mode_ = mode; mode_ = mode;