mirror of https://gitee.com/bigwinds/arangodb
Bug fix/fix test muell (#8703)
This commit is contained in:
parent
ed1e0336cb
commit
6b9b9b0946
|
@ -34,6 +34,7 @@
|
||||||
#include "Rest/HttpRequest.h"
|
#include "Rest/HttpRequest.h"
|
||||||
#include "Rest/Version.h"
|
#include "Rest/Version.h"
|
||||||
#include "StorageEngine/EngineSelectorFeature.h"
|
#include "StorageEngine/EngineSelectorFeature.h"
|
||||||
|
#include "Transaction/StandaloneContext.h"
|
||||||
|
|
||||||
using namespace arangodb;
|
using namespace arangodb;
|
||||||
|
|
||||||
|
@ -47,7 +48,7 @@ using namespace arangodb::consensus;
|
||||||
|
|
||||||
RestAgencyHandler::RestAgencyHandler(GeneralRequest* request,
|
RestAgencyHandler::RestAgencyHandler(GeneralRequest* request,
|
||||||
GeneralResponse* response, Agent* agent)
|
GeneralResponse* response, Agent* agent)
|
||||||
: RestBaseHandler(request, response), _agent(agent) {}
|
: RestVocbaseBaseHandler(request, response), _agent(agent) {}
|
||||||
|
|
||||||
inline RestStatus RestAgencyHandler::reportErrorEmptyRequest() {
|
inline RestStatus RestAgencyHandler::reportErrorEmptyRequest() {
|
||||||
LOG_TOPIC("46536", WARN, Logger::AGENCY)
|
LOG_TOPIC("46536", WARN, Logger::AGENCY)
|
||||||
|
@ -566,7 +567,8 @@ RestStatus RestAgencyHandler::handleState() {
|
||||||
VPackObjectBuilder o(&body);
|
VPackObjectBuilder o(&body);
|
||||||
_agent->readDB(body);
|
_agent->readDB(body);
|
||||||
}
|
}
|
||||||
generateResult(rest::ResponseCode::OK, body.slice());
|
auto ctx = std::make_shared<transaction::StandaloneContext>(_vocbase);
|
||||||
|
generateResult(rest::ResponseCode::OK, body.slice(), ctx->getVPackOptionsForDump());
|
||||||
return RestStatus::DONE;
|
return RestStatus::DONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#define ARANGOD_REST_HANDLER_REST_AGENCY_HANDLER_H 1
|
#define ARANGOD_REST_HANDLER_REST_AGENCY_HANDLER_H 1
|
||||||
|
|
||||||
#include "Agency/Agent.h"
|
#include "Agency/Agent.h"
|
||||||
#include "RestHandler/RestBaseHandler.h"
|
#include "RestHandler/RestVocbaseBaseHandler.h"
|
||||||
|
|
||||||
namespace arangodb {
|
namespace arangodb {
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ namespace arangodb {
|
||||||
/// @brief REST handler for outside calls to agency (write & read)
|
/// @brief REST handler for outside calls to agency (write & read)
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
class RestAgencyHandler : public RestBaseHandler {
|
class RestAgencyHandler : public RestVocbaseBaseHandler {
|
||||||
public:
|
public:
|
||||||
RestAgencyHandler(GeneralRequest*, GeneralResponse*, consensus::Agent*);
|
RestAgencyHandler(GeneralRequest*, GeneralResponse*, consensus::Agent*);
|
||||||
|
|
||||||
|
|
|
@ -839,17 +839,16 @@ function dumpAgency(instanceInfo, options) {
|
||||||
if (agencyReply.code === 200) {
|
if (agencyReply.code === 200) {
|
||||||
let agencyValue = JSON.parse(agencyReply.body);
|
let agencyValue = JSON.parse(agencyReply.body);
|
||||||
fs.write(fs.join(options.testOutputDirectory, fn + '_' + arangod.pid + ".json"), JSON.stringify(agencyValue, null, 2));
|
fs.write(fs.join(options.testOutputDirectory, fn + '_' + arangod.pid + ".json"), JSON.stringify(agencyValue, null, 2));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
print(agencyReply);
|
print(agencyReply);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
instanceInfo.arangods.forEach((arangod) => {
|
instanceInfo.arangods.forEach((arangod) => {
|
||||||
if (arangod.role === "agent") {
|
if (arangod.role === "agent") {
|
||||||
if (arangod.hasOwnProperty('exitStatus')) {
|
if (arangod.hasOwnProperty('exitStatus')) {
|
||||||
print(Date() + " this agent is already dead: " + arangod);
|
print(Date() + " this agent is already dead: " + JSON.stringify(arangod));
|
||||||
} else {
|
} else {
|
||||||
print(Date() + " Attempting to dump Agent: " + arangod);
|
print(Date() + " Attempting to dump Agent: " + JSON.stringify(arangod));
|
||||||
dumpAgent(arangod, '/_api/agency/config', 'GET', 'agencyConfig');
|
dumpAgent(arangod, '/_api/agency/config', 'GET', 'agencyConfig');
|
||||||
|
|
||||||
dumpAgent(arangod, '/_api/agency/state', 'GET', 'agencyState');
|
dumpAgent(arangod, '/_api/agency/state', 'GET', 'agencyState');
|
||||||
|
|
|
@ -138,7 +138,7 @@ const optionsDefaults = {
|
||||||
'extraArgs': {},
|
'extraArgs': {},
|
||||||
'extremeVerbosity': false,
|
'extremeVerbosity': false,
|
||||||
'force': true,
|
'force': true,
|
||||||
'getSockStat': true,
|
'getSockStat': false,
|
||||||
'arangosearch':true,
|
'arangosearch':true,
|
||||||
'jsonReply': false,
|
'jsonReply': false,
|
||||||
'loopEternal': false,
|
'loopEternal': false,
|
||||||
|
|
Loading…
Reference in New Issue