1
0
Fork 0

Repair resilience-sharddist test by increasing timeout. (#4857)

This commit is contained in:
Max Neunhöffer 2018-03-15 13:29:55 +01:00 committed by Jan
parent 148bdb7158
commit 793101528f
2 changed files with 21 additions and 4 deletions

View File

@ -2639,13 +2639,25 @@ std::shared_ptr<LogicalCollection> ClusterMethods::persistCollectionInAgency(
// the default behaviour however is to bail out and inform the user
// that the requested replicationFactor is not possible right now
if (enforceReplicationFactor && dbServers.size() < replicationFactor) {
THROW_ARANGO_EXCEPTION(TRI_ERROR_CLUSTER_INSUFFICIENT_DBSERVERS);
if (dbServers.size() < replicationFactor) {
LOG_TOPIC(DEBUG, Logger::CLUSTER)
<< "Do not have enough DBServers for requested replicationFactor,"
<< " nrDBServers: " << dbServers.size()
<< " replicationFactor: " << replicationFactor;
if (enforceReplicationFactor) {
THROW_ARANGO_EXCEPTION(TRI_ERROR_CLUSTER_INSUFFICIENT_DBSERVERS);
}
}
if (!avoid.empty()) {
// We need to remove all servers that are in the avoid list
if (dbServers.size() - avoid.size() < replicationFactor) {
LOG_TOPIC(DEBUG, Logger::CLUSTER)
<< "Do not have enough DBServers for requested replicationFactor,"
<< " (after considering avoid list),"
<< " nrDBServers: " << dbServers.size()
<< " replicationFactor: " << replicationFactor
<< " avoid list size: " << avoid.size();
// Not enough DBServers left
THROW_ARANGO_EXCEPTION(TRI_ERROR_CLUSTER_INSUFFICIENT_DBSERVERS);
}

View File

@ -283,7 +283,7 @@ describe('Shard distribution', function () {
var shards = Object.keys(cinfo.shards);
var replFactor = cinfo.shards[shards[0]].length;
var count = 0;
while (++count <= 180) {
while (++count <= 600) {
var ccinfo = shards.map(
s => global.ArangoClusterInfo.getCollectionInfoCurrent(
"_system", collection, s)
@ -292,10 +292,15 @@ describe('Shard distribution', function () {
if (_.every(replicas, x => x.length === replFactor)) {
return true;
}
if (count % 60 === 0) {
console.info("waitForSynchronousReplication: cinfo:",
JSON.stringify(cinfo), ", replicas: ",
JSON.stringify(replicas));
}
wait(0.5);
global.ArangoClusterInfo.flush();
}
console.error(`Collection "${collection}" failed to get all followers in sync after 60 sec`);
console.error(`Collection "${collection}" failed to get all followers in sync after 600 sec`);
return false;
};