mirror of https://gitee.com/bigwinds/arangodb
double percision conserved for timeout in AgencyComm
This commit is contained in:
parent
cd141cbde1
commit
8185588bb2
|
@ -468,7 +468,7 @@ bool Inception::estimateRAFTInterval() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
maxmean = 1.e-3*std::ceil(1.e3*(.5 + 1.0e-3*(maxmean+3*maxstdev)));
|
maxmean = 1.e-3*std::ceil(1.e3*(.25 + 1.0e-3*(maxmean+3*maxstdev)));
|
||||||
|
|
||||||
LOG_TOPIC(INFO, Logger::AGENCY)
|
LOG_TOPIC(INFO, Logger::AGENCY)
|
||||||
<< "Auto-adapting RAFT timing to: {" << maxmean
|
<< "Auto-adapting RAFT timing to: {" << maxmean
|
||||||
|
|
|
@ -1615,7 +1615,7 @@ AgencyCommResult AgencyComm::sendWithFailover(
|
||||||
|
|
||||||
using namespace std::chrono;
|
using namespace std::chrono;
|
||||||
auto start = system_clock::now();
|
auto start = system_clock::now();
|
||||||
seconds ltimeout(static_cast<int>(timeout));
|
duration<double> to(1.e3*timeout);
|
||||||
|
|
||||||
{
|
{
|
||||||
READ_LOCKER(readLocker, AgencyComm::_globalLock);
|
READ_LOCKER(readLocker, AgencyComm::_globalLock);
|
||||||
|
@ -1666,7 +1666,7 @@ AgencyCommResult AgencyComm::sendWithFailover(
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (system_clock::now() - start > ltimeout) {
|
if (system_clock::now() - start > to) {
|
||||||
LOG_TOPIC(ERR, Logger::AGENCYCOMM) << "Timed out waiting for leader "
|
LOG_TOPIC(ERR, Logger::AGENCYCOMM) << "Timed out waiting for leader "
|
||||||
<< agencyEndpoint->_endpoint->specification() << " tries: " << ltries;
|
<< agencyEndpoint->_endpoint->specification() << " tries: " << ltries;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -11,6 +11,7 @@ function help() {
|
||||||
echo " -w/--wait-for-sync Boolean (true|false default: true)"
|
echo " -w/--wait-for-sync Boolean (true|false default: true)"
|
||||||
echo " -m/--use-microtime Boolean (true|false default: false)"
|
echo " -m/--use-microtime Boolean (true|false default: false)"
|
||||||
echo " -s/--start-delays Integer ( default: 0)"
|
echo " -s/--start-delays Integer ( default: 0)"
|
||||||
|
echo " -r/--random-delays Boolean (tru|false default: false)"
|
||||||
echo " -g/--gossip-mode Integer (0: Announce first endpoint to all"
|
echo " -g/--gossip-mode Integer (0: Announce first endpoint to all"
|
||||||
echo " 1: Grow list of known endpoints for each"
|
echo " 1: Grow list of known endpoints for each"
|
||||||
echo " 2: Cyclic default: 0)"
|
echo " 2: Cyclic default: 0)"
|
||||||
|
@ -25,13 +26,13 @@ function help() {
|
||||||
function shuffle() {
|
function shuffle() {
|
||||||
local i tmp size max rand
|
local i tmp size max rand
|
||||||
|
|
||||||
size=${#array[*]}
|
size=${#aaid[*]}
|
||||||
max=$(( 32768 / size * size ))
|
max=$(( 32768 / size * size ))
|
||||||
|
|
||||||
for ((i=size-1; i>0; i--)); do
|
for ((i=size-1; i>0; i--)); do
|
||||||
while (( (rand=$RANDOM) >= max )); do :; done
|
while (( (rand=$RANDOM) >= max )); do :; done
|
||||||
rand=$(( rand % (i+1) ))
|
rand=$(( rand % (i+1) ))
|
||||||
tmp=${array[i]} array[i]=${array[rand]} array[rand]=$tmp
|
tmp=${aaid[i]} aaid[i]=${aaid[rand]} aaid[rand]=$tmp
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,10 +133,10 @@ rm -rf agency
|
||||||
mkdir -p agency
|
mkdir -p agency
|
||||||
PIDS=""
|
PIDS=""
|
||||||
|
|
||||||
array=(`seq 0 $(( $POOLSZ - 1 ))`)
|
aaid=(`seq 0 $(( $POOLSZ - 1 ))`)
|
||||||
shuffle
|
shuffle
|
||||||
|
|
||||||
for aid in "${array[@]}"; do
|
for aid in "${aaid[@]}"; do
|
||||||
|
|
||||||
port=$(( $BASE + $aid ))
|
port=$(( $BASE + $aid ))
|
||||||
if [ "$GOSSIP_MODE" = 2 ]; then
|
if [ "$GOSSIP_MODE" = 2 ]; then
|
||||||
|
|
Loading…
Reference in New Issue