diff options
Diffstat (limited to 'src/mongo/db/commands/feature_compatibility_version.cpp')
-rw-r--r-- | src/mongo/db/commands/feature_compatibility_version.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/mongo/db/commands/feature_compatibility_version.cpp b/src/mongo/db/commands/feature_compatibility_version.cpp index 7798cd2d2a6..78b2f6321af 100644 --- a/src/mongo/db/commands/feature_compatibility_version.cpp +++ b/src/mongo/db/commands/feature_compatibility_version.cpp @@ -421,7 +421,7 @@ void FeatureCompatibilityVersion::initializeForStartup(OperationContext* opCtx) invariant(opCtx->lockState()->isW()); auto featureCompatibilityVersion = findFeatureCompatibilityVersionDocument(opCtx); if (!featureCompatibilityVersion) { - LOGV2(5853303, "featureCompatibilityVersion document missing at startup"); + FeatureCompatibilityVersion::logFCVWithContext("startup"_sd); return; } @@ -448,10 +448,7 @@ void FeatureCompatibilityVersion::initializeForStartup(OperationContext* opCtx) serverGlobalParams.mutableFeatureCompatibility.setVersion(version); FeatureCompatibilityVersion::updateMinWireVersion(); - LOGV2(5853300, - "Intializing featureCompatibilityVersion at startup", - "featureCompatibilityVersion"_attr = - multiversion::toString(serverGlobalParams.featureCompatibility.getVersion())); + FeatureCompatibilityVersion::logFCVWithContext("startup"_sd); // On startup, if the version is in an upgrading or downgrading state, print a warning. if (serverGlobalParams.featureCompatibility.isUpgradingOrDowngrading()) { @@ -520,6 +517,19 @@ void FeatureCompatibilityVersion::clearLastFCVUpdateTimestamp() { lastFCVUpdateTimestamp = Timestamp(); } +void FeatureCompatibilityVersion::logFCVWithContext(StringData context) { + LOGV2_OPTIONS( + 5853300, + {logv2::LogComponent::kReplication}, + "current featureCompatibilityVersion value", + "featureCompatibilityVersion"_attr = + serverGlobalParams.featureCompatibility.isVersionInitialized() + ? multiversion::toString(serverGlobalParams.featureCompatibility.getVersion()) + : multiversion::toString( + multiversion::FeatureCompatibilityVersion::kUnsetDefaultLastLTSBehavior), + "context"_attr = context); +} + /** * Read-only server parameter for featureCompatibilityVersion. |