mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of https://github.com/arangodb/arangodb into devel
This commit is contained in:
commit
10367c1de4
|
@ -440,7 +440,7 @@ void Agent::run() {
|
|||
while (!this->isStopping() && size() > 1) {
|
||||
|
||||
if (leading()) { // Only if leading
|
||||
_appendCV.wait(20000);
|
||||
_appendCV.wait(25000);
|
||||
} else {
|
||||
_appendCV.wait(); // Else wait for our moment in the sun
|
||||
}
|
||||
|
|
|
@ -487,25 +487,23 @@ void Constituent::run() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Always start off as follower
|
||||
while (!this->isStopping() && size() > 1) {
|
||||
|
||||
long t = 0;
|
||||
|
||||
if (_role == FOLLOWER) {
|
||||
bool cast = false;
|
||||
|
||||
|
||||
{
|
||||
MUTEX_LOCKER(guard, _castLock);
|
||||
_cast = false; // New round set not cast vote
|
||||
}
|
||||
|
||||
int32_t left = static_cast<int32_t>(1000000.0 * config().minPing), right = static_cast<int32_t>(1000000.0 * config().maxPing);
|
||||
long rand_wait = static_cast<long>(RandomGenerator::interval(left, right));
|
||||
|
||||
{
|
||||
CONDITION_LOCKER(guardv, _cv);
|
||||
_cv.wait(rand_wait);
|
||||
}
|
||||
|
||||
int32_t left = static_cast<int32_t>(1000000.0 * config().minPing),
|
||||
right = static_cast<int32_t>(1000000.0 * config().maxPing);
|
||||
t = static_cast<long>(RandomGenerator::interval(left, right));
|
||||
|
||||
{
|
||||
MUTEX_LOCKER(guard, _castLock);
|
||||
|
@ -517,14 +515,19 @@ void Constituent::run() {
|
|||
}
|
||||
|
||||
} else if (_role == CANDIDATE) {
|
||||
|
||||
callElection(); // Run for office
|
||||
continue;
|
||||
|
||||
} else {
|
||||
int32_t left = 100000.0 * config().minPing;
|
||||
long rand_wait = static_cast<long>(left);
|
||||
{
|
||||
CONDITION_LOCKER(guardv, _cv);
|
||||
_cv.wait(rand_wait);
|
||||
}
|
||||
|
||||
t = 100000.0 * config().minPing;
|
||||
|
||||
}
|
||||
|
||||
{
|
||||
CONDITION_LOCKER(guardv, _cv);
|
||||
_cv.wait(t);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ Slice Node::slice() const {
|
|||
}
|
||||
|
||||
// Some value
|
||||
if (!_value.empty() && !_value.empty()) {
|
||||
if (!_value.empty()) {
|
||||
return Slice(_value.front().data());
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ if [ $NRAGENTS -gt 1 ]; then
|
|||
--agency.compaction-step-size $COMP \
|
||||
--log.force-direct true \
|
||||
> agency/$port.stdout 2>&1 &
|
||||
sleep 0
|
||||
sleep 1
|
||||
done
|
||||
fi
|
||||
for aid in `seq 0 $(( $NRAGENTS - 1 ))`; do
|
||||
|
|
Loading…
Reference in New Issue