From 10d1fe34d902d72df318e58b8c0e3b27a2d4e3e6 Mon Sep 17 00:00:00 2001 From: Rui Liu Date: Tue, 2 Aug 2022 17:36:59 +0000 Subject: SERVER-61685 Remove isTimeseriesNamespace flag for collMod --- buildscripts/idl/idl_check_compatibility.py | 3 +++ src/mongo/db/coll_mod.idl | 9 --------- src/mongo/db/timeseries/timeseries_collmod.cpp | 13 +++---------- 3 files changed, 6 insertions(+), 19 deletions(-) diff --git a/buildscripts/idl/idl_check_compatibility.py b/buildscripts/idl/idl_check_compatibility.py index 8dda48b6462..148bd5594b0 100644 --- a/buildscripts/idl/idl_check_compatibility.py +++ b/buildscripts/idl/idl_check_compatibility.py @@ -1053,6 +1053,9 @@ def check_command_params_or_type_struct_fields( # breaking change to the API because it was added and removed behind a feature flag, so it was # never officially released. allow_list = ["endSessions-param-stmtId", "refreshSessions-param-stmtId"] + # We allow collMod isTimeseriesNamespace parameter to be removed because it's implicitly + # added from mongos and not documented in the API. + allow_list += ["collMod-param-isTimeseriesNamespace"] for old_field in old_struct_fields or []: new_field_exists = False diff --git a/src/mongo/db/coll_mod.idl b/src/mongo/db/coll_mod.idl index ae7b75c38e3..68ad7fe76a5 100644 --- a/src/mongo/db/coll_mod.idl +++ b/src/mongo/db/coll_mod.idl @@ -176,15 +176,6 @@ structs: optional: true type: CollModTimeseries stability: stable - # TODO (SERVER-61685): `isTimeseriesNamespace` is not needed for the collMod command but kept - # for backward compatibility. Remove this flag after 6.0 branching. - isTimeseriesNamespace: - description: "This flag is set to true when the command was originally sent to - mongos on the time-series view, but got rewritten to target - time-series buckets namespace before being sent to shards." - optional: true - type: bool - stability: internal dryRun: description: "Runs the requested modification without modifying any database state. This can be used to determine in advance if a particular collMod diff --git a/src/mongo/db/timeseries/timeseries_collmod.cpp b/src/mongo/db/timeseries/timeseries_collmod.cpp index 114eecb3532..a58e1462348 100644 --- a/src/mongo/db/timeseries/timeseries_collmod.cpp +++ b/src/mongo/db/timeseries/timeseries_collmod.cpp @@ -46,10 +46,7 @@ std::unique_ptr makeTimeseriesBucketsCollModCommand(OperationContext* o const CollMod& origCmd) { const auto& origNs = origCmd.getNamespace(); - auto isCommandOnTimeseriesBucketNamespace = - origCmd.getIsTimeseriesNamespace() && *origCmd.getIsTimeseriesNamespace(); - auto timeseriesOptions = - timeseries::getTimeseriesOptions(opCtx, origNs, !isCommandOnTimeseriesBucketNamespace); + auto timeseriesOptions = timeseries::getTimeseriesOptions(opCtx, origNs, true); // Return early with null if we are not working with a time-series collection. if (!timeseriesOptions) { @@ -69,8 +66,7 @@ std::unique_ptr makeTimeseriesBucketsCollModCommand(OperationContext* o index->setKeyPattern(std::move(bucketsIndexSpecWithStatus.getValue())); } - auto ns = - isCommandOnTimeseriesBucketNamespace ? origNs : origNs.makeTimeseriesBucketsNamespace(); + auto ns = origNs.makeTimeseriesBucketsNamespace(); CollModRequest request; request.setIndex(index); request.setValidator(origCmd.getValidator()); @@ -92,10 +88,7 @@ std::unique_ptr makeTimeseriesViewCollModCommand(OperationContext* opCt const CollMod& origCmd) { const auto& ns = origCmd.getNamespace(); - auto isCommandOnTimeseriesBucketNamespace = - origCmd.getIsTimeseriesNamespace() && *origCmd.getIsTimeseriesNamespace(); - auto timeseriesOptions = - timeseries::getTimeseriesOptions(opCtx, ns, !isCommandOnTimeseriesBucketNamespace); + auto timeseriesOptions = timeseries::getTimeseriesOptions(opCtx, ns, true); // Return early with null if we are not working with a time-series collection. if (!timeseriesOptions) { -- cgit v1.2.1