Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frozen features #15610

Merged
merged 90 commits into from
Jan 31, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
be36dc9
initial commit
gnusi Jan 22, 2022
8e7581f
wip
gnusi Jan 23, 2022
2759bad
wip
gnusi Jan 23, 2022
f38bc68
wip
gnusi Jan 23, 2022
81caa1f
wip
gnusi Jan 23, 2022
de9be3f
wip
gnusi Jan 23, 2022
1b9c99c
Merge branch 'devel' of https://github.com/arangodb/arangodb into fea…
gnusi Jan 24, 2022
4ac869e
wip
gnusi Jan 24, 2022
44d4347
wip
gnusi Jan 24, 2022
81f4ddd
wip
gnusi Jan 24, 2022
ada8804
wip
gnusi Jan 24, 2022
01a7ba2
wip
gnusi Jan 24, 2022
e729dbe
wip
gnusi Jan 24, 2022
dab8961
Merge branch 'devel' of https://github.com/arangodb/arangodb into fea…
gnusi Jan 24, 2022
0a18808
Merge branch 'devel' of https://github.com/arangodb/arangodb into fea…
gnusi Jan 24, 2022
e74d1ac
wip
gnusi Jan 24, 2022
5a0702d
wip
gnusi Jan 25, 2022
485dc2f
wip
gnusi Jan 25, 2022
e228b3d
wip
gnusi Jan 25, 2022
cbf4f17
wip
gnusi Jan 25, 2022
0e82ce6
wip
gnusi Jan 25, 2022
9230c96
wip
gnusi Jan 25, 2022
c02365f
wip
gnusi Jan 25, 2022
9d212ed
wip
gnusi Jan 25, 2022
2a9e9e9
Merge branch 'devel' of https://github.com/arangodb/arangodb into fea…
gnusi Jan 25, 2022
e9e7c99
wip
gnusi Jan 25, 2022
0d2da9c
wip
gnusi Jan 26, 2022
1d97e72
wip
gnusi Jan 26, 2022
cc22221
wip
gnusi Jan 26, 2022
f4d4a1d
wip
gnusi Jan 26, 2022
dbb946c
wip
gnusi Jan 26, 2022
ce0a551
wip
gnusi Jan 26, 2022
482ef8f
wip
gnusi Jan 26, 2022
1db5cbf
wip
gnusi Jan 26, 2022
280a2f3
wip
gnusi Jan 26, 2022
5e1bd02
wip
gnusi Jan 26, 2022
871d34b
wip
gnusi Jan 26, 2022
21f15fb
wip
gnusi Jan 26, 2022
bc8b310
Merge branch 'devel' of https://github.com/arangodb/arangodb into fea…
gnusi Jan 26, 2022
1f19438
wip
gnusi Jan 26, 2022
f255f99
wip
gnusi Jan 26, 2022
9a1129b
wip
gnusi Jan 26, 2022
6e88128
get rid of virtual inheritance
gnusi Jan 26, 2022
7752ecf
wip
gnusi Jan 26, 2022
7d97ca8
wip
gnusi Jan 26, 2022
0ccbe4c
wip
gnusi Jan 26, 2022
5405acb
wup
gnusi Jan 27, 2022
5b687e9
wip
gnusi Jan 27, 2022
3da6cd8
wip
gnusi Jan 27, 2022
c544aea
wip
gnusi Jan 27, 2022
08e0796
wip
gnusi Jan 27, 2022
c270e77
wip
gnusi Jan 27, 2022
534937f
wip
gnusi Jan 27, 2022
5e57f80
Merge branch 'devel' of https://github.com/arangodb/arangodb into fea…
gnusi Jan 27, 2022
b0980e9
wip
gnusi Jan 27, 2022
a9849b1
wip
gnusi Jan 27, 2022
ad9eb7f
Merge branch 'devel' of https://github.com/arangodb/arangodb into fea…
gnusi Jan 28, 2022
9e04236
wip
gnusi Jan 28, 2022
23e648c
wip
gnusi Jan 28, 2022
5fb19ff
Merge branch 'devel' of https://github.com/arangodb/arangodb into fea…
gnusi Jan 28, 2022
4fc9103
finally made it to compile
gnusi Jan 28, 2022
2056192
wip
gnusi Jan 28, 2022
9494b11
wip
gnusi Jan 28, 2022
c05e8b0
wip
gnusi Jan 29, 2022
27af8bc
wip
gnusi Jan 29, 2022
f88645b
wip
gnusi Jan 29, 2022
f2db307
wip
gnusi Jan 29, 2022
f501bf9
wip
gnusi Jan 29, 2022
ff9127f
fix tests
gnusi Jan 29, 2022
7ed0620
wip
gnusi Jan 29, 2022
c2e1618
fix compilation
gnusi Jan 29, 2022
638c5e4
fix msvc build
gnusi Jan 29, 2022
6f87d04
remove unused code
gnusi Jan 30, 2022
5ee88e2
wip
gnusi Jan 30, 2022
404aeba
wip
gnusi Jan 30, 2022
e5b992e
wip
gnusi Jan 30, 2022
ae94da2
address review comments
gnusi Jan 30, 2022
00ddb31
wip
gnusi Jan 30, 2022
c4bcb4c
Merge branch 'devel' of https://github.com/arangodb/arangodb into fea…
gnusi Jan 30, 2022
fd95726
wip
gnusi Jan 30, 2022
79e73d8
wip
gnusi Jan 30, 2022
fc8a867
wip
gnusi Jan 30, 2022
7fee8ce
wip
gnusi Jan 31, 2022
0b0aa28
wip
gnusi Jan 31, 2022
db51706
wip
gnusi Jan 31, 2022
068bcf6
Merge branch 'devel' of https://github.com/arangodb/arangodb into fea…
gnusi Jan 31, 2022
a9d6128
wip
gnusi Jan 31, 2022
8f60724
Merge branch 'devel' of https://github.com/arangodb/arangodb into fea…
gnusi Jan 31, 2022
199f11b
wip
gnusi Jan 31, 2022
92ee15b
wip
gnusi Jan 31, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
initial commit
  • Loading branch information
