diff options
author | Shin Yee Tan <shinyee.tan@mongodb.com> | 2022-02-04 19:22:14 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-02-07 20:27:15 +0000 |
commit | 9bae34235b4243dbdcb332da67badf7e9863d165 (patch) | |
tree | 3162dffe18bbbddd148b305c8036ade98ac0df2f /src/mongo/db | |
parent | ee7998e8fc911eb2fb3e16781fa248972a097c30 (diff) | |
download | mongo-9bae34235b4243dbdcb332da67badf7e9863d165.tar.gz |
Revert "SERVER-63089 Disallow downgrade when the index comment field exists"
This reverts commit 806bb2afb2415a2ecc9cc8306e1bfb606a1f74ec.
Diffstat (limited to 'src/mongo/db')
-rw-r--r-- | src/mongo/db/commands/set_feature_compatibility_version_command.cpp | 27 | ||||
-rw-r--r-- | src/mongo/db/index/index_descriptor.cpp | 5 |
2 files changed, 0 insertions, 32 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 4de98443c06..b61878d5233 100644 --- a/src/mongo/db/commands/set_feature_compatibility_version_command.cpp +++ b/src/mongo/db/commands/set_feature_compatibility_version_command.cpp @@ -718,33 +718,6 @@ private: }); } - // TODO SERVER-63171: Only check on last-lts when FCV 5.3 becomes last-continuous. - // TODO SERVER-63172: Remove once FCV 6.0 becomes last-lts. - for (const auto& tenantDbName : DatabaseHolder::get(opCtx)->getNames()) { - Lock::DBLock dbLock(opCtx, tenantDbName.dbName(), MODE_IX); - catalog::forEachCollectionFromDb( - opCtx, tenantDbName.dbName(), MODE_X, [&](const CollectionPtr& collection) { - auto indexCatalog = collection->getIndexCatalog(); - auto indexIt = indexCatalog->getIndexIterator( - opCtx, true /* includeUnfinishedIndexes */); - while (indexIt->more()) { - auto indexEntry = indexIt->next(); - uassert( - ErrorCodes::CannotDowngrade, - fmt::format( - "Cannot downgrade the cluster when there are indexes that have " - "the 'comment' field. Use listIndexes to find them and drop " - "the indexes or use collMod to manually remove the field " - "before downgrading. First detected incompatible index name: " - "'{}' on collection: '{}'", - indexEntry->descriptor()->indexName(), - collection->ns().toString()), - indexEntry->descriptor()->comment().isEmpty()); - } - return true; - }); - } - // Drop the pre-images collection if 'changeStreamPreAndPostImages' feature flag is not // enabled on the downgrade version. // TODO SERVER-61770: Remove once FCV 6.0 becomes last-lts. diff --git a/src/mongo/db/index/index_descriptor.cpp b/src/mongo/db/index/index_descriptor.cpp index fd762758bcc..07ae8f1cdc5 100644 --- a/src/mongo/db/index/index_descriptor.cpp +++ b/src/mongo/db/index/index_descriptor.cpp @@ -41,7 +41,6 @@ #include "mongo/db/matcher/expression_parser.h" #include "mongo/db/query/collation/collator_factory_interface.h" #include "mongo/db/server_options.h" -#include "mongo/db/storage/storage_parameters_gen.h" namespace mongo { @@ -137,10 +136,6 @@ IndexDescriptor::IndexDescriptor(const std::string& accessMethodName, BSONObj in } if (BSONElement commentElement = _infoObj[kCommentFieldName]) { - uassert( - ErrorCodes::InvalidOptions, - "createIndex does not support the 'comment' field", - feature_flags::gCollModIndexUnique.isEnabled(serverGlobalParams.featureCompatibility)); invariant(commentElement.isABSONObj()); _comment = commentElement.Obj().getOwned(); } |