diff options
author | Luxi Liu <luxi.liu@mongodb.com> | 2022-08-19 18:57:17 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-08-19 20:05:12 +0000 |
commit | bcebd12f2e6492eef7f609d8b234f81e92c2f683 (patch) | |
tree | d2a81560f9836be142684f85d5f10d3d68318eef /src/mongo | |
parent | 712a3e7a91c460adaa31e3583f02094caceb809a (diff) | |
download | mongo-bcebd12f2e6492eef7f609d8b234f81e92c2f683.tar.gz |
SERVER-67443 added logging for fcv up/downgrade in set_feature_compatibility_version_command.cpp && created set_fcv_logging.js
Diffstat (limited to 'src/mongo')
-rw-r--r-- | src/mongo/db/commands/set_feature_compatibility_version_command.cpp | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/src/mongo/db/commands/set_feature_compatibility_version_command.cpp b/src/mongo/db/commands/set_feature_compatibility_version_command.cpp index 6ce53c6258b..d548b8b446d 100644 --- a/src/mongo/db/commands/set_feature_compatibility_version_command.cpp +++ b/src/mongo/db/commands/set_feature_compatibility_version_command.cpp @@ -317,6 +317,20 @@ public: return true; } + const auto upgradeOrDowngrade = requestedVersion > actualVersion ? "upgrade" : "downgrade"; + const auto server_type = serverGlobalParams.clusterRole == ClusterRole::ConfigServer + ? "config server" + : (request.getPhase() ? "shard server" : "replica set/standalone"); + + if (!request.getPhase() || request.getPhase() == SetFCVPhaseEnum::kStart) { + LOGV2(6744300, + "setFeatureCompatibilityVersion command called", + "upgradeOrDowngrade"_attr = upgradeOrDowngrade, + "serverType"_attr = server_type, + "fromVersion"_attr = actualVersion, + "toVersion"_attr = requestedVersion); + } + const boost::optional<Timestamp> changeTimestamp = getChangeTimestamp(opCtx, request); FeatureCompatibilityVersion::validateSetFeatureCompatibilityVersionRequest( @@ -336,7 +350,8 @@ public: FeatureCompatibilityVersion::enterFCVChangeRegion(opCtx)); uassert(ErrorCodes::Error(6744303), - "Failing upgrade due to 'failBeforeTransitioning' failpoint set", + "Failing setFeatureCompatibilityVersion before reaching the FCV " + "transitional stage due to 'failBeforeTransitioning' failpoint set", !failBeforeTransitioning.shouldFail()); FeatureCompatibilityVersion::updateFeatureCompatibilityVersionDocument( @@ -346,6 +361,13 @@ public: isFromConfigServer, changeTimestamp, true /* setTargetVersion */); + + LOGV2(6744301, + "setFeatureCompatibilityVersion has set the FCV to the transitional state", + "upgradeOrDowngrade"_attr = upgradeOrDowngrade, + "serverType"_attr = server_type, + "fromVersion"_attr = actualVersion, + "toVersion"_attr = requestedVersion); } if (request.getPhase() == SetFCVPhaseEnum::kStart) { @@ -414,6 +436,13 @@ public: false /* setTargetVersion */); } + LOGV2(6744302, + "setFeatureCompatibilityVersion succeeded", + "upgradeOrDowngrade"_attr = upgradeOrDowngrade, + "serverType"_attr = server_type, + "fromVersion"_attr = actualVersion, + "toVersion"_attr = requestedVersion); + return true; } |