diff options
Diffstat (limited to 'src/mongo')
-rw-r--r-- | src/mongo/db/commands/feature_compatibility_version_parser.h | 20 | ||||
-rw-r--r-- | src/mongo/db/server_options.h | 24 | ||||
-rw-r--r-- | src/mongo/db/startup_recovery.cpp | 5 | ||||
-rw-r--r-- | src/mongo/db/wire_version.h | 5 | ||||
-rw-r--r-- | src/mongo/rpc/protocol_test.cpp | 9 | ||||
-rw-r--r-- | src/mongo/shell/feature_compatibility_version.js | 6 | ||||
-rw-r--r-- | src/mongo/shell/servers.js | 2 | ||||
-rw-r--r-- | src/mongo/shell/shardingtest.js | 3 |
8 files changed, 47 insertions, 27 deletions
diff --git a/src/mongo/db/commands/feature_compatibility_version_parser.h b/src/mongo/db/commands/feature_compatibility_version_parser.h index d1e90016ab3..ac5dd2c4b28 100644 --- a/src/mongo/db/commands/feature_compatibility_version_parser.h +++ b/src/mongo/db/commands/feature_compatibility_version_parser.h @@ -43,23 +43,29 @@ class FeatureCompatibilityVersionParser { public: static constexpr StringData kVersion44 = "4.4"_sd; static constexpr StringData kVersion47 = "4.7"_sd; + static constexpr StringData kVersion48 = "4.8"_sd; static constexpr StringData kVersionDowngradingFrom47To44 = "downgrading from 4.7 to 4.4"_sd; + static constexpr StringData kVersionDowngradingFrom48To44 = "downgrading from 4.8 to 4.4"_sd; + static constexpr StringData kVersionDowngradingFrom48To47 = "downgrading from 4.8 to 4.7"_sd; static constexpr StringData kVersionUpgradingFrom44To47 = "upgrading from 4.4 to 4.7"_sd; + static constexpr StringData kVersionUpgradingFrom47To48 = "upgrading from 4.7 to 4.8"_sd; + static constexpr StringData kVersionUpgradingFrom44To48 = "upgrading from 4.4 to 4.8"_sd; static constexpr StringData kVersionUnset = "Unset"_sd; static constexpr StringData kParameterName = "featureCompatibilityVersion"_sd; static constexpr StringData kLastLTS = kVersion44; - static constexpr StringData kLastContinuous = kVersion44; - static constexpr StringData kLatest = kVersion47; - static constexpr StringData kUpgradingFromLastLTSToLatest = kVersionUpgradingFrom44To47; - static constexpr StringData kUpgradingFromLastContinuousToLatest = kVersionUpgradingFrom44To47; + static constexpr StringData kLastContinuous = kVersion47; + static constexpr StringData kLatest = kVersion48; + static constexpr StringData kUpgradingFromLastLTSToLatest = kVersionUpgradingFrom44To48; + static constexpr StringData kUpgradingFromLastContinuousToLatest = kVersionUpgradingFrom47To48; // kVersionUpgradingFromLastLTSToLastContinuous should assigned kVersionUnset when kLastLTS and // kLastContinuous are equal. - static constexpr StringData kVersionUpgradingFromLastLTSToLastContinuous = kVersionUnset; - static constexpr StringData kDowngradingFromLatestToLastLTS = kVersionDowngradingFrom47To44; + static constexpr StringData kVersionUpgradingFromLastLTSToLastContinuous = + kVersionUpgradingFrom44To47; + static constexpr StringData kDowngradingFromLatestToLastLTS = kVersionDowngradingFrom48To44; static constexpr StringData kDowngradingFromLatestToLastContinuous = - kVersionDowngradingFrom47To44; + kVersionDowngradingFrom48To47; static FeatureCompatibilityParams::Version parseVersion(StringData versionString); diff --git a/src/mongo/db/server_options.h b/src/mongo/db/server_options.h index ae3a87ec5e1..72035292cbb 100644 --- a/src/mongo/db/server_options.h +++ b/src/mongo/db/server_options.h @@ -197,29 +197,35 @@ struct ServerGlobalParams { kUnsetDefault44Behavior = 1, kFullyDowngradedTo44 = 2, kDowngradingFrom47To44 = 3, - kUpgradingFrom44To47 = 4, - kVersion47 = 5, + kDowngradingFrom48To44 = 4, + kUpgradingFrom44To47 = 5, + kUpgradingFrom44To48 = 6, + kVersion47 = 7, + kDowngradingFrom48To47 = 8, + kUpgradingFrom47To48 = 9, + kVersion48 = 10, }; // These constants should only be used for generic FCV references. Generic references are // FCV references that are expected to exist across LTS binary versions. - static constexpr Version kLatest = Version::kVersion47; - static constexpr Version kLastContinuous = Version::kFullyDowngradedTo44; + static constexpr Version kLatest = Version::kVersion48; + static constexpr Version kLastContinuous = Version::kVersion47; static constexpr Version kLastLTS = Version::kFullyDowngradedTo44; // These constants should only be used for generic FCV references. Generic references are // FCV references that are expected to exist across LTS binary versions. // NOTE: DO NOT USE THEM FOR REGULAR FCV CHECKS. - static constexpr Version kUpgradingFromLastLTSToLatest = Version::kUpgradingFrom44To47; + static constexpr Version kUpgradingFromLastLTSToLatest = Version::kUpgradingFrom44To48; static constexpr Version kUpgradingFromLastContinuousToLatest = - Version::kUpgradingFrom44To47; - static constexpr Version kDowngradingFromLatestToLastLTS = Version::kDowngradingFrom47To44; + Version::kUpgradingFrom47To48; + static constexpr Version kDowngradingFromLatestToLastLTS = Version::kDowngradingFrom48To44; static constexpr Version kDowngradingFromLatestToLastContinuous = - Version::kDowngradingFrom47To44; + Version::kDowngradingFrom48To47; // kUpgradingFromLastLTSToLastContinuous is only ever set to a valid FCV when // kLastLTS and kLastContinuous are not equal. Otherwise, this value should be set to // kInvalid. - static constexpr Version kUpgradingFromLastLTSToLastContinuous = Version::kInvalid; + static constexpr Version kUpgradingFromLastLTSToLastContinuous = + Version::kUpgradingFrom44To47; /** * On startup, the featureCompatibilityVersion may not have been explicitly set yet. This diff --git a/src/mongo/db/startup_recovery.cpp b/src/mongo/db/startup_recovery.cpp index fbaaef9637f..45101c407cb 100644 --- a/src/mongo/db/startup_recovery.cpp +++ b/src/mongo/db/startup_recovery.cpp @@ -115,12 +115,13 @@ Status restoreMissingFeatureCompatibilityVersionDocument(OperationContext* opCtx fcvColl, BSON("_id" << FeatureCompatibilityVersionParser::kParameterName), featureCompatibilityVersion)) { + // (Generic FCV reference): This FCV reference should exist across LTS binary versions. LOGV2(21000, "Re-creating featureCompatibilityVersion document that was deleted. Creating new " "document with version " - "{FeatureCompatibilityVersionParser_kVersion44}.", + "{FeatureCompatibilityVersionParser_kLastLTS}.", "Re-creating featureCompatibilityVersion document that was deleted", - "version"_attr = FeatureCompatibilityVersionParser::kVersion44); + "version"_attr = FeatureCompatibilityVersionParser::kLastLTS); FeatureCompatibilityVersionDocument fcvDoc; // (Generic FCV reference): This FCV reference should exist across LTS binary versions. diff --git a/src/mongo/db/wire_version.h b/src/mongo/db/wire_version.h index 736038f42ea..2e442738de9 100644 --- a/src/mongo/db/wire_version.h +++ b/src/mongo/db/wire_version.h @@ -86,9 +86,12 @@ enum WireVersion { // Supports features available from 4.7 and onwards. WIRE_VERSION_47 = 10, + // Supports features available from 4.8 and onwards. + WIRE_VERSION_48 = 11, + // Set this to the highest value in this enum - it will be the default maxWireVersion for // the WireSpec values. - LATEST_WIRE_VERSION = WIRE_VERSION_47, + LATEST_WIRE_VERSION = WIRE_VERSION_48, // Set this to LATEST_WIRE_VERSION - 1. LAST_CONT_WIRE_VERSION = LATEST_WIRE_VERSION - 1, diff --git a/src/mongo/rpc/protocol_test.cpp b/src/mongo/rpc/protocol_test.cpp index e67cf9f6720..97f6ac1d763 100644 --- a/src/mongo/rpc/protocol_test.cpp +++ b/src/mongo/rpc/protocol_test.cpp @@ -290,13 +290,16 @@ TEST(Protocol, validateWireVersion) { for (const auto& mongoSRange : mongoSBinaryRanges) { for (const auto& mongoDLatestRange : mongoDLatestBinaryRanges) { - // MongoS 'latest' binary can communicate with all FCV versions - // MongoS 'last-cont' binary can only communicate with MongoD downgraded 'last-cont' FCV - // MongoS 'last-lts' binary can only communicate with MongoD downgraded 'last-lts' FCV + // MongoS 'latest' binary can communicate with all FCV versions. + // MongoS 'last-cont' binary can only communicate with MongoD downgraded 'last-cont' and + // 'last-lts' FCV. + // MongoS 'last-lts' binary can only communicate with MongoD downgraded 'last-lts' FCV. if (mongoSRange.minWireVersion == WireVersion::LATEST_WIRE_VERSION || (mongoSRange.minWireVersion == WireVersion::LAST_CONT_WIRE_VERSION && mongoDLatestRange.minWireVersion == WireVersion::LAST_CONT_WIRE_VERSION) || (mongoSRange.minWireVersion == WireVersion::LAST_LTS_WIRE_VERSION && + mongoDLatestRange.minWireVersion == WireVersion::LAST_LTS_WIRE_VERSION) || + (mongoSRange.minWireVersion == WireVersion::LAST_CONT_WIRE_VERSION && mongoDLatestRange.minWireVersion == WireVersion::LAST_LTS_WIRE_VERSION)) { VALIDATE_WIRE_VERSION(ASSERT_OK, mongoSRange.minWireVersion, diff --git a/src/mongo/shell/feature_compatibility_version.js b/src/mongo/shell/feature_compatibility_version.js index 1c2c727be33..f607011cf4d 100644 --- a/src/mongo/shell/feature_compatibility_version.js +++ b/src/mongo/shell/feature_compatibility_version.js @@ -10,13 +10,13 @@ * multiple times. */ -var latestFCV = "4.7"; -var lastContinuousFCV = "4.4"; +var latestFCV = "4.8"; +var lastContinuousFCV = "4.7"; var lastLTSFCV = "4.4"; // The number of versions since the last-lts version. When numVersionsSinceLastLTS = 1, // lastContinuousFCV is equal to lastLTSFCV. This is used to calculate the expected minWireVersion // in jstests that use the lastLTSFCV. This should be updated on each release. -var numVersionsSinceLastLTS = 1; +var numVersionsSinceLastLTS = 2; /** * Returns the FCV associated with a binary version. diff --git a/src/mongo/shell/servers.js b/src/mongo/shell/servers.js index c23b9afff65..39e47a73004 100644 --- a/src/mongo/shell/servers.js +++ b/src/mongo/shell/servers.js @@ -210,7 +210,7 @@ MongoRunner.binVersionSubs = [ new MongoRunner.VersionSub(extractMajorVersionFromVersionString(shellVersion()), shellVersion()), // To-be-updated when we branch for the next release. - new MongoRunner.VersionSub("last-continuous", "4.4"), + new MongoRunner.VersionSub("last-continuous", "4.7"), // To be updated when we branch for the next LTS release. new MongoRunner.VersionSub("last-lts", "4.4") ]; diff --git a/src/mongo/shell/shardingtest.js b/src/mongo/shell/shardingtest.js index 63f57bc0ccd..866f6bc9762 100644 --- a/src/mongo/shell/shardingtest.js +++ b/src/mongo/shell/shardingtest.js @@ -1008,7 +1008,8 @@ var ShardingTest = function(params) { // as well, because it does not update mongosOptions.binVersion. // TODO SERVER-50389: Differentiate between 'last-lts' and 'last-continuous' when // last-continuous is supported with shardMixedBinVersions. - if (jsTestOptions().shardMixedBinVersions || + if ((MongoRunner.areBinVersionsTheSame(binVersion, "last-lts") && + jsTestOptions().shardMixedBinVersions) || (jsTestOptions().mongosBinVersion && MongoRunner.areBinVersionsTheSame(binVersion, jsTestOptions().mongosBinVersion))) { return true; |