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"),
|
: ApplicationFeature(server, "Agency"),
|
||||||
_size(1),
|
_size(1),
|
||||||
_agentId(0),
|
_agentId(0),
|
||||||
_minElectionTimeout(0.15),
|
_minElectionTimeout(0.25),
|
||||||
_maxElectionTimeout(2.0),
|
_maxElectionTimeout(2.5),
|
||||||
_notify(false),
|
_notify(false),
|
||||||
_supervision(false),
|
_supervision(false),
|
||||||
_waitForSync(true),
|
_waitForSync(true),
|
||||||
|
|
|
@ -178,6 +178,8 @@ void Agent::reportIn(arangodb::consensus::id_t id, index_t index) {
|
||||||
|
|
||||||
MUTEX_LOCKER(mutexLocker, _ioLock);
|
MUTEX_LOCKER(mutexLocker, _ioLock);
|
||||||
|
|
||||||
|
TRI_ASSERT(id<_confirmed.size());
|
||||||
|
|
||||||
if (index > _confirmed[id]) { // progress this follower?
|
if (index > _confirmed[id]) { // progress this follower?
|
||||||
_confirmed[id] = index;
|
_confirmed[id] = index;
|
||||||
}
|
}
|
||||||
|
@ -282,6 +284,10 @@ priv_rpc_ret_t Agent::sendAppendEntriesRPC(
|
||||||
t = this->term();
|
t = this->term();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (unconfirmed.empty()) {
|
||||||
|
return priv_rpc_ret_t(false, t);
|
||||||
|
}
|
||||||
|
|
||||||
// RPC path
|
// RPC path
|
||||||
std::stringstream path;
|
std::stringstream path;
|
||||||
path << "/_api/agency_priv/appendEntries?term=" << t << "&leaderId=" << id()
|
path << "/_api/agency_priv/appendEntries?term=" << t << "&leaderId=" << id()
|
||||||
|
|
|
@ -180,7 +180,9 @@ std::vector<VPackSlice> State::slices(
|
||||||
std::vector<VPackSlice> slices;
|
std::vector<VPackSlice> slices;
|
||||||
MUTEX_LOCKER(mutexLocker, _logLock);
|
MUTEX_LOCKER(mutexLocker, _logLock);
|
||||||
|
|
||||||
|
if (_log.empty()) {
|
||||||
|
return slices;
|
||||||
|
}
|
||||||
|
|
||||||
if (start < _log.front().index) { // no start specified
|
if (start < _log.front().index) { // no start specified
|
||||||
start = _log.front().index;
|
start = _log.front().index;
|
||||||
|
|
Loading…
Reference in New Issue