diff --git a/arangod/Agency/AgencyFeature.cpp b/arangod/Agency/AgencyFeature.cpp index 16d0d80754..7e35156827 100644 --- a/arangod/Agency/AgencyFeature.cpp +++ b/arangod/Agency/AgencyFeature.cpp @@ -39,8 +39,8 @@ AgencyFeature::AgencyFeature(application_features::ApplicationServer* server) : ApplicationFeature(server, "Agency"), _size(1), _agentId(0), - _minElectionTimeout(0.15), - _maxElectionTimeout(2.0), + _minElectionTimeout(0.25), + _maxElectionTimeout(2.5), _notify(false), _supervision(false), _waitForSync(true), diff --git a/arangod/Agency/Agent.cpp b/arangod/Agency/Agent.cpp index fb9bebd249..df3afd05f8 100644 --- a/arangod/Agency/Agent.cpp +++ b/arangod/Agency/Agent.cpp @@ -178,6 +178,8 @@ void Agent::reportIn(arangodb::consensus::id_t id, index_t index) { MUTEX_LOCKER(mutexLocker, _ioLock); + TRI_ASSERT(id<_confirmed.size()); + if (index > _confirmed[id]) { // progress this follower? _confirmed[id] = index; } @@ -282,6 +284,10 @@ priv_rpc_ret_t Agent::sendAppendEntriesRPC( t = this->term(); } + if (unconfirmed.empty()) { + return priv_rpc_ret_t(false, t); + } + // RPC path std::stringstream path; path << "/_api/agency_priv/appendEntries?term=" << t << "&leaderId=" << id() diff --git a/arangod/Agency/State.cpp b/arangod/Agency/State.cpp index 4a2f7620b5..ebed0adb57 100644 --- a/arangod/Agency/State.cpp +++ b/arangod/Agency/State.cpp @@ -180,7 +180,9 @@ std::vector State::slices( std::vector slices; MUTEX_LOCKER(mutexLocker, _logLock); - + if (_log.empty()) { + return slices; + } if (start < _log.front().index) { // no start specified start = _log.front().index;