summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
Diffstat (limited to 'jstests')
-rw-r--r--jstests/auth/change_stream_pre_image_coll_role_auth.js1
-rw-r--r--jstests/change_streams/change_stream_pre_image_lookup_whole_db_whole_cluster.js33
-rw-r--r--jstests/change_streams/change_streams_lookup_preimage_with_chunk_migration.js1
-rw-r--r--jstests/change_streams/lookup_pit_pre_and_post_image.js17
-rw-r--r--jstests/change_streams/lookup_pit_pre_and_post_image_in_transaction.js4
-rw-r--r--jstests/change_streams/lookup_pre_image.js28
-rw-r--r--jstests/core/write_change_stream_pit_preimage.js1
-rw-r--r--jstests/libs/change_stream_util.js10
-rw-r--r--jstests/noPassthrough/change_stream_preimages_fail_on_mongos.js48
-rw-r--r--jstests/noPassthrough/change_stream_preimages_standalone_mode.js1
-rw-r--r--jstests/noPassthrough/change_streams_pre_and_post_images_in_create_and_collmod.js1
-rw-r--r--jstests/noPassthrough/change_streams_pre_image_removal_job.js1
-rw-r--r--jstests/noPassthrough/write_change_stream_pit_preimage_in_transaction.js9
-rw-r--r--jstests/replsets/change_stream_pit_pre_image_deletion_asymmetric.js1
-rw-r--r--jstests/replsets/change_stream_pit_pre_images.js1
-rw-r--r--jstests/sharding/change_streams/change_stream_lookup_preimage_with_resharding.js1
-rw-r--r--jstests/sharding/internal_txns/retryable_findAndModify_change_stream_images_enabled.js1
17 files changed, 13 insertions, 146 deletions
diff --git a/jstests/auth/change_stream_pre_image_coll_role_auth.js b/jstests/auth/change_stream_pre_image_coll_role_auth.js
index 3057b34fb46..fcbeec157b6 100644
--- a/jstests/auth/change_stream_pre_image_coll_role_auth.js
+++ b/jstests/auth/change_stream_pre_image_coll_role_auth.js
@@ -4,7 +4,6 @@
* Verify that if pre-image for the collection has been deleted by the 'root' user.
* @tags: [
* requires_fcv_60,
- * featureFlagChangeStreamPreAndPostImages,
* uses_change_streams,
* assumes_read_preference_unchanged,
* requires_replication,
diff --git a/jstests/change_streams/change_stream_pre_image_lookup_whole_db_whole_cluster.js b/jstests/change_streams/change_stream_pre_image_lookup_whole_db_whole_cluster.js
index 4e8feacada3..4087ab65f73 100644
--- a/jstests/change_streams/change_stream_pre_image_lookup_whole_db_whole_cluster.js
+++ b/jstests/change_streams/change_stream_pre_image_lookup_whole_db_whole_cluster.js
@@ -11,45 +11,22 @@
(function() {
"use strict";
-load("jstests/libs/change_stream_util.js"); // For isChangeStreamPreAndPostImagesEnabled.
-load("jstests/libs/fixture_helpers.js"); // For FixtureHelpers.
+load("jstests/libs/fixture_helpers.js"); // For FixtureHelpers.
const testDB = db.getSiblingDB(jsTestName());
const adminDB = db.getSiblingDB("admin");
const collWithPreImageName = "coll_with_pre_images";
const collWithNoPreImageName = "coll_with_no_pre_images";
-const canRecordPreImagesInConfigDb = isChangeStreamPreAndPostImagesEnabled(testDB);
-
-if (!canRecordPreImagesInConfigDb && FixtureHelpers.isMongos(db)) {
- jsTestLog("Skipping test as pre image lookup is not supported in sharded cluster with feature" +
- "flag 'featureFlagChangeStreamPreAndPostImages' disabled.");
- return;
-}
-
-if (canRecordPreImagesInConfigDb &&
- (jsTestOptions().shardMixedBinVersions || jsTestOptions().mixedBinVersions)) {
- jsTestLog("Skipping test because multiversion test-suite is unsupported when flag " +
- "'featureFlagChangeStreamPreAndPostImages' enabled");
- return;
-}
assert.commandWorked(testDB.dropDatabase());
// Create one collection that has pre-image recording enabled...
-if (!canRecordPreImagesInConfigDb) {
- assert.commandWorked(testDB.createCollection(collWithPreImageName, {recordPreImages: true}));
-} else {
- assert.commandWorked(testDB.createCollection(collWithPreImageName,
- {changeStreamPreAndPostImages: {enabled: true}}));
-}
+assert.commandWorked(
+ testDB.createCollection(collWithPreImageName, {changeStreamPreAndPostImages: {enabled: true}}));
//... and one collection which has pre-images disabled.
-if (!canRecordPreImagesInConfigDb) {
- assert.commandWorked(testDB.createCollection(collWithNoPreImageName, {recordPreImages: false}));
-} else {
- assert.commandWorked(testDB.createCollection(collWithNoPreImageName,
- {changeStreamPreAndPostImages: {enabled: false}}));
-}
+assert.commandWorked(testDB.createCollection(collWithNoPreImageName,
+ {changeStreamPreAndPostImages: {enabled: false}}));
const collWithPreImages = testDB.coll_with_pre_images;
const collWithNoPreImages = testDB.coll_with_no_pre_images;
diff --git a/jstests/change_streams/change_streams_lookup_preimage_with_chunk_migration.js b/jstests/change_streams/change_streams_lookup_preimage_with_chunk_migration.js
index dd7fa9588e2..95edadfebf5 100644
--- a/jstests/change_streams/change_streams_lookup_preimage_with_chunk_migration.js
+++ b/jstests/change_streams/change_streams_lookup_preimage_with_chunk_migration.js
@@ -4,7 +4,6 @@
*
* @tags: [
* requires_fcv_60,
- * featureFlagChangeStreamPreAndPostImages,
* requires_sharding,
* uses_change_streams,
* change_stream_does_not_expect_txns,
diff --git a/jstests/change_streams/lookup_pit_pre_and_post_image.js b/jstests/change_streams/lookup_pit_pre_and_post_image.js
index 30f8a4658a7..42fd387caaa 100644
--- a/jstests/change_streams/lookup_pit_pre_and_post_image.js
+++ b/jstests/change_streams/lookup_pit_pre_and_post_image.js
@@ -1,30 +1,13 @@
// Tests that the point-in-time pre- and post-images are loaded correctly in $changeStream running
// with different arguments for collections with 'changeStreamPreAndPostImages' being enabled.
-// @tags: [
-// requires_fcv_52,
-// ]
(function() {
"use strict";
load("jstests/libs/collection_drop_recreate.js"); // For assertDropAndRecreateCollection.
-load("jstests/libs/change_stream_util.js"); // For isChangeStreamPreAndPostImagesEnabled.
const testDB = db.getSiblingDB(jsTestName());
const collName = "test";
-if (!isChangeStreamPreAndPostImagesEnabled(testDB)) {
- const coll = assertDropAndRecreateCollection(testDB, collName);
-
- // If feature flag is off, creating changeStream with new fullDocument arguments should throw.
- assert.throwsWithCode(() => coll.watch([], {fullDocument: 'whenAvailable'}),
- ErrorCodes.BadValue);
- assert.throwsWithCode(() => coll.watch([], {fullDocument: 'required'}), ErrorCodes.BadValue);
-
- jsTestLog(
- "Skipping test because pre-image recording capability in 'system.preimages' is not enabled.");
- return;
-}
-
const originalDoc = {
_id: 1,
x: 1
diff --git a/jstests/change_streams/lookup_pit_pre_and_post_image_in_transaction.js b/jstests/change_streams/lookup_pit_pre_and_post_image_in_transaction.js
index 6f868c377c2..0db693f55ba 100644
--- a/jstests/change_streams/lookup_pit_pre_and_post_image_in_transaction.js
+++ b/jstests/change_streams/lookup_pit_pre_and_post_image_in_transaction.js
@@ -3,15 +3,13 @@
* performed in a transaction and non-atomic "applyOps" command.
* @tags: [
* requires_fcv_60,
- * featureFlagChangeStreamPreAndPostImages,
* uses_transactions,
* ]
*/
(function() {
"use strict";
-load("jstests/libs/change_stream_util.js"); // For isChangeStreamPreAndPostImagesEnabled and
- // ChangeStreamTest.
+load("jstests/libs/change_stream_util.js"); // For ChangeStreamTest.
load("jstests/libs/collection_drop_recreate.js"); // For assertDropAndRecreateCollection.
load("jstests/libs/fixture_helpers.js"); // For FixtureHelpers.isMongos.
load("jstests/libs/transactions_util.js"); // For TransactionsUtil.runInTransaction.
diff --git a/jstests/change_streams/lookup_pre_image.js b/jstests/change_streams/lookup_pre_image.js
index 7afba2009b0..a3357a3a994 100644
--- a/jstests/change_streams/lookup_pre_image.js
+++ b/jstests/change_streams/lookup_pre_image.js
@@ -2,7 +2,6 @@
* Tests the behaviour of the 'fullDocumentBeforeChange' argument to the $changeStream stage.
*
* @tags: [
- * requires_fcv_52,
* assumes_unsharded_collection,
* do_not_wrap_aggregations_in_facets,
* uses_multiple_connections,
@@ -11,29 +10,16 @@
(function() {
"use strict";
-load("jstests/libs/change_stream_util.js"); // For ChangeStreamTest and
- // isChangeStreamPreAndPostImagesEnabled.
+load("jstests/libs/change_stream_util.js"); // For ChangeStreamTest.
load("jstests/libs/collection_drop_recreate.js"); // For assert[Drop|Create]Collection.
load("jstests/libs/fixture_helpers.js"); // For FixtureHelpers.
-const canRecordPreImagesInConfigDb = isChangeStreamPreAndPostImagesEnabled(db);
-
-if (!canRecordPreImagesInConfigDb && FixtureHelpers.isMongos(db)) {
- jsTestLog("Skipping test as pre image lookup is not supported in sharded cluster with feature" +
- "flag 'featureFlagChangeStreamPreAndPostImages' disabled.");
- return;
-}
-
const coll = assertDropAndRecreateCollection(db, "change_stream_pre_images");
const cst = new ChangeStreamTest(db);
// Enable pre-image recording on the test collection.
-if (!canRecordPreImagesInConfigDb) {
- assert.commandWorked(db.runCommand({collMod: coll.getName(), recordPreImages: true}));
-} else {
- assert.commandWorked(
- db.runCommand({collMod: coll.getName(), changeStreamPreAndPostImages: {enabled: true}}));
-}
+assert.commandWorked(
+ db.runCommand({collMod: coll.getName(), changeStreamPreAndPostImages: {enabled: true}}));
// Open three streams on the collection, one for each "fullDocumentBeforeChange" mode.
const csNoPreImages = cst.startWatchingChanges({
@@ -110,12 +96,8 @@ assert.docEq(latestChange, cst.getOneChange(csPreImageWhenAvailableCursor));
assert.docEq(latestChange, cst.getOneChange(csPreImageRequiredCursor));
// Now disable pre-image generation on the test collection and re-test.
-if (!canRecordPreImagesInConfigDb) {
- assert.commandWorked(db.runCommand({collMod: coll.getName(), recordPreImages: false}));
-} else {
- assert.commandWorked(
- db.runCommand({collMod: coll.getName(), changeStreamPreAndPostImages: {enabled: false}}));
-}
+assert.commandWorked(
+ db.runCommand({collMod: coll.getName(), changeStreamPreAndPostImages: {enabled: false}}));
// Test pre-image lookup for an insertion. No pre-image exists on any cursor.
assert.commandWorked(coll.insert({_id: "y"}));
diff --git a/jstests/core/write_change_stream_pit_preimage.js b/jstests/core/write_change_stream_pit_preimage.js
index 9dd44886abe..a1cfd730fe4 100644
--- a/jstests/core/write_change_stream_pit_preimage.js
+++ b/jstests/core/write_change_stream_pit_preimage.js
@@ -2,7 +2,6 @@
// collections with 'changeStreamPreAndPostImages' being enabled.
// @tags: [
// requires_fcv_60,
-// featureFlagChangeStreamPreAndPostImages,
// assumes_against_mongod_not_mongos,
// requires_capped,
// requires_replication,
diff --git a/jstests/libs/change_stream_util.js b/jstests/libs/change_stream_util.js
index e57188d8d0d..40c8ee7b6bb 100644
--- a/jstests/libs/change_stream_util.js
+++ b/jstests/libs/change_stream_util.js
@@ -25,16 +25,6 @@ function tojsonMaybeTruncate(jsonObj) {
}
/**
- * Returns true if feature flag 'featureFlagChangeStreamPreAndPostImages' is enabled, false
- * otherwise.
- */
-function isChangeStreamPreAndPostImagesEnabled(db) {
- const getParam = db.adminCommand({getParameter: 1, featureFlagChangeStreamPreAndPostImages: 1});
- return getParam.hasOwnProperty("featureFlagChangeStreamPreAndPostImages") &&
- getParam.featureFlagChangeStreamPreAndPostImages.value;
-}
-
-/**
* Returns true if feature flag 'featureFlagChangeStreamsRewrite' is enabled, false otherwise.
*/
function isChangeStreamsRewriteEnabled(db) {
diff --git a/jstests/noPassthrough/change_stream_preimages_fail_on_mongos.js b/jstests/noPassthrough/change_stream_preimages_fail_on_mongos.js
deleted file mode 100644
index dd871885c6c..00000000000
--- a/jstests/noPassthrough/change_stream_preimages_fail_on_mongos.js
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * Test that mongoS rejects change streams which request 'fullDocumentBeforeChange' pre-images.
- *
- * @tags: [uses_change_streams, requires_replication]
- */
-(function() {
-'use strict';
-
-load("jstests/libs/change_stream_util.js"); // For isChangeStreamPreAndPostImagesEnabled.
-
-const st = new ShardingTest({
- shards: 1,
- mongos: 1,
- config: 1,
-});
-
-const shard = st.shard0;
-const mongos = st.s;
-
-if (isChangeStreamPreAndPostImagesEnabled(mongos.getDB("test"))) {
- jsTestLog(
- "Skipping test as pre-image lookup is supported in sharded clusters with feature flag " +
- "'featureFlagChangeStreamPreAndPostImages' enabled.");
- st.stop();
- return;
-}
-
-// Test that we cannot create a collection with pre-images enabled in a sharded cluster.
-assert.commandFailed(shard.getDB("test").runCommand({create: "test", recordPreImages: true}));
-
-// Test that attempting to run $changeStream with {fullDocumentBeforeChange: "whenAvailable"} fails.
-assert.commandFailedWithCode(mongos.getDB("test").runCommand({
- aggregate: 1,
- pipeline: [{$changeStream: {fullDocumentBeforeChange: "whenAvailable"}}],
- cursor: {}
-}),
- 51771);
-
-// Test that attempting to run $changeStream with {fullDocumentBeforeChange: "required"} fails.
-assert.commandFailedWithCode(mongos.getDB("test").runCommand({
- aggregate: 1,
- pipeline: [{$changeStream: {fullDocumentBeforeChange: "required"}}],
- cursor: {}
-}),
- 51771);
-
-st.stop();
-}());
diff --git a/jstests/noPassthrough/change_stream_preimages_standalone_mode.js b/jstests/noPassthrough/change_stream_preimages_standalone_mode.js
index bc2b746c8a5..c36d03433e6 100644
--- a/jstests/noPassthrough/change_stream_preimages_standalone_mode.js
+++ b/jstests/noPassthrough/change_stream_preimages_standalone_mode.js
@@ -9,7 +9,6 @@
* # test suite that turns journaling off.
* requires_replication,
* requires_fcv_60,
- * featureFlagChangeStreamPreAndPostImages,
* ]
*/
diff --git a/jstests/noPassthrough/change_streams_pre_and_post_images_in_create_and_collmod.js b/jstests/noPassthrough/change_streams_pre_and_post_images_in_create_and_collmod.js
index 0ee617fd1cb..cd7b5e16bd7 100644
--- a/jstests/noPassthrough/change_streams_pre_and_post_images_in_create_and_collmod.js
+++ b/jstests/noPassthrough/change_streams_pre_and_post_images_in_create_and_collmod.js
@@ -4,7 +4,6 @@
* 'config' databases as well as on view collections.
* @tags: [
* requires_fcv_60,
- * featureFlagChangeStreamPreAndPostImages,
* requires_replication,
* ]
*/
diff --git a/jstests/noPassthrough/change_streams_pre_image_removal_job.js b/jstests/noPassthrough/change_streams_pre_image_removal_job.js
index 6888f89e84f..09b37951157 100644
--- a/jstests/noPassthrough/change_streams_pre_image_removal_job.js
+++ b/jstests/noPassthrough/change_streams_pre_image_removal_job.js
@@ -3,7 +3,6 @@
// periodic job.
// @tags: [
// requires_fcv_60,
-// featureFlagChangeStreamPreAndPostImages,
// assumes_against_mongod_not_mongos,
// change_stream_does_not_expect_txns,
// requires_replication,
diff --git a/jstests/noPassthrough/write_change_stream_pit_preimage_in_transaction.js b/jstests/noPassthrough/write_change_stream_pit_preimage_in_transaction.js
index 4000a318405..439835b6082 100644
--- a/jstests/noPassthrough/write_change_stream_pit_preimage_in_transaction.js
+++ b/jstests/noPassthrough/write_change_stream_pit_preimage_in_transaction.js
@@ -3,7 +3,6 @@
* transactions and for non-atomic "applyOps" command.
* @tags: [
* requires_fcv_60,
- * featureFlagChangeStreamPreAndPostImages,
* requires_replication,
* no_selinux,
* requires_majority_read_concern,
@@ -14,12 +13,8 @@
load("jstests/core/txns/libs/prepare_helpers.js"); // For PrepareHelpers.prepareTransaction.
load("jstests/libs/collection_drop_recreate.js"); // For assertDropAndRecreateCollection.
-load(
- "jstests/libs/change_stream_util.js"); // For
- // assertChangeStreamPreAndPostImagesCollectionOptionIsEnabled,
- // assertChangeStreamPreAndPostImagesCollectionOptionIsAbsent,
- // preImagesForOps.
-load("jstests/libs/transactions_util.js"); // For TransactionsUtil.runInTransaction.
+load("jstests/libs/change_stream_util.js"); // For preImagesForOps.
+load("jstests/libs/transactions_util.js"); // For TransactionsUtil.runInTransaction.
const rst = new ReplSetTest({
nodes: [
diff --git a/jstests/replsets/change_stream_pit_pre_image_deletion_asymmetric.js b/jstests/replsets/change_stream_pit_pre_image_deletion_asymmetric.js
index fea020be7f6..d014b3e0981 100644
--- a/jstests/replsets/change_stream_pit_pre_image_deletion_asymmetric.js
+++ b/jstests/replsets/change_stream_pit_pre_image_deletion_asymmetric.js
@@ -5,7 +5,6 @@
*
* @tags: [
* requires_fcv_60,
- * featureFlagChangeStreamPreAndPostImages,
* ]
*/
(function() {
diff --git a/jstests/replsets/change_stream_pit_pre_images.js b/jstests/replsets/change_stream_pit_pre_images.js
index 154ae1a6c04..5434b5a3d4d 100644
--- a/jstests/replsets/change_stream_pit_pre_images.js
+++ b/jstests/replsets/change_stream_pit_pre_images.js
@@ -6,7 +6,6 @@
*
* @tags: [
* requires_fcv_60,
- * featureFlagChangeStreamPreAndPostImages,
* # The test waits for the Checkpointer, but this process runs only for on-disk storage engines.
* requires_persistence,
* ]
diff --git a/jstests/sharding/change_streams/change_stream_lookup_preimage_with_resharding.js b/jstests/sharding/change_streams/change_stream_lookup_preimage_with_resharding.js
index 3b366b35145..4ae9d2f55d6 100644
--- a/jstests/sharding/change_streams/change_stream_lookup_preimage_with_resharding.js
+++ b/jstests/sharding/change_streams/change_stream_lookup_preimage_with_resharding.js
@@ -4,7 +4,6 @@
* stream events - ones that happened before, during, and after resharding of the collection.
*
* @tags: [
- * featureFlagChangeStreamPreAndPostImages,
* requires_fcv_60,
* uses_change_streams,
* assumes_unsharded_collection,
diff --git a/jstests/sharding/internal_txns/retryable_findAndModify_change_stream_images_enabled.js b/jstests/sharding/internal_txns/retryable_findAndModify_change_stream_images_enabled.js
index 9932825e219..171477e3f57 100644
--- a/jstests/sharding/internal_txns/retryable_findAndModify_change_stream_images_enabled.js
+++ b/jstests/sharding/internal_txns/retryable_findAndModify_change_stream_images_enabled.js
@@ -4,7 +4,6 @@
*
* @tags: [
* requires_fcv_60,
- * featureFlagChangeStreamPreAndPostImages,
* uses_transactions,
* ]
*/