1
0
Fork 0

Reload Foxx routes during startup (#7531)

This commit is contained in:
Tobias Gödderz 2018-11-29 15:31:40 +01:00 committed by Michael Hackstein
parent 401fc901fa
commit f61ccd4047
5 changed files with 10 additions and 11 deletions

View File

@ -686,7 +686,7 @@ void HeartbeatThread::runSingleServer() {
// ensure everyone has server access // ensure everyone has server access
ServerState::instance()->setFoxxmaster(_myId); ServerState::instance()->setFoxxmaster(_myId);
auto prv = ServerState::instance()->setServerMode(ServerState::Mode::DEFAULT); auto prv = ServerState::setServerMode(ServerState::Mode::DEFAULT);
if (prv == ServerState::Mode::REDIRECT) { if (prv == ServerState::Mode::REDIRECT) {
LOG_TOPIC(INFO, Logger::HEARTBEAT) << "Successful leadership takeover: " LOG_TOPIC(INFO, Logger::HEARTBEAT) << "Successful leadership takeover: "
<< "All your base are belong to us"; << "All your base are belong to us";

View File

@ -851,7 +851,7 @@ bool ServerState::checkCoordinatorState(StateEnum state) {
return false; return false;
} }
bool ServerState::isFoxxmaster() { bool ServerState::isFoxxmaster() const {
return /*!isRunningInCluster() ||*/ _foxxmaster == getId(); return /*!isRunningInCluster() ||*/ _foxxmaster == getId();
} }
@ -864,7 +864,9 @@ void ServerState::setFoxxmaster(std::string const& foxxmaster) {
} }
} }
bool ServerState::getFoxxmasterQueueupdate() { return _foxxmasterQueueupdate; } bool ServerState::getFoxxmasterQueueupdate() const noexcept {
return _foxxmasterQueueupdate;
}
void ServerState::setFoxxmasterQueueupdate(bool value) { void ServerState::setFoxxmasterQueueupdate(bool value) {
_foxxmasterQueueupdate = value; _foxxmasterQueueupdate = value;

View File

@ -237,7 +237,7 @@ class ServerState {
/// @brief sets the JavaScript startup path /// @brief sets the JavaScript startup path
void setJavaScriptPath(std::string const&); void setJavaScriptPath(std::string const&);
bool isFoxxmaster(); bool isFoxxmaster() const;
std::string const& getFoxxmaster(); std::string const& getFoxxmaster();
@ -245,7 +245,7 @@ class ServerState {
void setFoxxmasterQueueupdate(bool); void setFoxxmasterQueueupdate(bool);
bool getFoxxmasterQueueupdate(); bool getFoxxmasterQueueupdate() const noexcept;
std::string getPersistedId(); std::string getPersistedId();
bool hasPersistedId(); bool hasPersistedId();
@ -279,9 +279,6 @@ class ServerState {
/// @brief write the Current/ServersRegistered entry /// @brief write the Current/ServersRegistered entry
bool registerAtAgencyPhase2(AgencyComm&); bool registerAtAgencyPhase2(AgencyComm&);
/// @brief register shortname for an id
bool registerShortName(std::string const& id, const RoleEnum&);
private: private:
/// @brief server role /// @brief server role

View File

@ -320,10 +320,10 @@ void BootstrapFeature::start() {
if (ServerState::isSingleServer(role) && AgencyCommManager::isEnabled()) { if (ServerState::isSingleServer(role) && AgencyCommManager::isEnabled()) {
// simon: this is set to correct value in the heartbeat thread // simon: this is set to correct value in the heartbeat thread
ServerState::instance()->setServerMode(ServerState::Mode::TRYAGAIN); ServerState::setServerMode(ServerState::Mode::TRYAGAIN);
} else { } else {
// Start service properly: // Start service properly:
ServerState::instance()->setServerMode(ServerState::Mode::DEFAULT); ServerState::setServerMode(ServerState::Mode::DEFAULT);
} }
LOG_TOPIC(INFO, arangodb::Logger::FIXME) << "ArangoDB (version " << ARANGODB_VERSION_FULL LOG_TOPIC(INFO, arangodb::Logger::FIXME) << "ArangoDB (version " << ARANGODB_VERSION_FULL

View File

@ -309,7 +309,7 @@ function startup () {
if (global.ArangoServerState.role() === 'SINGLE') { if (global.ArangoServerState.role() === 'SINGLE') {
commitLocalState(true); commitLocalState(true);
} }
selfHealAll(true); selfHealAll();
} }
function upsertSystemServices () { function upsertSystemServices () {