mirror of https://gitee.com/bigwinds/arangodb
Do not check isEnabled (#8997)
This commit is contained in:
parent
93b2e64f37
commit
394c070a4f
|
@ -254,9 +254,7 @@ void AgencyFeature::validateOptions(std::shared_ptr<ProgramOptions> options) {
|
|||
}
|
||||
|
||||
void AgencyFeature::prepare() {
|
||||
if (!isEnabled()) {
|
||||
return;
|
||||
}
|
||||
TRI_ASSERT(isEnabled());
|
||||
|
||||
// Available after validateOptions of ClusterFeature
|
||||
// Find the agency prefix:
|
||||
|
@ -306,9 +304,7 @@ void AgencyFeature::prepare() {
|
|||
}
|
||||
|
||||
void AgencyFeature::start() {
|
||||
if (!isEnabled()) {
|
||||
return;
|
||||
}
|
||||
TRI_ASSERT(isEnabled());
|
||||
|
||||
LOG_TOPIC("a77c8", DEBUG, Logger::AGENCY) << "Starting agency personality";
|
||||
_agent->start();
|
||||
|
@ -318,18 +314,14 @@ void AgencyFeature::start() {
|
|||
}
|
||||
|
||||
void AgencyFeature::beginShutdown() {
|
||||
if (!isEnabled()) {
|
||||
return;
|
||||
}
|
||||
TRI_ASSERT(isEnabled());
|
||||
|
||||
// pass shutdown event to _agent so it can notify all its sub-threads
|
||||
_agent->beginShutdown();
|
||||
}
|
||||
|
||||
void AgencyFeature::stop() {
|
||||
if (!isEnabled()) {
|
||||
return;
|
||||
}
|
||||
TRI_ASSERT(isEnabled());
|
||||
|
||||
if (_agent->inception() != nullptr) { // can only exist in resilient agents
|
||||
int counter = 0;
|
||||
|
@ -363,9 +355,7 @@ void AgencyFeature::stop() {
|
|||
}
|
||||
|
||||
void AgencyFeature::unprepare() {
|
||||
if (!isEnabled()) {
|
||||
return;
|
||||
}
|
||||
TRI_ASSERT(isEnabled());
|
||||
// delete the Agent object here ensures it shuts down all of its threads
|
||||
// this is a precondition that it must fulfill before we can go on with the
|
||||
// shutdown
|
||||
|
|
|
@ -992,9 +992,7 @@ void IResearchFeature::collectOptions(std::shared_ptr<arangodb::options::Program
|
|||
/*static*/ std::string const& IResearchFeature::name() { return FEATURE_NAME; }
|
||||
|
||||
void IResearchFeature::prepare() {
|
||||
if (!isEnabled()) {
|
||||
return;
|
||||
}
|
||||
TRI_ASSERT(isEnabled());
|
||||
|
||||
_running.store(false);
|
||||
ApplicationFeature::prepare();
|
||||
|
@ -1033,9 +1031,7 @@ void IResearchFeature::prepare() {
|
|||
}
|
||||
|
||||
void IResearchFeature::start() {
|
||||
if (!isEnabled()) {
|
||||
return;
|
||||
}
|
||||
TRI_ASSERT(isEnabled());
|
||||
|
||||
ApplicationFeature::start();
|
||||
|
||||
|
@ -1061,18 +1057,13 @@ void IResearchFeature::start() {
|
|||
}
|
||||
|
||||
void IResearchFeature::stop() {
|
||||
if (!isEnabled()) {
|
||||
return;
|
||||
}
|
||||
TRI_ASSERT(isEnabled());
|
||||
_running.store(false);
|
||||
ApplicationFeature::stop();
|
||||
}
|
||||
|
||||
void IResearchFeature::unprepare() {
|
||||
if (!isEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
TRI_ASSERT(isEnabled());
|
||||
_running.store(false);
|
||||
ApplicationFeature::unprepare();
|
||||
}
|
||||
|
|
|
@ -355,9 +355,7 @@ void RocksDBEngine::prepare() {
|
|||
|
||||
void RocksDBEngine::start() {
|
||||
// it is already decided that rocksdb is used
|
||||
if (!isEnabled()) {
|
||||
return;
|
||||
}
|
||||
TRI_ASSERT(isEnabled());
|
||||
|
||||
if (ServerState::instance()->isAgent() &&
|
||||
!application_features::ApplicationServer::server->options()->processingResult().touched("rocksdb.wal-file-timeout-initial")) {
|
||||
|
@ -752,9 +750,7 @@ void RocksDBEngine::start() {
|
|||
}
|
||||
|
||||
void RocksDBEngine::beginShutdown() {
|
||||
if (!isEnabled()) {
|
||||
return;
|
||||
}
|
||||
TRI_ASSERT(isEnabled());
|
||||
|
||||
// block the creation of new replication contexts
|
||||
if (_replicationManager != nullptr) {
|
||||
|
@ -763,10 +759,8 @@ void RocksDBEngine::beginShutdown() {
|
|||
}
|
||||
|
||||
void RocksDBEngine::stop() {
|
||||
if (!isEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
TRI_ASSERT(isEnabled());
|
||||
|
||||
// in case we missed the beginShutdown somehow, call it again
|
||||
replicationManager()->beginShutdown();
|
||||
replicationManager()->dropAll();
|
||||
|
@ -799,10 +793,7 @@ void RocksDBEngine::stop() {
|
|||
}
|
||||
|
||||
void RocksDBEngine::unprepare() {
|
||||
if (!isEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
TRI_ASSERT(isEnabled());
|
||||
shutdownRocksDBInstance();
|
||||
}
|
||||
|
||||
|
|
|
@ -83,10 +83,8 @@ RocksDBRecoveryManager::RocksDBRecoveryManager(application_features::Application
|
|||
}
|
||||
|
||||
void RocksDBRecoveryManager::start() {
|
||||
if (!isEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
TRI_ASSERT(isEnabled());
|
||||
|
||||
_db = ApplicationServer::getFeature<RocksDBEngine>("RocksDBEngine")->db();
|
||||
runRecovery();
|
||||
// synchronizes with acquire inRecovery()
|
||||
|
|
|
@ -160,9 +160,7 @@ void StatisticsFeature::prepare() {
|
|||
}
|
||||
|
||||
void StatisticsFeature::start() {
|
||||
if (!isEnabled()) {
|
||||
return;
|
||||
}
|
||||
TRI_ASSERT(isEnabled());
|
||||
|
||||
auto* sysDbFeature =
|
||||
arangodb::application_features::ApplicationServer::lookupFeature<arangodb::SystemDatabaseFeature>();
|
||||
|
|
|
@ -717,6 +717,9 @@ void ApplicationServer::unprepare() {
|
|||
|
||||
for (auto it = _orderedFeatures.rbegin(); it != _orderedFeatures.rend(); ++it) {
|
||||
auto feature = *it;
|
||||
if (!feature->isEnabled()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
LOG_TOPIC("98be4", TRACE, Logger::STARTUP) << feature->name() << "::unprepare";
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue