diff options
author | Faustoleyva54 <fausto.leyva@mongodb.com> | 2023-05-12 14:39:15 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-05-12 15:37:20 +0000 |
commit | 1c5afb84c8b935fc1246fb3a689a01f22ed0fafd (patch) | |
tree | 13f6637d6c8db4462109d06444c06847373ac4f2 | |
parent | 36746fccd8c2648cec47526f24a181e9d4546147 (diff) | |
download | mongo-1c5afb84c8b935fc1246fb3a689a01f22ed0fafd.tar.gz |
SERVER-67659 Remove partial, TTL index check on time-series collections once FCV 7.0 becomes last-lts
-rw-r--r-- | src/mongo/db/commands/set_feature_compatibility_version_command.cpp | 73 |
1 files changed, 0 insertions, 73 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 ac1ac795b40..dd613e55d72 100644 --- a/src/mongo/db/commands/set_feature_compatibility_version_command.cpp +++ b/src/mongo/db/commands/set_feature_compatibility_version_command.cpp @@ -1071,79 +1071,6 @@ private: !hasShardingIndexCatalogEntries); } } - - if (serverGlobalParams.clusterRole.has(ClusterRole::ShardServer) || - serverGlobalParams.clusterRole.has(ClusterRole::None)) { - if (feature_flags::gTimeseriesScalabilityImprovements - .isDisabledOnTargetFCVButEnabledOnOriginalFCV(requestedVersion, - originalVersion)) { - for (const auto& dbName : DatabaseHolder::get(opCtx)->getNames()) { - Lock::DBLock dbLock(opCtx, dbName, MODE_IX); - catalog::forEachCollectionFromDb( - opCtx, - dbName, - MODE_S, - [&](const Collection* collection) { - auto tsOptions = collection->getTimeseriesOptions(); - invariant(tsOptions); - - auto indexCatalog = collection->getIndexCatalog(); - auto indexIt = indexCatalog->getIndexIterator( - opCtx, - IndexCatalog::InclusionPolicy::kReady | - IndexCatalog::InclusionPolicy::kUnfinished); - - // Check and fail to downgrade if the time-series collection has a - // partial, TTL index. - while (indexIt->more()) { - auto indexEntry = indexIt->next(); - if (indexEntry->descriptor()->isPartial()) { - // TODO (SERVER-67659): Remove partial, TTL index check once - // FCV 7.0 becomes last-lts. - uassert( - ErrorCodes::CannotDowngrade, - str::stream() - << "Cannot downgrade the cluster when there are " - "secondary " - "TTL indexes with partial filters on time-series " - "collections. Drop all partial, TTL indexes on " - "time-series collections before downgrading. First " - "detected incompatible index name: '" - << indexEntry->descriptor()->indexName() - << "' on collection: '" - << collection->ns() - .getTimeseriesViewNamespace() - .toStringForErrorMsg() - << "'", - !indexEntry->descriptor()->infoObj().hasField( - IndexDescriptor::kExpireAfterSecondsFieldName)); - } - } - - // Check the time-series options for a default granularity. Fail the - // downgrade if the bucketing parameters are custom values. - uassert( - ErrorCodes::CannotDowngrade, - str::stream() - << "Cannot downgrade the cluster when there are time-series " - "collections with custom bucketing parameters. In order to " - "downgrade, the time-series collection(s) must be updated " - "with a granularity of 'seconds', 'minutes' or 'hours'. " - "First detected incompatible collection: '" - << collection->ns() - .getTimeseriesViewNamespace() - .toStringForErrorMsg() - << "'", - tsOptions->getGranularity().has_value()); - - return true; - }, - [&](const Collection* collection) { - return collection->getTimeseriesOptions() != boost::none; - }); - } - } - } } // Remove cluster parameters from the clusterParameters collections which are not enabled on |