diff options
Diffstat (limited to 'src')
30 files changed, 175 insertions, 221 deletions
diff --git a/src/mongo/db/catalog/coll_mod.cpp b/src/mongo/db/catalog/coll_mod.cpp index afb64d12476..49382234f0a 100644 --- a/src/mongo/db/catalog/coll_mod.cpp +++ b/src/mongo/db/catalog/coll_mod.cpp @@ -174,14 +174,14 @@ StatusWith<CollModRequest> parseCollModRequest(OperationContext* opCtx, // Save this to a variable to avoid reading the atomic variable multiple times. const auto currentFCV = serverGlobalParams.featureCompatibility.getVersion(); - // If the feature compatibility version is not 4.4, and we are validating features as - // master, ban the use of new agg features introduced in 4.4 to prevent them from being + // If the feature compatibility version is not 4.6, and we are validating features as + // master, ban the use of new agg features introduced in 4.6 to prevent them from being // persisted in the catalog. boost::optional<ServerGlobalParams::FeatureCompatibility::Version> maxFeatureCompatibilityVersion; if (serverGlobalParams.validateFeaturesAsMaster.load() && currentFCV != - ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo44) { + ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo46) { maxFeatureCompatibilityVersion = currentFCV; } auto statusW = coll->parseValidator(opCtx, diff --git a/src/mongo/db/catalog/database_impl.cpp b/src/mongo/db/catalog/database_impl.cpp index 1f0de2724b0..08472f8d1e7 100644 --- a/src/mongo/db/catalog/database_impl.cpp +++ b/src/mongo/db/catalog/database_impl.cpp @@ -897,11 +897,11 @@ Status DatabaseImpl::userCreateNS(OperationContext* opCtx, // Save this to a variable to avoid reading the atomic variable multiple times. const auto currentFCV = serverGlobalParams.featureCompatibility.getVersion(); - // If the feature compatibility version is not 4.4, and we are validating features as - // master, ban the use of new agg features introduced in 4.4 to prevent them from being + // If the feature compatibility version is not 4.6, and we are validating features as + // master, ban the use of new agg features introduced in 4.6 to prevent them from being // persisted in the catalog. if (serverGlobalParams.validateFeaturesAsMaster.load() && - currentFCV != ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo44) { + currentFCV != ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo46) { expCtx->maxFeatureCompatibilityVersion = currentFCV; } diff --git a/src/mongo/db/commands/dbhash.cpp b/src/mongo/db/commands/dbhash.cpp index 0f867bc0a30..90b55043905 100644 --- a/src/mongo/db/commands/dbhash.cpp +++ b/src/mongo/db/commands/dbhash.cpp @@ -230,32 +230,8 @@ public: return false; } - // Only hash replicated collections. In 4.4 we use a more general way of choosing what - // collections are replicated. This means that mixed 4.2-4.4 replica sets could hash the - // same database differently, even when all nodes are up-to-date. We only use the new - // method for choosing collections to hash in FCV 4.4 so that when all nodes are - // up-to-date, it is guaranteed that they hash the same set of collections. - if (serverGlobalParams.featureCompatibility.getVersion() == - ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo44) { - if (repl::ReplicationCoordinator::isOplogDisabledForNS(collNss)) { - return true; - } - } else { - // A set of 'system' collections that are replicated, and therefore included in the - // db hash. - const std::set<StringData> replicatedSystemCollections{"system.backup_users", - "system.js", - "system.new_users", - "system.roles", - "system.users", - "system.version", - "system.views"}; - // Only include 'system' collections that are replicated. - bool isReplicatedSystemColl = - (replicatedSystemCollections.count(collNss.coll().toString()) > 0); - if (collNss.isSystem() && !isReplicatedSystemColl) { - return true; - } + if (repl::ReplicationCoordinator::isOplogDisabledForNS(collNss)) { + return true; } if (collNss.coll().startsWith("tmp.mr.")) { diff --git a/src/mongo/db/commands/feature_compatibility_version.cpp b/src/mongo/db/commands/feature_compatibility_version.cpp index ed0fe311562..5a861356c01 100644 --- a/src/mongo/db/commands/feature_compatibility_version.cpp +++ b/src/mongo/db/commands/feature_compatibility_version.cpp @@ -70,9 +70,9 @@ void FeatureCompatibilityVersion::setTargetUpgrade(OperationContext* opCtx) { // Sets both 'version' and 'targetVersion' fields. _runUpdateCommand(opCtx, [](auto updateMods) { updateMods.append(FeatureCompatibilityVersionParser::kVersionField, - FeatureCompatibilityVersionParser::kVersion42); - updateMods.append(FeatureCompatibilityVersionParser::kTargetVersionField, FeatureCompatibilityVersionParser::kVersion44); + updateMods.append(FeatureCompatibilityVersionParser::kTargetVersionField, + FeatureCompatibilityVersionParser::kVersion46); }); } @@ -80,9 +80,9 @@ void FeatureCompatibilityVersion::setTargetDowngrade(OperationContext* opCtx) { // Sets both 'version' and 'targetVersion' fields. _runUpdateCommand(opCtx, [](auto updateMods) { updateMods.append(FeatureCompatibilityVersionParser::kVersionField, - FeatureCompatibilityVersionParser::kVersion42); + FeatureCompatibilityVersionParser::kVersion44); updateMods.append(FeatureCompatibilityVersionParser::kTargetVersionField, - FeatureCompatibilityVersionParser::kVersion42); + FeatureCompatibilityVersionParser::kVersion44); }); } @@ -125,8 +125,8 @@ void FeatureCompatibilityVersion::setIfCleanStartup(OperationContext* opCtx, repl::TimestampedBSONObj{ BSON("_id" << FeatureCompatibilityVersionParser::kParameterName << FeatureCompatibilityVersionParser::kVersionField - << (storeUpgradeVersion ? FeatureCompatibilityVersionParser::kVersion44 - : FeatureCompatibilityVersionParser::kVersion42)), + << (storeUpgradeVersion ? FeatureCompatibilityVersionParser::kVersion46 + : FeatureCompatibilityVersionParser::kVersion44)), Timestamp()}, repl::OpTime::kUninitializedTerm)); // No timestamp or term because this write is not // replicated. @@ -169,7 +169,7 @@ void FeatureCompatibilityVersion::onInsertOrUpdate(OperationContext* opCtx, cons serverGlobalParams.featureCompatibility.setVersion(newVersion); updateMinWireVersion(); - if (newVersion != ServerGlobalParams::FeatureCompatibility::Version::kFullyDowngradedTo42) { + if (newVersion != ServerGlobalParams::FeatureCompatibility::Version::kFullyDowngradedTo44) { // Close all incoming connections from internal clients with binary versions lower than // ours. opCtx->getServiceContext()->getServiceEntryPoint()->endAllSessions( @@ -180,7 +180,7 @@ void FeatureCompatibilityVersion::onInsertOrUpdate(OperationContext* opCtx, cons .dropConnections(transport::Session::kKeepOpen); } - if (newVersion != ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo44) { + if (newVersion != ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo46) { if (MONGO_unlikely(hangBeforeAbortingRunningTransactionsOnFCVDowngrade.shouldFail())) { LOGV2(20460, "featureCompatibilityVersion - " @@ -201,8 +201,8 @@ void FeatureCompatibilityVersion::onInsertOrUpdate(OperationContext* opCtx, cons // 1. Setting featureCompatibilityVersion from downgrading to fullyDowngraded. // 2. Setting featureCompatibilityVersion from fullyDowngraded to upgrading. const auto shouldIncrementTopologyVersion = - newVersion == ServerGlobalParams::FeatureCompatibility::Version::kFullyDowngradedTo42 || - newVersion == ServerGlobalParams::FeatureCompatibility::Version::kUpgradingTo44; + newVersion == ServerGlobalParams::FeatureCompatibility::Version::kFullyDowngradedTo44 || + newVersion == ServerGlobalParams::FeatureCompatibility::Version::kUpgradingTo46; if (isReplSet && shouldIncrementTopologyVersion) { replCoordinator->incrementTopologyVersion(); } @@ -213,17 +213,17 @@ void FeatureCompatibilityVersion::updateMinWireVersion() { WireSpec& spec = WireSpec::instance(); switch (serverGlobalParams.featureCompatibility.getVersion()) { - case ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo44: - case ServerGlobalParams::FeatureCompatibility::Version::kUpgradingTo44: - case ServerGlobalParams::FeatureCompatibility::Version::kDowngradingTo42: + case ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo46: + case ServerGlobalParams::FeatureCompatibility::Version::kUpgradingTo46: + case ServerGlobalParams::FeatureCompatibility::Version::kDowngradingTo44: spec.incomingInternalClient.minWireVersion = LATEST_WIRE_VERSION; spec.outgoing.minWireVersion = LATEST_WIRE_VERSION; return; - case ServerGlobalParams::FeatureCompatibility::Version::kFullyDowngradedTo42: + case ServerGlobalParams::FeatureCompatibility::Version::kFullyDowngradedTo44: spec.incomingInternalClient.minWireVersion = LATEST_WIRE_VERSION - 1; spec.outgoing.minWireVersion = LATEST_WIRE_VERSION - 1; return; - case ServerGlobalParams::FeatureCompatibility::Version::kUnsetDefault42Behavior: + case ServerGlobalParams::FeatureCompatibility::Version::kUnsetDefault44Behavior: // getVersion() does not return this value. MONGO_UNREACHABLE; } @@ -232,11 +232,11 @@ void FeatureCompatibilityVersion::updateMinWireVersion() { void FeatureCompatibilityVersion::_validateVersion(StringData version) { uassert(40284, str::stream() << "featureCompatibilityVersion must be '" - << FeatureCompatibilityVersionParser::kVersion44 << "' or '" - << FeatureCompatibilityVersionParser::kVersion42 << "'. See " + << FeatureCompatibilityVersionParser::kVersion46 << "' or '" + << FeatureCompatibilityVersionParser::kVersion44 << "'. See " << feature_compatibility_version_documentation::kCompatibilityLink << ".", - version == FeatureCompatibilityVersionParser::kVersion44 || - version == FeatureCompatibilityVersionParser::kVersion42); + version == FeatureCompatibilityVersionParser::kVersion46 || + version == FeatureCompatibilityVersionParser::kVersion44); } void FeatureCompatibilityVersion::_runUpdateCommand(OperationContext* opCtx, @@ -292,33 +292,33 @@ void FeatureCompatibilityVersionParameter::append(OperationContext* opCtx, BSONObjBuilder featureCompatibilityVersionBuilder(b.subobjStart(name)); switch (serverGlobalParams.featureCompatibility.getVersion()) { - case ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo44: + case ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo46: featureCompatibilityVersionBuilder.append( FeatureCompatibilityVersionParser::kVersionField, - FeatureCompatibilityVersionParser::kVersion44); + FeatureCompatibilityVersionParser::kVersion46); return; - case ServerGlobalParams::FeatureCompatibility::Version::kUpgradingTo44: + case ServerGlobalParams::FeatureCompatibility::Version::kUpgradingTo46: featureCompatibilityVersionBuilder.append( FeatureCompatibilityVersionParser::kVersionField, - FeatureCompatibilityVersionParser::kVersion42); + FeatureCompatibilityVersionParser::kVersion44); featureCompatibilityVersionBuilder.append( FeatureCompatibilityVersionParser::kTargetVersionField, - FeatureCompatibilityVersionParser::kVersion44); + FeatureCompatibilityVersionParser::kVersion46); return; - case ServerGlobalParams::FeatureCompatibility::Version::kDowngradingTo42: + case ServerGlobalParams::FeatureCompatibility::Version::kDowngradingTo44: featureCompatibilityVersionBuilder.append( FeatureCompatibilityVersionParser::kVersionField, - FeatureCompatibilityVersionParser::kVersion42); + FeatureCompatibilityVersionParser::kVersion44); featureCompatibilityVersionBuilder.append( FeatureCompatibilityVersionParser::kTargetVersionField, - FeatureCompatibilityVersionParser::kVersion42); + FeatureCompatibilityVersionParser::kVersion44); return; - case ServerGlobalParams::FeatureCompatibility::Version::kFullyDowngradedTo42: + case ServerGlobalParams::FeatureCompatibility::Version::kFullyDowngradedTo44: featureCompatibilityVersionBuilder.append( FeatureCompatibilityVersionParser::kVersionField, - FeatureCompatibilityVersionParser::kVersion42); + FeatureCompatibilityVersionParser::kVersion44); return; - case ServerGlobalParams::FeatureCompatibility::Version::kUnsetDefault42Behavior: + case ServerGlobalParams::FeatureCompatibility::Version::kUnsetDefault44Behavior: // getVersion() does not return this value. MONGO_UNREACHABLE; } diff --git a/src/mongo/db/commands/feature_compatibility_version.h b/src/mongo/db/commands/feature_compatibility_version.h index 506895e2539..9433b4afc4a 100644 --- a/src/mongo/db/commands/feature_compatibility_version.h +++ b/src/mongo/db/commands/feature_compatibility_version.h @@ -52,21 +52,21 @@ public: static Lock::ResourceMutex fcvLock; /** - * Records intent to perform a 4.2 -> 4.4 upgrade by updating the on-disk feature - * compatibility version document to have 'version'=4.2, 'targetVersion'=4.4. + * Records intent to perform a 4.4 -> 4.6 upgrade by updating the on-disk feature + * compatibility version document to have 'version'=4.4, 'targetVersion'=4.6. * Should be called before schemas are modified. */ static void setTargetUpgrade(OperationContext* opCtx); /** - * Records intent to perform a 4.4 -> 4.2 downgrade by updating the on-disk feature - * compatibility version document to have 'version'=4.2, 'targetVersion'=4.2. + * Records intent to perform a 4.6 -> 4.4 downgrade by updating the on-disk feature + * compatibility version document to have 'version'=4.4, 'targetVersion'=4.4. * Should be called before schemas are modified. */ static void setTargetDowngrade(OperationContext* opCtx); /** - * Records the completion of a 4.2 <-> 4.4 upgrade or downgrade by updating the on-disk feature + * Records the completion of a 4.4 <-> 4.6 upgrade or downgrade by updating the on-disk feature * compatibility version document to have 'version'=version and unsetting the 'targetVersion' * field. Should be called after schemas are modified. */ diff --git a/src/mongo/db/commands/feature_compatibility_version_command_parser.cpp b/src/mongo/db/commands/feature_compatibility_version_command_parser.cpp index 1450e35ece6..021fdf03d07 100644 --- a/src/mongo/db/commands/feature_compatibility_version_command_parser.cpp +++ b/src/mongo/db/commands/feature_compatibility_version_command_parser.cpp @@ -77,12 +77,12 @@ StatusWith<std::string> FeatureCompatibilityVersionCommandParser::extractVersion const std::string version = versionElem.String(); - if (version != FeatureCompatibilityVersionParser::kVersion44 && - version != FeatureCompatibilityVersionParser::kVersion42) { + if (version != FeatureCompatibilityVersionParser::kVersion46 && + version != FeatureCompatibilityVersionParser::kVersion44) { return {ErrorCodes::BadValue, str::stream() << "Invalid command argument. Expected '" - << FeatureCompatibilityVersionParser::kVersion44 << "' or '" - << FeatureCompatibilityVersionParser::kVersion42 << "', found " + << FeatureCompatibilityVersionParser::kVersion46 << "' or '" + << FeatureCompatibilityVersionParser::kVersion44 << "', found " << version << " in: " << cmdObj << ". See " << feature_compatibility_version_documentation::kCompatibilityLink << "."}; diff --git a/src/mongo/db/commands/feature_compatibility_version_documentation.h b/src/mongo/db/commands/feature_compatibility_version_documentation.h index 0be6c0b1f39..3c3c122d9d1 100644 --- a/src/mongo/db/commands/feature_compatibility_version_documentation.h +++ b/src/mongo/db/commands/feature_compatibility_version_documentation.h @@ -32,7 +32,8 @@ namespace mongo { namespace feature_compatibility_version_documentation { constexpr StringData kCompatibilityLink = - "http://dochub.mongodb.org/core/4.0-feature-compatibility"_sd; -constexpr StringData kUpgradeLink = "http://dochub.mongodb.org/core/4.0-upgrade-fcv"_sd; + "https://docs.mongodb.com/master/release-notes/4.4-compatibility/#feature-compatibility"_sd; +constexpr StringData kUpgradeLink = + "https://docs.mongodb.com/master/release-notes/4.4/#upgrade-procedures"_sd; } // namespace feature_compatibility_version_documentation } // namespace mongo diff --git a/src/mongo/db/commands/feature_compatibility_version_parser.cpp b/src/mongo/db/commands/feature_compatibility_version_parser.cpp index d542d23c7a3..a0a2ead7bea 100644 --- a/src/mongo/db/commands/feature_compatibility_version_parser.cpp +++ b/src/mongo/db/commands/feature_compatibility_version_parser.cpp @@ -38,10 +38,10 @@ namespace mongo { -constexpr StringData FeatureCompatibilityVersionParser::kVersion42; constexpr StringData FeatureCompatibilityVersionParser::kVersion44; -constexpr StringData FeatureCompatibilityVersionParser::kVersionDowngradingTo42; -constexpr StringData FeatureCompatibilityVersionParser::kVersionUpgradingTo44; +constexpr StringData FeatureCompatibilityVersionParser::kVersion46; +constexpr StringData FeatureCompatibilityVersionParser::kVersionDowngradingTo44; +constexpr StringData FeatureCompatibilityVersionParser::kVersionUpgradingTo46; constexpr StringData FeatureCompatibilityVersionParser::kVersionUnset; constexpr StringData FeatureCompatibilityVersionParser::kParameterName; @@ -51,7 +51,7 @@ constexpr StringData FeatureCompatibilityVersionParser::kTargetVersionField; StatusWith<ServerGlobalParams::FeatureCompatibility::Version> FeatureCompatibilityVersionParser::parse(const BSONObj& featureCompatibilityVersionDoc) { ServerGlobalParams::FeatureCompatibility::Version version = - ServerGlobalParams::FeatureCompatibility::Version::kUnsetDefault42Behavior; + ServerGlobalParams::FeatureCompatibility::Version::kUnsetDefault44Behavior; std::string versionString; std::string targetVersionString; @@ -72,12 +72,12 @@ FeatureCompatibilityVersionParser::parse(const BSONObj& featureCompatibilityVers << "."); } - if (elem.String() != kVersion44 && elem.String() != kVersion42) { + if (elem.String() != kVersion46 && elem.String() != kVersion44) { return Status(ErrorCodes::BadValue, str::stream() << "Invalid value for " << fieldName << ", found " - << elem.String() << ", expected '" << kVersion44 << "' or '" - << kVersion42 << "'. Contents of " << kParameterName + << elem.String() << ", expected '" << kVersion46 << "' or '" + << kVersion44 << "'. Contents of " << kParameterName << " document in " << NamespaceString::kServerConfigurationNamespace.toString() << ": " << featureCompatibilityVersionDoc << ". See " @@ -102,16 +102,16 @@ FeatureCompatibilityVersionParser::parse(const BSONObj& featureCompatibilityVers } } - if (versionString == kVersion42) { - if (targetVersionString == kVersion44) { - version = ServerGlobalParams::FeatureCompatibility::Version::kUpgradingTo44; - } else if (targetVersionString == kVersion42) { - version = ServerGlobalParams::FeatureCompatibility::Version::kDowngradingTo42; + if (versionString == kVersion44) { + if (targetVersionString == kVersion46) { + version = ServerGlobalParams::FeatureCompatibility::Version::kUpgradingTo46; + } else if (targetVersionString == kVersion44) { + version = ServerGlobalParams::FeatureCompatibility::Version::kDowngradingTo44; } else { - version = ServerGlobalParams::FeatureCompatibility::Version::kFullyDowngradedTo42; + version = ServerGlobalParams::FeatureCompatibility::Version::kFullyDowngradedTo44; } - } else if (versionString == kVersion44) { - if (targetVersionString == kVersion44 || targetVersionString == kVersion42) { + } else if (versionString == kVersion46) { + if (targetVersionString == kVersion46 || targetVersionString == kVersion44) { return Status(ErrorCodes::BadValue, str::stream() << "Invalid state for " << kParameterName << " document in " @@ -120,7 +120,7 @@ FeatureCompatibilityVersionParser::parse(const BSONObj& featureCompatibilityVers << feature_compatibility_version_documentation::kCompatibilityLink << "."); } else { - version = ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo44; + version = ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo46; } } else { return Status(ErrorCodes::BadValue, diff --git a/src/mongo/db/commands/feature_compatibility_version_parser.h b/src/mongo/db/commands/feature_compatibility_version_parser.h index 757d725a0bf..e52e73e4477 100644 --- a/src/mongo/db/commands/feature_compatibility_version_parser.h +++ b/src/mongo/db/commands/feature_compatibility_version_parser.h @@ -40,10 +40,10 @@ namespace mongo { */ class FeatureCompatibilityVersionParser { public: - static constexpr StringData kVersion42 = "4.2"_sd; static constexpr StringData kVersion44 = "4.4"_sd; - static constexpr StringData kVersionDowngradingTo42 = "downgrading to 4.2"_sd; - static constexpr StringData kVersionUpgradingTo44 = "upgrading to 4.4"_sd; + static constexpr StringData kVersion46 = "4.6"_sd; + static constexpr StringData kVersionDowngradingTo44 = "downgrading to 4.4"_sd; + static constexpr StringData kVersionUpgradingTo46 = "upgrading to 4.6"_sd; static constexpr StringData kVersionUnset = "Unset"_sd; static constexpr StringData kParameterName = "featureCompatibilityVersion"_sd; @@ -63,16 +63,16 @@ public: */ static StringData toString(ServerGlobalParams::FeatureCompatibility::Version version) { switch (version) { - case ServerGlobalParams::FeatureCompatibility::Version::kUnsetDefault42Behavior: + case ServerGlobalParams::FeatureCompatibility::Version::kUnsetDefault44Behavior: return kVersionUnset; - case ServerGlobalParams::FeatureCompatibility::Version::kFullyDowngradedTo42: - return kVersion42; - case ServerGlobalParams::FeatureCompatibility::Version::kUpgradingTo44: - return kVersionUpgradingTo44; - case ServerGlobalParams::FeatureCompatibility::Version::kDowngradingTo42: - return kVersionDowngradingTo42; - case ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo44: + case ServerGlobalParams::FeatureCompatibility::Version::kFullyDowngradedTo44: return kVersion44; + case ServerGlobalParams::FeatureCompatibility::Version::kUpgradingTo46: + return kVersionUpgradingTo46; + case ServerGlobalParams::FeatureCompatibility::Version::kDowngradingTo44: + return kVersionDowngradingTo44; + case ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo46: + return kVersion46; default: MONGO_UNREACHABLE; } 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 e554c0184a2..b2515649a0c 100644 --- a/src/mongo/db/commands/set_feature_compatibility_version_command.cpp +++ b/src/mongo/db/commands/set_feature_compatibility_version_command.cpp @@ -91,7 +91,7 @@ void deletePersistedDefaultRWConcernDocument(OperationContext* opCtx) { } /** - * Sets the minimum allowed version for the cluster. If it is 4.2, then the node should not use 4.4 + * Sets the minimum allowed version for the cluster. If it is 4.4, then the node should not use 4.6 * features. * * Format: @@ -119,11 +119,11 @@ public: std::string help() const override { using FCVP = FeatureCompatibilityVersionParser; std::stringstream h; - h << "Set the API version exposed by this node. If set to '" << FCVP::kVersion42 - << "', then " << FCVP::kVersion44 << " features are disabled. If set to '" - << FCVP::kVersion44 << "', then " << FCVP::kVersion44 + h << "Set the API version exposed by this node. If set to '" << FCVP::kVersion44 + << "', then " << FCVP::kVersion46 << " features are disabled. If set to '" + << FCVP::kVersion46 << "', then " << FCVP::kVersion46 << " features are enabled, and all nodes in the cluster must be binary version " - << FCVP::kVersion44 << ". See " + << FCVP::kVersion46 << ". See " << feature_compatibility_version_documentation::kCompatibilityLink << "."; return h.str(); } @@ -181,16 +181,16 @@ public: ServerGlobalParams::FeatureCompatibility::Version actualVersion = serverGlobalParams.featureCompatibility.getVersion(); - if (requestedVersion == FeatureCompatibilityVersionParser::kVersion44) { + if (requestedVersion == FeatureCompatibilityVersionParser::kVersion46) { uassert(ErrorCodes::IllegalOperation, - "cannot initiate featureCompatibilityVersion upgrade to 4.4 while a previous " - "featureCompatibilityVersion downgrade to 4.2 has not completed. Finish " - "downgrade to 4.2, then upgrade to 4.4.", + "cannot initiate featureCompatibilityVersion upgrade to 4.6 while a previous " + "featureCompatibilityVersion downgrade to 4.4 has not completed. Finish " + "downgrade to 4.4, then upgrade to 4.6.", actualVersion != - ServerGlobalParams::FeatureCompatibility::Version::kDowngradingTo42); + ServerGlobalParams::FeatureCompatibility::Version::kDowngradingTo44); if (actualVersion == - ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo44) { + ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo46) { // Set the client's last opTime to the system last opTime so no-ops wait for // writeConcern. repl::ReplClientInfo::forClient(opCtx->getClient()) @@ -204,7 +204,7 @@ public: // Take the global lock in S mode to create a barrier for operations taking the // global IX or X locks. This ensures that either // - The global IX/X locked operation will start after the FCV change, see the - // upgrading to 4.4 FCV and act accordingly. + // upgrading to 4.6 FCV and act accordingly. // - The global IX/X locked operation began prior to the FCV change, is acting on // that assumption and will finish before upgrade procedures begin right after // this. @@ -235,15 +235,15 @@ public: } FeatureCompatibilityVersion::unsetTargetUpgradeOrDowngrade(opCtx, requestedVersion); - } else if (requestedVersion == FeatureCompatibilityVersionParser::kVersion42) { + } else if (requestedVersion == FeatureCompatibilityVersionParser::kVersion44) { uassert(ErrorCodes::IllegalOperation, - "cannot initiate setting featureCompatibilityVersion to 4.2 while a previous " - "featureCompatibilityVersion upgrade to 4.4 has not completed.", + "cannot initiate setting featureCompatibilityVersion to 4.4 while a previous " + "featureCompatibilityVersion upgrade to 4.6 has not completed.", actualVersion != - ServerGlobalParams::FeatureCompatibility::Version::kUpgradingTo44); + ServerGlobalParams::FeatureCompatibility::Version::kUpgradingTo46); if (actualVersion == - ServerGlobalParams::FeatureCompatibility::Version::kFullyDowngradedTo42) { + ServerGlobalParams::FeatureCompatibility::Version::kFullyDowngradedTo44) { // Set the client's last opTime to the system last opTime so no-ops wait for // writeConcern. repl::ReplClientInfo::forClient(opCtx->getClient()) diff --git a/src/mongo/db/pipeline/accumulator_js_reduce.cpp b/src/mongo/db/pipeline/accumulator_js_reduce.cpp index 864579f8964..ce09c01c8a4 100644 --- a/src/mongo/db/pipeline/accumulator_js_reduce.cpp +++ b/src/mongo/db/pipeline/accumulator_js_reduce.cpp @@ -35,10 +35,7 @@ namespace mongo { -REGISTER_ACCUMULATOR_WITH_MIN_VERSION( - _internalJsReduce, - AccumulatorInternalJsReduce::parseInternalJsReduce, - ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo44); +REGISTER_ACCUMULATOR(_internalJsReduce, AccumulatorInternalJsReduce::parseInternalJsReduce); AccumulationExpression AccumulatorInternalJsReduce::parseInternalJsReduce( boost::intrusive_ptr<ExpressionContext> expCtx, BSONElement elem, VariablesParseState vps) { diff --git a/src/mongo/db/pipeline/expression.cpp b/src/mongo/db/pipeline/expression.cpp index 0c9d783cf35..ece3315fca5 100644 --- a/src/mongo/db/pipeline/expression.cpp +++ b/src/mongo/db/pipeline/expression.cpp @@ -2637,22 +2637,6 @@ intrusive_ptr<Expression> ExpressionMeta::parse( const auto iter = kMetaNameToMetaType.find(expr.valueStringData()); if (iter != kMetaNameToMetaType.end()) { - if ((expCtx->isParsingCollectionValidator || expCtx->isParsingViewDefinition) && - expCtx->maxFeatureCompatibilityVersion && - expCtx->maxFeatureCompatibilityVersion != - ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo44) { - uassert(ErrorCodes::QueryFeatureNotAllowed, - str::stream() << "$meta type " << iter->second << " can only be used in " - << (expCtx->isParsingViewDefinition ? "view definition" - : "collection validator") - << " when feature compatibility version is 4.4", - iter->second != DocumentMetadataFields::kIndexKey && - iter->second != DocumentMetadataFields::kSortKey && - iter->second != DocumentMetadataFields::kRecordId && - iter->second != DocumentMetadataFields::kGeoNearPoint && - iter->second != DocumentMetadataFields::kGeoNearDist); - } - return new ExpressionMeta(expCtx, iter->second); } else { uasserted(17308, "Unsupported argument to $meta: " + expr.String()); diff --git a/src/mongo/db/repair_database_and_check_version.cpp b/src/mongo/db/repair_database_and_check_version.cpp index d66a8699481..f87afde7e16 100644 --- a/src/mongo/db/repair_database_and_check_version.cpp +++ b/src/mongo/db/repair_database_and_check_version.cpp @@ -76,8 +76,8 @@ MONGO_FAIL_POINT_DEFINE(exitBeforeRepairInvalidatesConfig); namespace { const std::string mustDowngradeErrorMsg = str::stream() - << "UPGRADE PROBLEM: The data files need to be fully upgraded to version 4.2 before attempting " - "an upgrade to 4.4; see " + << "UPGRADE PROBLEM: The data files need to be fully upgraded to version 4.4 before attempting " + "an upgrade to 4.6; see " << feature_compatibility_version_documentation::kUpgradeLink << " for more details."; Status restoreMissingFeatureCompatibilityVersionDocument(OperationContext* opCtx, @@ -116,14 +116,15 @@ Status restoreMissingFeatureCompatibilityVersionDocument(OperationContext* opCtx BSON("_id" << FeatureCompatibilityVersionParser::kParameterName), featureCompatibilityVersion)) { LOGV2(21000, - "Re-creating featureCompatibilityVersion document that was deleted with version " - "{FeatureCompatibilityVersionParser_kVersion42}.", - "FeatureCompatibilityVersionParser_kVersion42"_attr = - FeatureCompatibilityVersionParser::kVersion42); + "Re-creating featureCompatibilityVersion document that was deleted. Creating new " + "document with version " + "{FeatureCompatibilityVersionParser_kVersion44}.", + "FeatureCompatibilityVersionParser_kVersion44"_attr = + FeatureCompatibilityVersionParser::kVersion44); BSONObj fcvObj = BSON("_id" << FeatureCompatibilityVersionParser::kParameterName << FeatureCompatibilityVersionParser::kVersionField - << FeatureCompatibilityVersionParser::kVersion42); + << FeatureCompatibilityVersionParser::kVersion44); writeConflictRetry(opCtx, "insertFCVDocument", fcvNss.ns(), [&] { WriteUnitOfWork wunit(opCtx); @@ -556,7 +557,7 @@ bool repairDatabasesAndCheckVersion(OperationContext* opCtx) { auto swVersion = FeatureCompatibilityVersionParser::parse(featureCompatibilityVersion); // Note this error path captures all cases of an FCV document existing, - // but with any value other than "4.2" or "4.4". This includes unexpected + // but with any value other than "4.4" or "4.6". This includes unexpected // cases with no path forward such as the FCV value not being a string. uassert(ErrorCodes::MustDowngrade, str::stream() @@ -564,7 +565,7 @@ bool repairDatabasesAndCheckVersion(OperationContext* opCtx) { "featureCompatibilityVersion document (ERROR: " << swVersion.getStatus() << "). If the current featureCompatibilityVersion is below " - "4.2, see the documentation on upgrading at " + "4.4, see the documentation on upgrading at " << feature_compatibility_version_documentation::kUpgradeLink << ".", swVersion.isOK()); @@ -573,10 +574,10 @@ bool repairDatabasesAndCheckVersion(OperationContext* opCtx) { serverGlobalParams.featureCompatibility.setVersion(version); FeatureCompatibilityVersion::updateMinWireVersion(); - // On startup, if the version is in an upgrading or downrading state, print a + // On startup, if the version is in an upgrading or downgrading state, print a // warning. if (version == - ServerGlobalParams::FeatureCompatibility::Version::kUpgradingTo44) { + ServerGlobalParams::FeatureCompatibility::Version::kUpgradingTo46) { LOGV2_OPTIONS( 21011, {logv2::LogTag::kStartupWarnings}, @@ -591,10 +592,10 @@ bool repairDatabasesAndCheckVersion(OperationContext* opCtx) { 21013, {logv2::LogTag::kStartupWarnings}, "** To fix this, use the setFeatureCompatibilityVersion " - "command to resume upgrade to 4.4."); + "command to resume upgrade to 4.6."); } else if (version == ServerGlobalParams::FeatureCompatibility::Version:: - kDowngradingTo42) { + kDowngradingTo44) { LOGV2_OPTIONS(21014, {logv2::LogTag::kStartupWarnings}, "** WARNING: A featureCompatibilityVersion downgrade did not " @@ -609,7 +610,7 @@ bool repairDatabasesAndCheckVersion(OperationContext* opCtx) { 21016, {logv2::LogTag::kStartupWarnings}, "** To fix this, use the setFeatureCompatibilityVersion " - "command to resume downgrade to 4.2."); + "command to resume downgrade to 4.4."); } } } diff --git a/src/mongo/db/repl/initial_syncer.cpp b/src/mongo/db/repl/initial_syncer.cpp index 3a1470c6e41..fa8be1638f4 100644 --- a/src/mongo/db/repl/initial_syncer.cpp +++ b/src/mongo/db/repl/initial_syncer.cpp @@ -1082,8 +1082,8 @@ void InitialSyncer::_fcvFetcherCallback(const StatusWith<Fetcher::QueryResponse> auto version = fCVParseSW.getValue(); // Changing the featureCompatibilityVersion during initial sync is unsafe. - if (version > ServerGlobalParams::FeatureCompatibility::Version::kFullyDowngradedTo42 && - version < ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo44) { + if (version > ServerGlobalParams::FeatureCompatibility::Version::kFullyDowngradedTo44 && + version < ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo46) { onCompletionGuard->setResultAndCancelRemainingWork_inlock( lock, Status(ErrorCodes::IncompatibleServerVersion, diff --git a/src/mongo/db/repl/initial_syncer_test.cpp b/src/mongo/db/repl/initial_syncer_test.cpp index 40aace83230..a3e107bda50 100644 --- a/src/mongo/db/repl/initial_syncer_test.cpp +++ b/src/mongo/db/repl/initial_syncer_test.cpp @@ -674,7 +674,7 @@ void assertFCVRequest(RemoteCommandRequest request) { void InitialSyncerTest::processSuccessfulFCVFetcherResponseLastStable() { auto docs = {BSON("_id" << FeatureCompatibilityVersionParser::kParameterName << "version" - << FeatureCompatibilityVersionParser::kVersion42)}; + << FeatureCompatibilityVersionParser::kVersion44)}; processSuccessfulFCVFetcherResponse(docs); } @@ -1893,7 +1893,7 @@ TEST_F(InitialSyncerTest, TEST_F(InitialSyncerTest, InitialSyncerReturnsTooManyMatchingDocumentsWhenFCVFetcherReturnsMultipleDocuments) { auto docs = {BSON("_id" << FeatureCompatibilityVersionParser::kParameterName << "version" - << FeatureCompatibilityVersionParser::kVersion42), + << FeatureCompatibilityVersionParser::kVersion44), BSON("_id" << "other")}; runInitialSyncWithBadFCVResponse(docs, ErrorCodes::TooManyMatchingDocuments); @@ -1902,22 +1902,22 @@ TEST_F(InitialSyncerTest, TEST_F(InitialSyncerTest, InitialSyncerReturnsIncompatibleServerVersionWhenFCVFetcherReturnsUpgradeTargetVersion) { auto docs = {BSON("_id" << FeatureCompatibilityVersionParser::kParameterName << "version" - << FeatureCompatibilityVersionParser::kVersion42 << "targetVersion" - << FeatureCompatibilityVersionParser::kVersion44)}; + << FeatureCompatibilityVersionParser::kVersion44 << "targetVersion" + << FeatureCompatibilityVersionParser::kVersion46)}; runInitialSyncWithBadFCVResponse(docs, ErrorCodes::IncompatibleServerVersion); } TEST_F(InitialSyncerTest, InitialSyncerReturnsIncompatibleServerVersionWhenFCVFetcherReturnsDowngradeTargetVersion) { auto docs = {BSON("_id" << FeatureCompatibilityVersionParser::kParameterName << "version" - << FeatureCompatibilityVersionParser::kVersion42 << "targetVersion" - << FeatureCompatibilityVersionParser::kVersion42)}; + << FeatureCompatibilityVersionParser::kVersion44 << "targetVersion" + << FeatureCompatibilityVersionParser::kVersion44)}; runInitialSyncWithBadFCVResponse(docs, ErrorCodes::IncompatibleServerVersion); } TEST_F(InitialSyncerTest, InitialSyncerReturnsBadValueWhenFCVFetcherReturnsNoVersion) { auto docs = {BSON("_id" << FeatureCompatibilityVersionParser::kParameterName << "targetVersion" - << FeatureCompatibilityVersionParser::kVersion42)}; + << FeatureCompatibilityVersionParser::kVersion44)}; runInitialSyncWithBadFCVResponse(docs, ErrorCodes::BadValue); } @@ -1949,7 +1949,7 @@ TEST_F(InitialSyncerTest, InitialSyncerSucceedsWhenFCVFetcherReturnsOldVersion) processSuccessfulLastOplogEntryFetcherResponse({makeOplogEntryObj(1)}); auto docs = {BSON("_id" << FeatureCompatibilityVersionParser::kParameterName << "version" - << FeatureCompatibilityVersionParser::kVersion42)}; + << FeatureCompatibilityVersionParser::kVersion44)}; processSuccessfulFCVFetcherResponse(docs); } diff --git a/src/mongo/db/repl/oplog_applier_impl_test_fixture.cpp b/src/mongo/db/repl/oplog_applier_impl_test_fixture.cpp index fdcd4911a4c..fc12308777d 100644 --- a/src/mongo/db/repl/oplog_applier_impl_test_fixture.cpp +++ b/src/mongo/db/repl/oplog_applier_impl_test_fixture.cpp @@ -127,7 +127,7 @@ void OplogApplierImplTest::setUp() { // test fixture does not create a featureCompatibilityVersion document from which to initialize // the server parameter. serverGlobalParams.featureCompatibility.setVersion( - ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo44); + ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo46); // This is necessary to generate ghost timestamps for index builds that are not 0, since 0 is an // invalid timestamp. diff --git a/src/mongo/db/s/cleanup_orphaned_cmd.cpp b/src/mongo/db/s/cleanup_orphaned_cmd.cpp index b9791237e92..c703ccba813 100644 --- a/src/mongo/db/s/cleanup_orphaned_cmd.cpp +++ b/src/mongo/db/s/cleanup_orphaned_cmd.cpp @@ -80,17 +80,9 @@ CleanupResult cleanupOrphanedData(OperationContext* opCtx, std::string* errMsg) { FixedFCVRegion fixedFCVRegion(opCtx); - auto fcvVersion = serverGlobalParams.featureCompatibility.getVersion(); - uassert(ErrorCodes::ConflictingOperationInProgress, - "Cannot run cleanupOrphaned while the FCV is upgrading or downgrading", - fcvVersion == ServerGlobalParams::FeatureCompatibility::Version::kFullyDowngradedTo42 || - fcvVersion == - ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo44); - // Note that 'disableResumableRangeDeleter' is a startup-only parameter, so it cannot change // while this process is running. - if (fcvVersion == ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo44 && - !disableResumableRangeDeleter.load()) { + if (!disableResumableRangeDeleter.load()) { boost::optional<ChunkRange> range; boost::optional<UUID> collectionUuid; { diff --git a/src/mongo/db/s/config/sharding_catalog_manager_add_shard_test.cpp b/src/mongo/db/s/config/sharding_catalog_manager_add_shard_test.cpp index 422e0438380..1fd521cd0a4 100644 --- a/src/mongo/db/s/config/sharding_catalog_manager_add_shard_test.cpp +++ b/src/mongo/db/s/config/sharding_catalog_manager_add_shard_test.cpp @@ -141,7 +141,7 @@ protected: ASSERT_EQ(request.dbname, "admin"); ASSERT_BSONOBJ_EQ(request.cmdObj, BSON("setFeatureCompatibilityVersion" - << "4.4" + << "4.6" << "writeConcern" << writeConcern)); return response; diff --git a/src/mongo/db/s/config/sharding_catalog_manager_shard_operations.cpp b/src/mongo/db/s/config/sharding_catalog_manager_shard_operations.cpp index b82b923d97e..dacb49728c8 100644 --- a/src/mongo/db/s/config/sharding_catalog_manager_shard_operations.cpp +++ b/src/mongo/db/s/config/sharding_catalog_manager_shard_operations.cpp @@ -338,14 +338,14 @@ StatusWith<ShardType> ShardingCatalogManager::_validateHostAsShard( << connectionString.toString() << " as a shard"); } if (serverGlobalParams.featureCompatibility.getVersion() > - ServerGlobalParams::FeatureCompatibility::Version::kFullyDowngradedTo42) { - // If the cluster's FCV is 4.4, or upgrading to / downgrading from, the node being added - // must be a v4.4 binary. + ServerGlobalParams::FeatureCompatibility::Version::kFullyDowngradedTo44) { + // If the cluster's FCV is 4.6, or upgrading to / downgrading from, the node being added + // must be a v4.6 binary. invariant(maxWireVersion == WireVersion::LATEST_WIRE_VERSION); } else { - // If the cluster's FCV is 4.2, the node being added must be a v4.2 or v4.4 binary. + // If the cluster's FCV is 4.4, the node being added must be a v4.4 or v4.6 binary. invariant(serverGlobalParams.featureCompatibility.getVersion() == - ServerGlobalParams::FeatureCompatibility::Version::kFullyDowngradedTo42); + ServerGlobalParams::FeatureCompatibility::Version::kFullyDowngradedTo44); invariant(maxWireVersion >= WireVersion::LATEST_WIRE_VERSION - 1); } @@ -650,16 +650,16 @@ StatusWith<std::string> ShardingCatalogManager::addShard( BSONObj setFCVCmd; switch (serverGlobalParams.featureCompatibility.getVersion()) { - case ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo44: - case ServerGlobalParams::FeatureCompatibility::Version::kUpgradingTo44: + case ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo46: + case ServerGlobalParams::FeatureCompatibility::Version::kUpgradingTo46: setFCVCmd = BSON(FeatureCompatibilityVersionCommandParser::kCommandName - << FeatureCompatibilityVersionParser::kVersion44 + << FeatureCompatibilityVersionParser::kVersion46 << WriteConcernOptions::kWriteConcernField << opCtx->getWriteConcern().toBSON()); break; default: setFCVCmd = BSON(FeatureCompatibilityVersionCommandParser::kCommandName - << FeatureCompatibilityVersionParser::kVersion42 + << FeatureCompatibilityVersionParser::kVersion44 << WriteConcernOptions::kWriteConcernField << opCtx->getWriteConcern().toBSON()); break; diff --git a/src/mongo/db/server_options.h b/src/mongo/db/server_options.h index a61dd2dd55c..8487167c490 100644 --- a/src/mongo/db/server_options.h +++ b/src/mongo/db/server_options.h @@ -165,40 +165,40 @@ struct ServerGlobalParams { * * The legal enum (and featureCompatibilityVersion document) states are: * - * kFullyDowngradedTo42 - * (4.2, Unset): Only 4.2 features are available, and new and existing storage - * engine entries use the 4.2 format + * kFullyDowngradedTo44 + * (4.4, Unset): Only 4.4 features are available, and new and existing storage + * engine entries use the 4.4 format * - * kUpgradingTo44 - * (4.2, 4.4): Only 4.2 features are available, but new storage engine entries - * use the 4.4 format, and existing entries may have either the - * 4.2 or 4.4 format + * kUpgradingTo46 + * (4.4, 4.6): Only 4.4 features are available, but new storage engine entries + * use the 4.6 format, and existing entries may have either the + * 4.4 or 4.6 format * - * kFullyUpgradedTo44 - * (4.4, Unset): 4.4 features are available, and new and existing storage - * engine entries use the 4.4 format + * kFullyUpgradedTo46 + * (4.6, Unset): 4.6 features are available, and new and existing storage + * engine entries use the 4.6 format * - * kDowngradingTo42 - * (4.2, 4.2): Only 4.2 features are available and new storage engine - * entries use the 4.2 format, but existing entries may have - * either the 4.2 or 4.4 format + * kDowngradingTo44 + * (4.4, 4.4): Only 4.4 features are available and new storage engine + * entries use the 4.4 format, but existing entries may have + * either the 4.4 or 4.6 format * - * kUnsetDefault42Behavior + * kUnsetDefault44Behavior * (Unset, Unset): This is the case on startup before the fCV document is * loaded into memory. isVersionInitialized() will return * false, and getVersion() will return the default - * (kFullyDowngradedTo42). + * (kFullyDowngradedTo44). * */ enum class Version { // The order of these enums matter, higher upgrades having higher values, so that // features can be active or inactive if the version is higher than some minimum or // lower than some maximum, respectively. - kUnsetDefault42Behavior = 0, - kFullyDowngradedTo42 = 1, - kDowngradingTo42 = 2, - kUpgradingTo44 = 3, - kFullyUpgradedTo44 = 4, + kUnsetDefault44Behavior = 0, + kFullyDowngradedTo44 = 1, + kDowngradingTo44 = 2, + kUpgradingTo46 = 3, + kFullyUpgradedTo46 = 4, }; /** @@ -206,7 +206,7 @@ struct ServerGlobalParams { * exposes the actual state of the featureCompatibilityVersion if it is uninitialized. */ const bool isVersionInitialized() const { - return _version.load() != Version::kUnsetDefault42Behavior; + return _version.load() != Version::kUnsetDefault44Behavior; } /** @@ -219,7 +219,7 @@ struct ServerGlobalParams { } void reset() { - _version.store(Version::kUnsetDefault42Behavior); + _version.store(Version::kUnsetDefault44Behavior); } void setVersion(Version version) { @@ -231,7 +231,7 @@ struct ServerGlobalParams { } private: - AtomicWord<Version> _version{Version::kUnsetDefault42Behavior}; + AtomicWord<Version> _version{Version::kUnsetDefault44Behavior}; } featureCompatibility; diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp index 0d4ed8e033b..03b206d2466 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp @@ -145,7 +145,7 @@ bool WiredTigerFileVersion::shouldDowngrade(bool readOnly, } if (serverGlobalParams.featureCompatibility.getVersion() != - ServerGlobalParams::FeatureCompatibility::Version::kFullyDowngradedTo42) { + ServerGlobalParams::FeatureCompatibility::Version::kFullyDowngradedTo44) { // Only consider downgrading when FCV is set to kFullyDowngraded. // (This FCV gate must remain across binary version releases.) return false; diff --git a/src/mongo/db/views/view_catalog.cpp b/src/mongo/db/views/view_catalog.cpp index 38031abc2c1..28318df482b 100644 --- a/src/mongo/db/views/view_catalog.cpp +++ b/src/mongo/db/views/view_catalog.cpp @@ -329,11 +329,11 @@ StatusWith<stdx::unordered_set<NamespaceString>> ViewCatalog::_validatePipeline( // Save this to a variable to avoid reading the atomic variable multiple times. auto currentFCV = serverGlobalParams.featureCompatibility.getVersion(); - // If the feature compatibility version is not 4.4, and we are validating features as master, - // ban the use of new agg features introduced in 4.4 to prevent them from being persisted in the + // If the feature compatibility version is not 4.6, and we are validating features as master, + // ban the use of new agg features introduced in 4.6 to prevent them from being persisted in the // catalog. if (serverGlobalParams.validateFeaturesAsMaster.load() && - currentFCV != ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo44) { + currentFCV != ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo46) { expCtx->maxFeatureCompatibilityVersion = currentFCV; } diff --git a/src/mongo/db/wire_version.h b/src/mongo/db/wire_version.h index 6857b983b6b..a2b05ccf77c 100644 --- a/src/mongo/db/wire_version.h +++ b/src/mongo/db/wire_version.h @@ -79,9 +79,12 @@ enum WireVersion { // Supports resumable initial sync (4.4+). RESUMABLE_INITIAL_SYNC = 9, + // Supports some upcoming feature (4.6+). + PLACEHOLDER_FOR_46 = 10, + // Set this to the highest value in this enum - it will be the default maxWireVersion for // the WireSpec values. - LATEST_WIRE_VERSION = RESUMABLE_INITIAL_SYNC, + LATEST_WIRE_VERSION = PLACEHOLDER_FOR_46, }; /** diff --git a/src/mongo/dbtests/dbtests.cpp b/src/mongo/dbtests/dbtests.cpp index 09d93729855..cb440b75031 100644 --- a/src/mongo/dbtests/dbtests.cpp +++ b/src/mongo/dbtests/dbtests.cpp @@ -174,7 +174,7 @@ int dbtestsMain(int argc, char** argv, char** envp) { mongo::runGlobalInitializersOrDie(argc, argv, envp); serverGlobalParams.featureCompatibility.setVersion( - ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo44); + ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo46); repl::ReplSettings replSettings; replSettings.setOplogSizeBytes(10 * 1024 * 1024); setGlobalServiceContext(ServiceContext::make()); diff --git a/src/mongo/s/commands/cluster_set_feature_compatibility_version_cmd.cpp b/src/mongo/s/commands/cluster_set_feature_compatibility_version_cmd.cpp index 09d94a89fe3..51823aec2be 100644 --- a/src/mongo/s/commands/cluster_set_feature_compatibility_version_cmd.cpp +++ b/src/mongo/s/commands/cluster_set_feature_compatibility_version_cmd.cpp @@ -72,11 +72,11 @@ public: std::string help() const override { using FCVP = FeatureCompatibilityVersionParser; return str::stream() - << "Set the API version used by this cluster. If set to '" << FCVP::kVersion42 - << "', then " << FCVP::kVersion44 << " features are disabled. If set to '" - << FCVP::kVersion44 << "', then " << FCVP::kVersion44 + << "Set the API version used by this cluster. If set to '" << FCVP::kVersion44 + << "', then " << FCVP::kVersion46 << " features are disabled. If set to '" + << FCVP::kVersion46 << "', then " << FCVP::kVersion46 << " features are enabled, and all nodes in the cluster must be binary version " - << FCVP::kVersion44 << ". See " + << FCVP::kVersion46 << ". See " << feature_compatibility_version_documentation::kCompatibilityLink << "."; } diff --git a/src/mongo/s/server.cpp b/src/mongo/s/server.cpp index 5c2759dc623..38570657064 100644 --- a/src/mongo/s/server.cpp +++ b/src/mongo/s/server.cpp @@ -791,7 +791,7 @@ MONGO_INITIALIZER_WITH_PREREQUISITES(SetFeatureCompatibilityVersionLatest, ("EndStartupOptionStorage")) (InitializerContext* context) { serverGlobalParams.featureCompatibility.setVersion( - ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo44); + ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo46); return Status::OK(); } diff --git a/src/mongo/s/sharding_mongod_test_fixture.cpp b/src/mongo/s/sharding_mongod_test_fixture.cpp index 942c332e668..6572711d093 100644 --- a/src/mongo/s/sharding_mongod_test_fixture.cpp +++ b/src/mongo/s/sharding_mongod_test_fixture.cpp @@ -148,7 +148,7 @@ void ShardingMongodTestFixture::setUp() { // Set the highest FCV because otherwise it defaults to the lower FCV. This way we default to // testing this release's code, not backwards compatibility code. serverGlobalParams.featureCompatibility.setVersion( - ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo44); + ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo46); } std::unique_ptr<ReplicationCoordinatorMock> ShardingMongodTestFixture::makeReplicationCoordinator( diff --git a/src/mongo/shell/dbshell.cpp b/src/mongo/shell/dbshell.cpp index 4b711f91cc0..5ff05ee6511 100644 --- a/src/mongo/shell/dbshell.cpp +++ b/src/mongo/shell/dbshell.cpp @@ -119,7 +119,7 @@ MONGO_INITIALIZER_WITH_PREREQUISITES(SetFeatureCompatibilityVersionLatest, ("EndStartupOptionSetup")) (InitializerContext* context) { mongo::serverGlobalParams.featureCompatibility.setVersion( - ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo44); + ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo46); return Status::OK(); } diff --git a/src/mongo/shell/feature_compatibility_version.js b/src/mongo/shell/feature_compatibility_version.js index 599e7a4c79f..d5deffaf170 100644 --- a/src/mongo/shell/feature_compatibility_version.js +++ b/src/mongo/shell/feature_compatibility_version.js @@ -10,8 +10,8 @@ * multiple times. */ -var latestFCV = "4.4"; -var lastStableFCV = "4.2"; +var latestFCV = "4.6"; +var lastStableFCV = "4.4"; /** * Checks the featureCompatibilityVersion document and server parameter. The diff --git a/src/mongo/unittest/unittest.cpp b/src/mongo/unittest/unittest.cpp index ad5872024d1..6ed06953f78 100644 --- a/src/mongo/unittest/unittest.cpp +++ b/src/mongo/unittest/unittest.cpp @@ -157,7 +157,7 @@ namespace { // with a meaningful value will trigger failures as of SERVER-32630. void setUpFCV() { serverGlobalParams.featureCompatibility.setVersion( - ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo44); + ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo46); } void tearDownFCV() { serverGlobalParams.featureCompatibility.reset(); |