Add server version to status json

This commit is contained in:
Bharadwaj V.R 2022-04-13 08:23:02 -07:00
parent 2f2ece073c
commit 831bee34f8
2 changed files with 9 additions and 1 deletions

View File

@ -695,6 +695,7 @@ const KeyRef JSONSchemas::statusSchema = LiteralStringRef(R"statusSchema(
},
"cluster_controller_timestamp":1415650089,
"protocol_version":"fdb00a400050001",
"latest_server_version":"fdb00a500040001",
"connection_string":"a:a@127.0.0.1:4000",
"full_replication":true,
"maintenance_zone":"0ccb4e0fdbdb5583010f6b77d9d10ece",

View File

@ -24,6 +24,7 @@
#include "fdbclient/KeyBackedTypes.h"
#include "fdbserver/Status.h"
#include "flow/ITrace.h"
#include "flow/ProtocolVersion.h"
#include "flow/Trace.h"
#include "fdbclient/NativeAPI.actor.h"
#include "fdbclient/SystemData.h"
@ -1527,6 +1528,10 @@ ACTOR static Future<Void> logRangeWarningFetcher(Database cx,
return Void();
}
ACTOR Future<ProtocolVersion> getLatestSoftwareVersion(Database cx) {
return currentProtocolVersion;
}
struct LoadConfigurationResult {
bool fullReplication;
Optional<Key> healthyZone;
@ -2917,7 +2922,9 @@ ACTOR Future<StatusReply> clusterGetStatus(
statusObj["protocol_version"] = format("%" PRIx64, g_network->protocolVersion().version());
statusObj["connection_string"] = coordinators.ccr->getConnectionString().toString();
statusObj["bounce_impact"] = getBounceImpactInfo(statusCode);
// statusObj["latest_server_version"] = format("%" PRIx64, latestServerVersion.version());
ProtocolVersion latestServerVersion = wait(getLatestSoftwareVersion(cx));
statusObj["latest_server_version"] = format("%" PRIx64, latestServerVersion.version());
state Optional<DatabaseConfiguration> configuration;
state Optional<LoadConfigurationResult> loadResult;