mirror of https://gitee.com/bigwinds/arangodb
getDBServers response changed for aardvark frontend. needed reflection in resilienceMove tests
This commit is contained in:
parent
26167e87fd
commit
f06fdf9e0f
|
@ -935,7 +935,7 @@ void Agent::beginShutdown() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stop inception process
|
// Stop inception process
|
||||||
if (_inception != nullptr) {
|
if (size() > 1 && _inception != nullptr) {
|
||||||
_inception->beginShutdown();
|
_inception->beginShutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -943,13 +943,14 @@ void Agent::beginShutdown() {
|
||||||
_spearhead.beginShutdown();
|
_spearhead.beginShutdown();
|
||||||
_readDB.beginShutdown();
|
_readDB.beginShutdown();
|
||||||
|
|
||||||
if (_inception != nullptr) {
|
if (size() > 1 && _inception != nullptr) {
|
||||||
int counter = 0;
|
int counter = 0;
|
||||||
while (_inception->isRunning()) {
|
while (_inception->isRunning()) {
|
||||||
usleep(100000);
|
usleep(100000);
|
||||||
// emit warning after 5 seconds
|
// emit warning after 5 seconds
|
||||||
if (++counter == 10 * 5) {
|
if (++counter == 10 * 5) {
|
||||||
LOG_TOPIC(WARN, Logger::AGENCY) << "waiting for inception thread to finish";
|
LOG_TOPIC(WARN, Logger::AGENCY)
|
||||||
|
<< "waiting for inception thread to finish";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,16 @@ const _ = require("lodash");
|
||||||
const wait = require("internal").wait;
|
const wait = require("internal").wait;
|
||||||
const supervisionState = require("@arangodb/cluster").supervisionState;
|
const supervisionState = require("@arangodb/cluster").supervisionState;
|
||||||
|
|
||||||
|
function getDBServers() {
|
||||||
|
var tmp = global.ArangoClusterInfo.getDBServers();
|
||||||
|
var servers = [];
|
||||||
|
for (var i = 0; i < tmp.length; ++i) {
|
||||||
|
servers[i] = tmp[i].serverId;
|
||||||
|
}
|
||||||
|
return servers;
|
||||||
|
}
|
||||||
|
|
||||||
|
const servers = getDBServers();
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief test suite
|
/// @brief test suite
|
||||||
|
@ -46,7 +56,7 @@ function MovingShardsSuite () {
|
||||||
var cn = "UnitTestMovingShards";
|
var cn = "UnitTestMovingShards";
|
||||||
var count = 0;
|
var count = 0;
|
||||||
var c = [];
|
var c = [];
|
||||||
var dbservers = global.ArangoClusterInfo.getDBServers();
|
var dbservers = getDBServers();
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief find out servers for a collection
|
/// @brief find out servers for a collection
|
||||||
|
@ -242,7 +252,7 @@ function MovingShardsSuite () {
|
||||||
var request = require("@arangodb/request");
|
var request = require("@arangodb/request");
|
||||||
var endpointToURL = require("@arangodb/cluster").endpointToURL;
|
var endpointToURL = require("@arangodb/cluster").endpointToURL;
|
||||||
var url = endpointToURL(coordEndpoint);
|
var url = endpointToURL(coordEndpoint);
|
||||||
var numberOfDBServers = global.ArangoClusterInfo.getDBServers().length;
|
var numberOfDBServers = servers.length;
|
||||||
var body = {"cleanedServers":[], "numberOfDBServers":numberOfDBServers};
|
var body = {"cleanedServers":[], "numberOfDBServers":numberOfDBServers};
|
||||||
try {
|
try {
|
||||||
var res = request({ method: "PUT",
|
var res = request({ method: "PUT",
|
||||||
|
@ -378,7 +388,7 @@ function MovingShardsSuite () {
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
testSetup : function () {
|
testSetup : function () {
|
||||||
dbservers = global.ArangoClusterInfo.getDBServers();
|
dbservers = getDBServers();
|
||||||
assertTrue(waitForSynchronousReplication("_system"));
|
assertTrue(waitForSynchronousReplication("_system"));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -388,7 +398,7 @@ function MovingShardsSuite () {
|
||||||
|
|
||||||
testShrinkNoReplication : function() {
|
testShrinkNoReplication : function() {
|
||||||
assertTrue(waitForSynchronousReplication("_system"));
|
assertTrue(waitForSynchronousReplication("_system"));
|
||||||
var _dbservers = global.ArangoClusterInfo.getDBServers();
|
var _dbservers = servers;
|
||||||
_dbservers.sort();
|
_dbservers.sort();
|
||||||
assertTrue(shrinkCluster(4));
|
assertTrue(shrinkCluster(4));
|
||||||
assertTrue(testServerEmpty(_dbservers[4], true));
|
assertTrue(testServerEmpty(_dbservers[4], true));
|
||||||
|
|
Loading…
Reference in New Issue