mirror of https://gitee.com/bigwinds/arangodb
some additional checking of vector bounds and assertions
This commit is contained in:
parent
ecf6885286
commit
e06a5bc70f
|
@ -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),
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue