diff --git a/arangod/Agency/Constituent.cpp b/arangod/Agency/Constituent.cpp index 9d37d111f8..87a940c74e 100644 --- a/arangod/Agency/Constituent.cpp +++ b/arangod/Agency/Constituent.cpp @@ -421,7 +421,8 @@ bool Constituent::start(TRI_vocbase_t* vocbase, void Constituent::run() { LOG(WARN) << "Starting constituent"; - + _id = _agent->config().id(); + TRI_ASSERT(_vocbase != nullptr); auto bindVars = std::make_shared(); bindVars->openObject(); diff --git a/arangod/Agency/Inception.cpp b/arangod/Agency/Inception.cpp index 0dbdc528c7..a5e840a4c3 100644 --- a/arangod/Agency/Inception.cpp +++ b/arangod/Agency/Inception.cpp @@ -58,9 +58,9 @@ void Inception::run() { TRI_ASSERT(_agent != nullptr); auto s = std::chrono::system_clock::now(); - std::chrono::seconds timeout(30); + std::chrono::seconds timeout(10); size_t i = 0; - + bool cs = false; while (!this->isStopping()) { config_t config = _agent->config(); // get a copy of conf @@ -111,18 +111,19 @@ void Inception::run() { LOG_TOPIC(ERR, Logger::AGENCY) << "Failed to find complete pool of agents. Giving up!"; } -// this->shutdown(); + break; } if (config.poolComplete()) { - _agent->startConstituent(); - break; + if (!cs) { + _agent->startConstituent(); + cs = true; + } + } } - //this->shutdown(); - } diff --git a/scripts/startStandAloneAgency.sh b/scripts/startStandAloneAgency.sh index 620b418a66..32ca57c9e9 100755 --- a/scripts/startStandAloneAgency.sh +++ b/scripts/startStandAloneAgency.sh @@ -35,10 +35,11 @@ rm -rf agency mkdir -p agency echo -n "Starting agency ... " if [ $NRAGENTS -gt 1 ]; then - for aid in `seq 0 $(( $NRAGENTS - 2 ))`; do + for aid in `seq 0 $(( $NRAGENTS - 1 ))`; do port=$(( $BASE + $aid )) build/bin/arangod \ -c none \ + --agency.endpoint tcp://localhost:5001 \ --agency.activate true \ --agency.size $NRAGENTS \ --agency.pool-size $POOLSZ \ @@ -61,32 +62,6 @@ if [ $NRAGENTS -gt 1 ]; then > agency/$port.stdout 2>&1 & done fi -for aid in `seq 0 $(( $NRAGENTS - 1 ))`; do - endpoints="$endpoints --agency.endpoint tcp://localhost:$(( $BASE + $aid ))" -done -build/bin/arangod \ - -c none \ - $endpoints \ - --agency.activate true \ - --agency.size $NRAGENTS \ - --agency.pool-size $POOLSZ \ - --agency.supervision true \ - --agency.supervision-frequency $SFRE \ - --agency.wait-for-sync true \ - --agency.election-timeout-min $MINP \ - --agency.election-timeout-max $MAXP \ - --database.directory agency/data$(( $BASE + $aid )) \ - --javascript.app-path ./js/apps \ - --javascript.startup-directory ./js \ - --javascript.v8-contexts 1 \ - --log.file agency/$(( $BASE + $aid )).log \ - --server.authentication false \ - --server.endpoint tcp://0.0.0.0:$(( $BASE + $aid )) \ - --server.statistics false \ - --agency.compaction-step-size $COMP \ - --log.level agency=debug \ - --log.force-direct true \ - > agency/$(( $BASE + $aid )).stdout 2>&1 & echo " done." echo "Your agents are ready at port $BASE onward"