gnusi committed Jan 22, 2022
commit be36dc90c38f101ec8952b571637574942f4424c
9 changes: 0 additions & 9 deletions arangod/Actions/ActionFeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,13 @@
#include "ActionFeature.h"

#include "Actions/actions.h"
#include "ApplicationFeatures/ApplicationServer.h"
#include "FeaturePhases/ClusterFeaturePhase.h"
#include "ProgramOptions/ProgramOptions.h"
#include "ProgramOptions/Section.h"

using namespace arangodb::application_features;
using namespace arangodb::options;

namespace arangodb {

ActionFeature::ActionFeature(application_features::ApplicationServer& server)
: ApplicationFeature(server, "Action"), _allowUseDatabase(false) {
setOptional(true);
startsAfter<ClusterFeaturePhase>();
}

void ActionFeature::collectOptions(std::shared_ptr<ProgramOptions> options) {
options->addOption(
"--server.allow-use-database",
Expand Down
11 changes: 10 additions & 1 deletion arangod/Actions/ActionFeature.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,18 @@

namespace arangodb {

class ClusterFeaturePhase;

class ActionFeature final : public application_features::ApplicationFeature {
public:
explicit ActionFeature(application_features::ApplicationServer& server);
static constexpr std::string_view name() noexcept { return "Action"; }

template<typename Server>
explicit ActionFeature(Server& server)
: ApplicationFeature(server, name()), _allowUseDatabase(false) {
setOptional(true);
startsAfter<ClusterFeaturePhase, Server>();
}

void collectOptions(std::shared_ptr<options::ProgramOptions>) override final;
void unprepare() override final;
Expand Down
24 changes: 0 additions & 24 deletions arangod/Agency/AgencyFeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include "Basics/application-exit.h"
#include "Cluster/ClusterFeature.h"
#include "Endpoint/Endpoint.h"
#include "FeaturePhases/FoxxFeaturePhase.h"
#include "IResearch/IResearchAnalyzerFeature.h"
#include "IResearch/IResearchFeature.h"
#include "Logger/Logger.h"
Expand All @@ -51,29 +50,6 @@ using namespace arangodb::rest;

namespace arangodb {

AgencyFeature::AgencyFeature(application_features::ApplicationServer& server)
: ApplicationFeature(server, "Agency"),
_activated(false),
_size(1),
_poolSize(1),
_minElectionTimeout(1.0),
_maxElectionTimeout(5.0),
_supervision(false),
_supervisionTouched(false),
_waitForSync(true),
_supervisionFrequency(1.0),
_compactionStepSize(1000),
_compactionKeepSize(50000),
_maxAppendSize(250),
_supervisionGracePeriod(10.0),
_supervisionOkThreshold(5.0),
_cmdLineTimings(false) {
setOptional(true);
startsAfter<FoxxFeaturePhase>();
}

AgencyFeature::~AgencyFeature() = default;

void AgencyFeature::collectOptions(std::shared_ptr<ProgramOptions> options) {
options->addSection("agency", "agency");

Expand Down
29 changes: 27 additions & 2 deletions arangod/Agency/AgencyFeature.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,40 @@
#include "ApplicationFeatures/ApplicationFeature.h"

namespace arangodb {
namespace application_features {
class FoxxFeaturePhase;
}

namespace consensus {
class Agent;
}

class AgencyFeature : public application_features::ApplicationFeature {
public:
explicit AgencyFeature(application_features::ApplicationServer& server);
~AgencyFeature();
static constexpr std::string_view name() { return "Agency"; }

template<typename Server>
explicit AgencyFeature(Server& server)
: ApplicationFeature(server, Server::template id<AgencyFeature>(),
name()),
_activated(false),
_size(1),
_poolSize(1),
_minElectionTimeout(1.0),
_maxElectionTimeout(5.0),
_supervision(false),
_supervisionTouched(false),
_waitForSync(true),
_supervisionFrequency(1.0),
_compactionStepSize(1000),
_compactionKeepSize(50000),
_maxAppendSize(250),
_supervisionGracePeriod(10.0),
_supervisionOkThreshold(5.0),
_cmdLineTimings(false) {
setOptional(true);
startsAfter<application_features::FoxxFeaturePhase, Server>();
}

void collectOptions(std::shared_ptr<options::ProgramOptions>) override final;
void validateOptions(std::shared_ptr<options::ProgramOptions>) override final;
Expand Down
4 changes: 4 additions & 0 deletions arangod/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1162,6 +1162,10 @@ target_link_libraries(${BIN_ARANGOD}
arangoserver
)

target_include_directories(${BIN_ARANGOD}
PUBLIC ${IRESEARCH_INCLUDE}
)

target_compile_features(${BIN_ARANGOD} PRIVATE cxx_constexpr)

install(
Expand Down
32 changes: 13 additions & 19 deletions arangod/Cluster/ClusterFeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,15 @@ struct ClusterFeatureScale {
DECLARE_HISTOGRAM(arangodb_agencycomm_request_time_msec, ClusterFeatureScale,
"Request time for Agency requests [ms]");

ClusterFeature::ClusterFeature(application_features::ApplicationServer& server)
: ApplicationFeature(server, "Cluster"),
ClusterFeature::ClusterFeature(application_features::ApplicationServer& server,
metrics::MetricsFeature& metrics,
DatabaseFeature& database, size_t registration)
: ApplicationFeature(server, registration, name()),
_apiJwtPolicy("jwt-compat"),
_agency_comm_request_time_ms(
server.getFeature<metrics::MetricsFeature>().add(
arangodb_agencycomm_request_time_msec{})) {
setOptional(true);
startsAfter<CommunicationFeaturePhase>();
startsAfter<DatabaseFeaturePhase>();
}
metrics.add(arangodb_agencycomm_request_time_msec{})),
_metrics{metrics},
_database{database} {}

ClusterFeature::~ClusterFeature() {
if (_enableCluster) {
Expand Down Expand Up @@ -504,8 +503,7 @@ void ClusterFeature::prepare() {

reportRole(_requestedRole);

network::ConnectionPool::Config config(
server().getFeature<metrics::MetricsFeature>());
network::ConnectionPool::Config config(_metrics);
config.numIOThreads = 2u;
config.maxOpenConnections = 2;
config.idleConnectionMilli = 10000;
Expand Down Expand Up @@ -653,17 +651,13 @@ void ClusterFeature::start() {

if (role == ServerState::RoleEnum::ROLE_DBSERVER) {
_followersDroppedCounter =
&server().getFeature<metrics::MetricsFeature>().add(
arangodb_dropped_followers_total{});
&_metrics.add(arangodb_dropped_followers_total{});
_followersRefusedCounter =
&server().getFeature<metrics::MetricsFeature>().add(
arangodb_refused_followers_total{});
&_metrics.add(arangodb_refused_followers_total{});
_followersWrongChecksumCounter =
&server().getFeature<metrics::MetricsFeature>().add(
arangodb_sync_wrong_checksum_total{});
&_metrics.add(arangodb_sync_wrong_checksum_total{});
_followersTotalRebuildCounter =
&server().getFeature<metrics::MetricsFeature>().add(
arangodb_sync_rebuilds_total{});
&_metrics.add(arangodb_sync_rebuilds_total{});
}

LOG_TOPIC("b6826", INFO, arangodb::Logger::CLUSTER)
Expand Down Expand Up @@ -973,7 +967,7 @@ bool ClusterFeature::isDirty(std::string const& dbName) const {

std::unordered_set<std::string> ClusterFeature::allDatabases() const {
std::unordered_set<std::string> allDBNames;
auto const tmp = server().getFeature<DatabaseFeature>().getDatabaseNames();
auto const tmp = _database.getDatabaseNames();
allDBNames.reserve(tmp.size());
for (auto const& i : tmp) {
allDBNames.emplace(i);
Expand Down
25 changes: 25 additions & 0 deletions arangod/Cluster/ClusterFeature.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,34 @@
#include "Metrics/Fwd.h"

namespace arangodb {
namespace application_features {
class CommunicationFeaturePhase;
class DatabaseFeaturePhase;
} // namespace application_features
namespace metrics {
class MetricsFeature;
}

class AgencyCache;
class AgencyCallbackRegistry;
class DatabaseFeature;
class HeartbeatThread;

class ClusterFeature : public application_features::ApplicationFeature {
public:
explicit ClusterFeature(application_features::ApplicationServer& server);

static constexpr std::string_view name() noexcept { return "Cluster"; }

template<typename Server>
explicit ClusterFeature(Server& server)
: ClusterFeature(server, server.getFeature<metrics::MetricsFeature>(),
Server::template id<ClusterFeature>()) {
setOptional(true);
startsAfter<application_features::CommunicationFeaturePhase>();
startsAfter<application_features::DatabaseFeaturePhase>();
}

~ClusterFeature();

void collectOptions(std::shared_ptr<options::ProgramOptions>) override final;
Expand Down Expand Up @@ -174,6 +194,9 @@ class ClusterFeature : public application_features::ApplicationFeature {
std::string const& endpoints);

private:
ClusterFeature(application_features::ApplicationServer& server,
gnusi marked this conversation as resolved.
Show resolved Hide resolved
metrics::MetricsFeature& metrics, DatabaseFeature& database,
size_t registration);
void reportRole(ServerState::RoleEnum);

std::vector<std::string> _agencyEndpoints;
Expand Down Expand Up @@ -216,6 +239,8 @@ class ClusterFeature : public application_features::ApplicationFeature {
metrics::Counter* _followersWrongChecksumCounter = nullptr;
metrics::Counter* _followersTotalRebuildCounter = nullptr;
std::shared_ptr<AgencyCallback> _hotbackupRestoreCallback;
metrics::MetricsFeature& _metrics;
DatabaseFeature& _database;

/// @brief lock for dirty database list
mutable arangodb::Mutex _dirtyLock;
Expand Down
17 changes: 0 additions & 17 deletions arangod/FeaturePhases/AgencyFeaturePhase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,3 @@
////////////////////////////////////////////////////////////////////////////////

#include "AgencyFeaturePhase.h"

#include "Agency/AgencyFeature.h"
#include "FeaturePhases/FoxxFeaturePhase.h"

namespace arangodb {
namespace application_features {

AgencyFeaturePhase::AgencyFeaturePhase(ApplicationServer& server)
: ApplicationFeaturePhase(server, "AgencyPhase") {
setOptional(false);
startsAfter<FoxxFeaturePhase>();

startsAfter<AgencyFeature>();
}

} // namespace application_features
} // namespace arangodb
14 changes: 13 additions & 1 deletion arangod/FeaturePhases/AgencyFeaturePhase.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,21 @@
namespace arangodb {
namespace application_features {

class AgencyFeature;
class FoxxFeaturePhase;

class AgencyFeaturePhase : public ApplicationFeaturePhase {
public:
explicit AgencyFeaturePhase(ApplicationServer& server);
static constexpr std::string_view name() noexcept { return "AgencyPhase"; }

template<typename Server>
explicit AgencyFeaturePhase(Server& server)
: ApplicationFeaturePhase(
server, Server::template id<AgencyFeaturePhase>(), name()) {
setOptional(false);
startsAfter<FoxxFeaturePhase, Server>();
startsAfter<AgencyFeature, Server>();
}
};

} // namespace application_features
Expand Down
33 changes: 0 additions & 33 deletions arangod/FeaturePhases/AqlFeaturePhase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,36 +22,3 @@
////////////////////////////////////////////////////////////////////////////////

#include "AqlFeaturePhase.h"

#include "ApplicationFeatures/CommunicationFeaturePhase.h"
#include "Aql/AqlFunctionFeature.h"
#include "Aql/OptimizerRulesFeature.h"
#include "FeaturePhases/V8FeaturePhase.h"
#include "IResearch/IResearchAnalyzerFeature.h"
#include "IResearch/IResearchFeature.h"
#include "Pregel/PregelFeature.h"
#include "RestServer/AqlFeature.h"
#include "RestServer/QueryRegistryFeature.h"
#include "RestServer/SystemDatabaseFeature.h"

namespace arangodb {
namespace application_features {

AqlFeaturePhase::AqlFeaturePhase(ApplicationServer& server)
: ApplicationFeaturePhase(server, "AQLPhase") {
setOptional(false);
startsAfter<CommunicationFeaturePhase>();
startsAfter<V8FeaturePhase>();

startsAfter<AqlFeature>();
startsAfter<aql::AqlFunctionFeature>();
startsAfter<iresearch::IResearchAnalyzerFeature>();
startsAfter<iresearch::IResearchFeature>();
startsAfter<aql::OptimizerRulesFeature>();
startsAfter<pregel::PregelFeature>();
startsAfter<QueryRegistryFeature>();
startsAfter<SystemDatabaseFeature>();
}

} // namespace application_features
} // namespace arangodb
38 changes: 37 additions & 1 deletion arangod/FeaturePhases/AqlFeaturePhase.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,47 @@
#include "ApplicationFeatures/ApplicationFeaturePhase.h"

namespace arangodb {
namespace aql {
class AqlFunctionFeature;
class OptimizerRulesFeature;
} // namespace aql
namespace iresearch {

class IResearchAnalyzerFeature;
class IResearchFeature;
} // namespace iresearch
namespace pregel {
class PregelFeature;
}
namespace application_features {

class CommunicationFeaturePhase;
class V8FeaturePhase;
class AqlFeature;
class SystemDatabaseFeature;
class QueryRegistryFeature;

class AqlFeaturePhase : public ApplicationFeaturePhase {
public:
explicit AqlFeaturePhase(ApplicationServer& server);
static constexpr std::string_view name() noexcept { return "AQLPhase"; }

template<typename Server>
explicit AqlFeaturePhase(Server& server)
: ApplicationFeaturePhase(server, Server::template id<AqlFeaturePhase>(),
name()) {
setOptional(false);
startsAfter<CommunicationFeaturePhase, Server>();
startsAfter<V8FeaturePhase, Server>();

startsAfter<AqlFeature, Server>();
startsAfter<aql::AqlFunctionFeature, Server>();
startsAfter<iresearch::IResearchAnalyzerFeature, Server>();
startsAfter<iresearch::IResearchFeature, Server>();
startsAfter<aql::OptimizerRulesFeature, Server>();
startsAfter<pregel::PregelFeature, Server>();
startsAfter<QueryRegistryFeature, Server>();
startsAfter<SystemDatabaseFeature, Server>();
}
};

} // namespace application_features
Expand Down
Loading