1
0
Fork 0

Merge branch 'devel' of github.com:arangodb/arangodb into devel

* 'devel' of github.com:arangodb/arangodb:
  lowering log output in agencycomm
  Lower log level for local shard operations to debug.
This commit is contained in:
Jan Christoph Uhde 2017-01-31 10:08:03 +01:00
commit 4981af31c8
3 changed files with 37 additions and 23 deletions

View File

@ -612,7 +612,7 @@ std::string AgencyCommManager::redirect(
<< specification << ", url = " << rest;
if (endpoint == specification) {
LOG_TOPIC(WARN, Logger::AGENCYCOMM)
LOG_TOPIC(DEBUG, Logger::AGENCYCOMM)
<< "got an agency redirect back to the old agency '" << endpoint << "'";
failedNonLocking(std::move(connection), endpoint);
return "";
@ -632,7 +632,7 @@ std::string AgencyCommManager::redirect(
std::remove(_endpoints.begin(), _endpoints.end(), specification),
_endpoints.end());
LOG_TOPIC(WARN, Logger::AGENCYCOMM)
LOG_TOPIC(DEBUG, Logger::AGENCYCOMM)
<< "Got an agency redirect from '" << endpoint
<< "' to '" << specification << "'";
@ -1359,17 +1359,11 @@ AgencyCommResult AgencyComm::sendWithFailover(
LOG_TOPIC(ERR, Logger::AGENCYCOMM) << result._message;
return result;
}
if (1 < tries) {
LOG_TOPIC(WARN, Logger::AGENCYCOMM)
<< "Retrying agency communication at '" << endpoint
<< "', tries: " << tries << " ("
<< 1.e-2 * (
std::round(
1.e+2 * std::chrono::duration<double>(
std::chrono::steady_clock::now() - started).count())) << "s)";
}
double elapsed = 1.e-2 * (
std::round(1.e+2 * std::chrono::duration<double>(
std::chrono::steady_clock::now() - started).count()));
// try to send; if we fail completely, do not retry
try {
result = send(connection.get(), method, conTimeout, url, body, clientId);
@ -1379,7 +1373,7 @@ AgencyCommResult AgencyComm::sendWithFailover(
connection = AgencyCommManager::MANAGER->acquire(endpoint);
continue;
}
// got a result, we are done
if (result.successful()) {
AgencyCommManager::MANAGER->release(std::move(connection), endpoint);
@ -1389,7 +1383,7 @@ AgencyCommResult AgencyComm::sendWithFailover(
// break on a watch timeout (drop connection)
if (!clientId.empty() && result._sent &&
(result._statusCode == 0 || result._statusCode == 503)) {
VPackBuilder b;
{
VPackArrayBuilder ab(&b);
@ -1470,6 +1464,26 @@ AgencyCommResult AgencyComm::sendWithFailover(
break;
}
if (tries%50 == 0) {
LOG_TOPIC(WARN, Logger::AGENCYCOMM)
<< "Bad agency communiction! Unsuccessful consecutive tries:"
<< tries << " (" << elapsed << "s). Network checks needed!";
} else if (tries%15 == 0) {
LOG_TOPIC(INFO, Logger::AGENCYCOMM)
<< "Flaky agency communication. Unsuccessful consecutive tries: "
<< tries << " (" << elapsed << "s). Network checks advised.";
}
if (1 < tries) {
LOG_TOPIC(DEBUG, Logger::AGENCYCOMM)
<< "Retrying agency communication at '" << endpoint
<< "', tries: " << tries << " ("
<< 1.e-2 * (
std::round(
1.e+2 * std::chrono::duration<double>(
std::chrono::steady_clock::now() - started).count())) << "s)";
}
// here we have failed and want to try next endpoint
AgencyCommManager::MANAGER->failed(std::move(connection), endpoint);
endpoint.clear();

View File

@ -745,7 +745,7 @@ function executePlanForCollections(plannedCollections) {
let collection;
if (!localCollections.hasOwnProperty(shardName)) {
// must create this shard
console.info("creating local shard '%s/%s' for central '%s/%s'",
console.debug("creating local shard '%s/%s' for central '%s/%s'",
database,
shardName,
database,
@ -813,7 +813,7 @@ function executePlanForCollections(plannedCollections) {
}, {});
if (Object.keys(properties).length > 0) {
console.info("updating properties for local shard '%s/%s'",
console.debug("updating properties for local shard '%s/%s'",
database,
shardName);
@ -831,17 +831,17 @@ function executePlanForCollections(plannedCollections) {
// Now check whether the status is OK:
if (collectionStatus !== collectionInfo.status) {
console.info("detected status change for local shard '%s/%s'",
console.debug("detected status change for local shard '%s/%s'",
database,
shardName);
if (collectionInfo.status === ArangoCollection.STATUS_UNLOADED) {
console.info("unloading local shard '%s/%s'",
console.debug("unloading local shard '%s/%s'",
database,
shardName);
collection.unload();
} else if (collectionInfo.status === ArangoCollection.STATUS_LOADED) {
console.info("loading local shard '%s/%s'",
console.debug("loading local shard '%s/%s'",
database,
shardName);
collection.load();
@ -1264,7 +1264,7 @@ function executePlanForDatabases(plannedDatabases) {
if (!plannedDatabases.hasOwnProperty(name) && name.substr(0, 1) !== '_') {
// must drop database
console.info("dropping local database '%s'", name);
console.debug("dropping local database '%s'", name);
// Do we have to stop a replication applier first?
if (ArangoServerState.role() === 'SECONDARY') {
@ -1273,7 +1273,7 @@ function executePlanForDatabases(plannedDatabases) {
var rep = require('@arangodb/replication');
var state = rep.applier.state();
if (state.state.running === true) {
console.info('stopping replication applier first');
console.debug('stopping replication applier first');
rep.applier.stop();
}
}

View File

@ -163,7 +163,7 @@ function MovingShardsSuite () {
}
if (!ok) {
console.info(
console.error(
"Failed: Server " + id + " was not cleaned out. List of cleaned servers: ["
+ obj.cleanedServers + "]");
}