1
0
Fork 0

Register version and storage engine info in agency to facilitate rolling upgrades (#6062)

This commit is contained in:
Dan Larkin-York 2018-08-03 03:46:42 -04:00 committed by Jan
parent 1ffcfd63ba
commit fc7976b92d
2 changed files with 42 additions and 25 deletions

View File

@ -35,10 +35,12 @@
#include "Logger/Logger.h" #include "Logger/Logger.h"
#include "ProgramOptions/ProgramOptions.h" #include "ProgramOptions/ProgramOptions.h"
#include "ProgramOptions/Section.h" #include "ProgramOptions/Section.h"
#include "Rest/Version.h"
#include "RestServer/DatabaseFeature.h" #include "RestServer/DatabaseFeature.h"
#include "Scheduler/Scheduler.h" #include "Scheduler/Scheduler.h"
#include "Scheduler/SchedulerFeature.h" #include "Scheduler/SchedulerFeature.h"
#include "SimpleHttpClient/ConnectionManager.h" #include "SimpleHttpClient/ConnectionManager.h"
#include "StorageEngine/EngineSelectorFeature.h"
#include "V8Server/V8DealerFeature.h" #include "V8Server/V8DealerFeature.h"
using namespace arangodb; using namespace arangodb;
@ -445,6 +447,8 @@ void ClusterFeature::start() {
VPackObjectBuilder b(&builder); VPackObjectBuilder b(&builder);
builder.add("endpoint", VPackValue(_myAddress)); builder.add("endpoint", VPackValue(_myAddress));
builder.add("host", VPackValue(ServerState::instance()->getHost())); builder.add("host", VPackValue(ServerState::instance()->getHost()));
builder.add("version", VPackValue(rest::Version::getNumericServerVersion()));
builder.add("storageEngine", VPackValue(EngineSelectorFeature::engineName()));
} catch (...) { } catch (...) {
LOG_TOPIC(FATAL, arangodb::Logger::CLUSTER) << "out of memory"; LOG_TOPIC(FATAL, arangodb::Logger::CLUSTER) << "out of memory";
FATAL_ERROR_EXIT(); FATAL_ERROR_EXIT();

View File

@ -220,7 +220,21 @@ int32_t Version::getNumericServerVersion() {
TRI_ASSERT((*p == '.' || *p == '-' || *p == '\0') && p != apiVersion); TRI_ASSERT((*p == '.' || *p == '-' || *p == '\0') && p != apiVersion);
int32_t minor = TRI_Int32String(apiVersion, (p - apiVersion)); int32_t minor = TRI_Int32String(apiVersion, (p - apiVersion));
return (int32_t)(minor * 100L + major * 10000L); int32_t patch = 0;
if (*p == '.') {
apiVersion = ++p;
// read minor version
while (*p >= '0' && *p <= '9') {
++p;
}
if (p != apiVersion) {
patch = TRI_Int32String(apiVersion, (p - apiVersion));
}
}
return (int32_t)(patch + minor * 100L + major * 10000L);
} }
/// @brief get server version /// @brief get server version
@ -409,4 +423,3 @@ void Version::getVPack(VPackBuilder& dst) {
} }
} }
} }