summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRui Liu <rui.liu@mongodb.com>2022-08-02 17:36:59 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-08-02 18:25:36 +0000
commit10d1fe34d902d72df318e58b8c0e3b27a2d4e3e6 (patch)
tree98b3731afd2e625cbb564063632cce0134da8d3b
parent0a21096a620e6492c087df3c20740f95c5e1e768 (diff)
downloadmongo-10d1fe34d902d72df318e58b8c0e3b27a2d4e3e6.tar.gz
SERVER-61685 Remove isTimeseriesNamespace flag for collMod
-rw-r--r--buildscripts/idl/idl_check_compatibility.py3
-rw-r--r--src/mongo/db/coll_mod.idl9
-rw-r--r--src/mongo/db/timeseries/timeseries_collmod.cpp13
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<CollMod> 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<CollMod> 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<CollMod> 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) {