1
0
Fork 0

some additional checking of vector bounds and assertions

This commit is contained in:
Kaveh Vahedipour 2016-06-28 09:26:33 +02:00
parent ecf6885286
commit e06a5bc70f
3 changed files with 11 additions and 3 deletions

View File

@ -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),

View File

@ -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()

View File

@ -180,7 +180,9 @@ std::vector<VPackSlice> State::slices(
std::vector<VPackSlice> slices;
MUTEX_LOCKER(mutexLocker, _logLock);
if (_log.empty()) {
return slices;
}
if (start < _log.front().index) { // no start specified
start = _log.front().index;