1
0
Fork 0

document the RequestLanes, and "fix" the lanes of a few handlers (#6152)

This commit is contained in:
Jan 2018-08-15 11:58:16 +02:00 committed by GitHub
parent 614469de8b
commit 43b53bea57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 53 additions and 21 deletions

View File

@ -23,18 +23,6 @@
#include "ClusterRestExportHandler.h"
#include "Basics/Exceptions.h"
#include "Basics/MutexLocker.h"
#include "Basics/VelocyPackHelper.h"
#include "StorageEngine/EngineSelectorFeature.h"
#include "Utils/Cursor.h"
#include "Utils/CursorRepository.h"
#include "VocBase/ticks.h"
#include <velocypack/Builder.h>
#include <velocypack/Dumper.h>
#include <velocypack/Iterator.h>
#include <velocypack/Slice.h>
#include <velocypack/velocypack-aliases.h>
using namespace arangodb;
using namespace arangodb::rest;

View File

@ -36,7 +36,7 @@ class ClusterRestExportHandler : public RestVocbaseBaseHandler {
public:
char const* name() const override final { return "ClusterRestExportHandler"; }
RequestLane lane() const override final { return RequestLane::CLUSTER_INTERNAL; }
RequestLane lane() const override final { return RequestLane::CLIENT_SLOW; }
RestStatus execute() override;
};
}

View File

@ -42,7 +42,7 @@ class ClusterRestReplicationHandler : public RestReplicationHandler {
return "ClusterRestReplicationHandler";
}
RequestLane lane() const override final { return RequestLane::CLUSTER_INTERNAL; }
RequestLane lane() const override final { return RequestLane::CLIENT_SLOW; }
private:
@ -76,8 +76,6 @@ class ClusterRestReplicationHandler : public RestReplicationHandler {
/// @brief handle a dump command for a specific collection
void handleCommandDump() override;
private:
};
}

View File

@ -27,17 +27,61 @@
namespace arangodb {
enum class RequestLane {
// For requests that do not block or wait for something.
// This ignores blocks that can occur when delivering
// a file from, for example, an NFS mount.
CLIENT_FAST,
// For requests that execute an AQL query or tightly
// related like simple queries, but not V8 actions,
// that do AQL requests, user administrator that
// internally uses AQL.
CLIENT_AQL,
// For requests that are executed within an V8 context,
// but not for requests that might use a V8 context for
// user defined functions.
CLIENT_V8,
// For requests that might block or wait for something,
// which are not CLIENT_AQL or CLIENT_V8.
CLIENT_SLOW,
// For requests between agents. These are basically the
// requests used to implement RAFT.
AGENCY_INTERNAL,
// For requests from the DBserver or Coordinator accessing
// the agency.
AGENCY_CLUSTER,
// For requests from the DBserver to the Coordinator or
// from the Coordinator to the DBserver. But not using
// V8 or having high priority.
CLUSTER_INTERNAL,
// For requests from the from the Coordinator to the
// DBserver using V8.
CLUSTER_V8,
// For requests from the DBserver to the Coordinator or
// from the Coordinator to the DBserver for administration
// or diagnostic purpose. Should not block.
CLUSTER_ADMIN,
// For requests used between leader and follower for
// replication.
SERVER_REPLICATION,
// For periodic or one-off V8-based tasks executed by the
// Scheduler.
TASK_V8
// Not yet used:
// For requests which go from the agency back to coordinators or
// DBservers to report about changes in the agency. They are fast
// and should have high prio. Will never block.
// AGENCY_CALLBACK`
};
enum class RequestPriority { HIGH, LOW, V8 };

View File

@ -33,7 +33,7 @@ class RestAqlUserFunctionsHandler : public arangodb::RestVocbaseBaseHandler {
public:
char const* name() const override final { return "RestAqlUserFunctionsHandler"; }
RequestLane lane() const override final { return RequestLane::CLIENT_SLOW; }
RequestLane lane() const override final { return RequestLane::CLIENT_V8; }
RestStatus execute() override;
};
}

View File

@ -63,7 +63,9 @@ class RestBatchHandler : public RestVocbaseBaseHandler {
public:
RestStatus execute() override;
char const* name() const override final { return "RestBatchHandler"; }
RequestLane lane() const override final { return RequestLane::CLIENT_SLOW; }
// be pessimistic about what this handler does... it may invoke V8
// or not, but as we don't know where, we need to assume it
RequestLane lane() const override final { return RequestLane::CLIENT_V8; }
private:
RestStatus executeHttp();

View File

@ -33,7 +33,7 @@ class RestTasksHandler : public arangodb::RestVocbaseBaseHandler {
public:
char const* name() const override final { return "RestTasksHandler"; }
RequestLane lane() const override final { return RequestLane::TASK_V8; }
RequestLane lane() const override final { return RequestLane::CLIENT_V8; }
RestStatus execute() override;
protected:

View File

@ -40,7 +40,7 @@ class RestTransactionHandler : public arangodb::RestVocbaseBaseHandler {
public:
char const* name() const override final { return "RestTransactionHandler"; }
RequestLane lane() const override final { return RequestLane::CLIENT_SLOW; }
RequestLane lane() const override final { return RequestLane::CLIENT_V8; }
RestStatus execute() override;
bool cancel() override final;

View File

@ -36,7 +36,7 @@ class RestWalAccessHandler : public arangodb::RestVocbaseBaseHandler {
public:
char const* name() const override final { return "RestWalAccessHandler"; }
RequestLane lane() const override final { return RequestLane::CLUSTER_INTERNAL; }
RequestLane lane() const override final { return RequestLane::SERVER_REPLICATION; }
RestStatus execute() override;
private: