From 831bee34f87e5efc90000e3ffb05ab56bbffc313 Mon Sep 17 00:00:00 2001 From: "Bharadwaj V.R" Date: Wed, 13 Apr 2022 08:23:02 -0700 Subject: [PATCH] Add server version to status json --- fdbclient/Schemas.cpp | 1 + fdbserver/Status.actor.cpp | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/fdbclient/Schemas.cpp b/fdbclient/Schemas.cpp index fbfd81558f..3f9dc7d518 100644 --- a/fdbclient/Schemas.cpp +++ b/fdbclient/Schemas.cpp @@ -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", diff --git a/fdbserver/Status.actor.cpp b/fdbserver/Status.actor.cpp index 0be742c3c2..94651e092b 100644 --- a/fdbserver/Status.actor.cpp +++ b/fdbserver/Status.actor.cpp @@ -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 logRangeWarningFetcher(Database cx, return Void(); } +ACTOR Future getLatestSoftwareVersion(Database cx) { + return currentProtocolVersion; +} + struct LoadConfigurationResult { bool fullReplication; Optional healthyZone; @@ -2917,7 +2922,9 @@ ACTOR Future 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 configuration; state Optional loadResult;