summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/create_collection_coordinator.cpp
diff options
context:
space:
mode:
authorAntonio Fuschetto <antonio.fuschetto@mongodb.com>2021-08-26 21:04:10 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-08-26 21:26:26 +0000
commit7f1ec52be8e1a04af3fa542d3de245d83adddd01 (patch)
tree20ffdf20b8b4460a3e3c1afecd9b4d8befcd237b /src/mongo/db/s/create_collection_coordinator.cpp
parentf40810c7c8706754b647992fbde1dc2745616b7c (diff)
downloadmongo-7f1ec52be8e1a04af3fa542d3de245d83adddd01.tar.gz
SERVER-58574 Modify the setFCV command to set/unset the long names flag
Diffstat (limited to 'src/mongo/db/s/create_collection_coordinator.cpp')
-rw-r--r--src/mongo/db/s/create_collection_coordinator.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mongo/db/s/create_collection_coordinator.cpp b/src/mongo/db/s/create_collection_coordinator.cpp
index bd9b4819a6f..5eeb7f09c60 100644
--- a/src/mongo/db/s/create_collection_coordinator.cpp
+++ b/src/mongo/db/s/create_collection_coordinator.cpp
@@ -758,9 +758,17 @@ void CreateCollectionCoordinator::_commit(OperationContext* opCtx) {
coll.setKeyPattern(_shardKeyPattern->getKeyPattern());
+ // Prevent the FCV from changing before committing the new collection to the config server. This
+ // ensures that the 'supportingLongName' field is properly set (and committed) based on the
+ // current shard's FCV.
+ //
+ // TODO: Remove once FCV 6.0 becomes last-lts
+ FixedFCVRegion fixedFCVRegion(opCtx);
+
+ // TODO: Remove condition once FCV 6.0 becomes last-lts
const auto& currentFCV = serverGlobalParams.featureCompatibility;
if (currentFCV.isGreaterThanOrEqualTo(
- ServerGlobalParams::FeatureCompatibility::Version::kVersion51)) {
+ ServerGlobalParams::FeatureCompatibility::Version::kUpgradingFrom50To51)) {
coll.setSupportingLongName(SupportingLongNameStatusEnum::kImplicitlyEnabled);
}