summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErin Liang <59406045+erl-ang@users.noreply.github.com>2024-08-05 17:48:14 -0400
committerMongoDB Bot <mongo-bot@mongodb.com>2024-08-05 22:30:35 +0000
commitbdc66c0eaa30be19a90a2342ebe77f35dfd04500 (patch)
tree041615dabaa05153f1e0469119cea3bd4622f46e
parent0de4074a3984210f5fa03005950e7f896d728a80 (diff)
SERVER-93099 Allow collMod with timeseriesBucketsMayHaveMixedSchemaData=false (#25752)r7.0.13-rc0
GitOrigin-RevId: 1628203bd5754119e4c3f4324c8cf25eb3bc75aa
-rw-r--r--etc/backports_required_for_multiversion_tests.yml8
-rw-r--r--jstests/core/timeseries/timeseries_insert_mixed_schema_bucket.js6
-rw-r--r--jstests/core/timeseries/timeseries_update_mixed_schema_bucket.js6
-rw-r--r--jstests/noPassthrough/timeseries_validate_mixed_schema_bucket.js2
-rw-r--r--src/mongo/db/catalog/coll_mod.cpp7
5 files changed, 14 insertions, 15 deletions
diff --git a/etc/backports_required_for_multiversion_tests.yml b/etc/backports_required_for_multiversion_tests.yml
index 98e3ac9c4bc..fdd239a90ac 100644
--- a/etc/backports_required_for_multiversion_tests.yml
+++ b/etc/backports_required_for_multiversion_tests.yml
@@ -549,6 +549,10 @@ last-continuous:
ticket: SERVER-91195
- test_file: jstests/core/sparse_index_supports_ne_null.js
ticket: SERVER-37164
+ - test_file: jstests/core/timeseries/timeseries_insert_mixed_schema_bucket.js
+ ticket: SERVER-93099
+ - test_file: jstests/core/timeseries/timeseries_update_mixed_schema_bucket.js
+ ticket: SERVER-93099
suites: null
last-lts:
all:
@@ -1150,4 +1154,8 @@ last-lts:
ticket: SERVER-91195
- test_file: jstests/core/sparse_index_supports_ne_null.js
ticket: SERVER-37164
+ - test_file: jstests/core/timeseries/timeseries_insert_mixed_schema_bucket.js
+ ticket: SERVER-93099
+ - test_file: jstests/core/timeseries/timeseries_update_mixed_schema_bucket.js
+ ticket: SERVER-93099
suites: null
diff --git a/jstests/core/timeseries/timeseries_insert_mixed_schema_bucket.js b/jstests/core/timeseries/timeseries_insert_mixed_schema_bucket.js
index 9e5a28920be..6079dc9fd78 100644
--- a/jstests/core/timeseries/timeseries_insert_mixed_schema_bucket.js
+++ b/jstests/core/timeseries/timeseries_insert_mixed_schema_bucket.js
@@ -62,9 +62,9 @@ assert.commandWorked(
testDB.runCommand({collMod: collName, timeseriesBucketsMayHaveMixedSchemaData: true}));
assert.eq(TimeseriesTest.bucketsMayHaveMixedSchemaData(bucketsColl), true);
assert.commandWorked(bucketsColl.insert(bucket));
-assert.commandFailedWithCode(
- testDB.runCommand({collMod: collName, timeseriesBucketsMayHaveMixedSchemaData: false}),
- ErrorCodes.InvalidOptions);
assert.commandWorked(bucketsColl.deleteOne({_id: bucket._id}));
assert.eq(TimeseriesTest.bucketsMayHaveMixedSchemaData(bucketsColl), true);
+assert.commandWorked(
+ testDB.runCommand({collMod: collName, timeseriesBucketsMayHaveMixedSchemaData: false}));
+assert.eq(TimeseriesTest.bucketsMayHaveMixedSchemaData(bucketsColl), false);
})();
diff --git a/jstests/core/timeseries/timeseries_update_mixed_schema_bucket.js b/jstests/core/timeseries/timeseries_update_mixed_schema_bucket.js
index 718fd432a65..94821cdf547 100644
--- a/jstests/core/timeseries/timeseries_update_mixed_schema_bucket.js
+++ b/jstests/core/timeseries/timeseries_update_mixed_schema_bucket.js
@@ -66,9 +66,9 @@ assert.commandWorked(
testDB.runCommand({collMod: collName, timeseriesBucketsMayHaveMixedSchemaData: true}));
assert.eq(TimeseriesTest.bucketsMayHaveMixedSchemaData(bucketsColl), true);
assert.commandWorked(update());
-assert.commandFailedWithCode(
- testDB.runCommand({collMod: collName, timeseriesBucketsMayHaveMixedSchemaData: false}),
- ErrorCodes.InvalidOptions);
assert.commandWorked(bucketsColl.deleteOne({_id: bucket._id}));
assert.eq(TimeseriesTest.bucketsMayHaveMixedSchemaData(bucketsColl), true);
+assert.commandWorked(
+ testDB.runCommand({collMod: collName, timeseriesBucketsMayHaveMixedSchemaData: false}));
+assert.eq(TimeseriesTest.bucketsMayHaveMixedSchemaData(bucketsColl), false);
})();
diff --git a/jstests/noPassthrough/timeseries_validate_mixed_schema_bucket.js b/jstests/noPassthrough/timeseries_validate_mixed_schema_bucket.js
index 6b1632234b5..3210f933164 100644
--- a/jstests/noPassthrough/timeseries_validate_mixed_schema_bucket.js
+++ b/jstests/noPassthrough/timeseries_validate_mixed_schema_bucket.js
@@ -14,8 +14,6 @@ const collName = "ts";
testDB.createCollection(collName, {timeseries: {timeField: "timestamp", metaField: "metadata"}});
-configureFailPoint(conn, "allowSetTimeseriesBucketsMayHaveMixedSchemaDataFalse");
-
assert.commandWorked(testDB.runCommand({drop: collName}));
assert.commandWorked(
testDB.createCollection(collName, {timeseries: {timeField: "t", metaField: "m"}}));
diff --git a/src/mongo/db/catalog/coll_mod.cpp b/src/mongo/db/catalog/coll_mod.cpp
index c76fb7138b9..0c266a0a3b0 100644
--- a/src/mongo/db/catalog/coll_mod.cpp
+++ b/src/mongo/db/catalog/coll_mod.cpp
@@ -72,7 +72,6 @@ namespace {
MONGO_FAIL_POINT_DEFINE(hangAfterDatabaseLock);
MONGO_FAIL_POINT_DEFINE(hangAfterCollModIndexUniqueFullIndexScan);
MONGO_FAIL_POINT_DEFINE(hangAfterCollModIndexUniqueReleaseIXLock);
-MONGO_FAIL_POINT_DEFINE(allowSetTimeseriesBucketsMayHaveMixedSchemaDataFalse);
void assertNoMovePrimaryInProgress(OperationContext* opCtx, NamespaceString const& nss) {
try {
@@ -593,12 +592,6 @@ StatusWith<std::pair<ParsedCollModRequest, BSONObj>> parseCollModRequest(
CollMod::kTimeseriesBucketsMayHaveMixedSchemaDataFieldName);
}
- if (!*mixedSchema &&
- !MONGO_unlikely(allowSetTimeseriesBucketsMayHaveMixedSchemaDataFalse.shouldFail())) {
- return {ErrorCodes::InvalidOptions,
- "Cannot set timeseriesBucketsMayHaveMixedSchemaData to false"};
- }
-
parsed.timeseriesBucketsMayHaveMixedSchemaData = mixedSchema;
oplogEntryBuilder.append(CollMod::kTimeseriesBucketsMayHaveMixedSchemaDataFieldName,
*mixedSchema);