diff options
author | Siyuan Zhou <siyuan.zhou@mongodb.com> | 2017-09-06 17:57:41 -0400 |
---|---|---|
committer | Siyuan Zhou <siyuan.zhou@mongodb.com> | 2017-10-03 18:55:15 -0400 |
commit | c13400f50bbf48d6a3360172d9b419e74167d9ce (patch) | |
tree | c3a6b1c8f10342cceca85208a65fb7d339792be9 /jstests/change_streams | |
parent | 3805ccdc25facfe536302321ee4fb485f7030d0c (diff) | |
download | mongo-c13400f50bbf48d6a3360172d9b419e74167d9ce.tar.gz |
SERVER-29126 Require change streams to run with readConcern:majority
Diffstat (limited to 'jstests/change_streams')
-rw-r--r-- | jstests/change_streams/change_stream.js | 31 | ||||
-rw-r--r-- | jstests/change_streams/change_stream_invalidation.js | 20 | ||||
-rw-r--r-- | jstests/change_streams/lookup_post_image.js | 46 | ||||
-rw-r--r-- | jstests/change_streams/report_latest_observed_oplog_timestamp.js | 10 |
4 files changed, 0 insertions, 107 deletions
diff --git a/jstests/change_streams/change_stream.js b/jstests/change_streams/change_stream.js index 09edb35f647..a139b0449aa 100644 --- a/jstests/change_streams/change_stream.js +++ b/jstests/change_streams/change_stream.js @@ -3,7 +3,6 @@ "use strict"; load('jstests/libs/uuid_util.js'); - load("jstests/libs/fixture_helpers.js"); // For 'FixtureHelpers'. const oplogProjection = {$project: {"_id.clusterTime": 0}}; @@ -26,18 +25,6 @@ pipeline.push(oplogProjection); } - // TODO: SERVER-29126 - // While change streams still uses read concern level local instead of read concern level - // majority, we need to use causal consistency to be able to immediately read our own writes - // out of the oplog. Once change streams read from the majority snapshot, we can remove - // these synchronization points from this test. - assert.commandWorked(db.runCommand({ - find: "foo", - readConcern: {level: "local", afterClusterTime: db.getSession().getOperationTime()} - })); - - // Waiting for replication assures no previous operations will be included. - FixtureHelpers.awaitReplication(); let res = assert.commandWorked(db.runCommand( Object.merge({aggregate: collection.getName(), pipeline: pipeline}, aggregateOptions))); assert.neq(res.cursor.id, 0); @@ -46,12 +33,6 @@ } function assertNextBatchMatches({cursor, expectedBatch}) { - // TODO: SERVER-29126 - assert.commandWorked(db.runCommand({ - find: "foo", - readConcern: {level: "local", afterClusterTime: db.getSession().getOperationTime()} - })); - FixtureHelpers.awaitReplication(); if (expectedBatch.length == 0) { assert.commandWorked(db.adminCommand( {configureFailPoint: "disableAwaitDataForGetMoreCmd", mode: "alwaysOn"})); @@ -288,12 +269,6 @@ * document is present. */ function getOneDoc(cursor) { - // TODO: SERVER-29126 - assert.commandWorked(db.runCommand({ - find: "foo", - readConcern: {level: "local", afterClusterTime: db.getSession().getOperationTime()} - })); - FixtureHelpers.awaitReplication(); assert.commandWorked(db.adminCommand( {configureFailPoint: "disableAwaitDataForGetMoreCmd", mode: "alwaysOn"})); let res = assert.commandWorked(db.runCommand({ @@ -313,12 +288,6 @@ * is present. */ function assertNextBatchIsEmpty(cursor) { - // TODO: SERVER-29126 - assert.commandWorked(db.runCommand({ - find: "foo", - readConcern: {level: "local", afterClusterTime: db.getSession().getOperationTime()} - })); - FixtureHelpers.awaitReplication(); assert.commandWorked(db.adminCommand( {configureFailPoint: "disableAwaitDataForGetMoreCmd", mode: "alwaysOn"})); let res = assert.commandWorked(db.runCommand({ diff --git a/jstests/change_streams/change_stream_invalidation.js b/jstests/change_streams/change_stream_invalidation.js index 8642226f8e6..7b9903bc248 100644 --- a/jstests/change_streams/change_stream_invalidation.js +++ b/jstests/change_streams/change_stream_invalidation.js @@ -13,16 +13,6 @@ // with the pipeline, then insert the changes, then run assertNextBatchMatches with the result // of startWatchingChanges and the expected set of results. function startWatchingChanges(pipeline, collection) { - // TODO: SERVER-29126 - // While change streams still uses read concern level local instead of read concern level - // majority, we need to use causal consistency to be able to immediately read our own writes - // out of the oplog. Once change streams read from the majority snapshot, we can remove - // these synchronization points from this test. - assert.commandWorked(db.runCommand({ - find: "foo", - readConcern: {level: "local", afterClusterTime: db.getSession().getOperationTime()} - })); - let res = assert.commandWorked( db.runCommand({aggregate: collection.getName(), "pipeline": pipeline, cursor: {}})); assert.neq(res.cursor.id, 0); @@ -75,16 +65,6 @@ assert.eq(aggcursor.firstBatch.length, 0); assert.writeOK(collAgg.insert({_id: 1}, {writeConcern: {w: "majority"}})); - // TODO: SERVER-29126 - // While change streams still uses read concern level local instead of read concern level - // majority, we need to use causal consistency to be able to immediately read our own writes - // out of the oplog. Once change streams read from the majority snapshot, we can remove - // these synchronization points from this test. - assert.commandWorked(db.runCommand({ - find: "foo", - readConcern: {level: "local", afterClusterTime: db.getSession().getOperationTime()} - })); - res = assert.commandWorked(db.runCommand({getMore: aggcursor.id, collection: collAgg.getName()})); aggcursor = res.cursor; diff --git a/jstests/change_streams/lookup_post_image.js b/jstests/change_streams/lookup_post_image.js index 24e8c41b477..b56fc257efd 100644 --- a/jstests/change_streams/lookup_post_image.js +++ b/jstests/change_streams/lookup_post_image.js @@ -5,7 +5,6 @@ (function() { "use strict"; - load("jstests/libs/fixture_helpers.js"); // For 'FixtureHelpers'. load("jstests/replsets/libs/two_phase_drops.js"); // For 'TwoPhaseDropCollectionTest'. const coll = db.change_post_image; @@ -14,16 +13,6 @@ * Returns the last result from the first batch of the aggregation pipeline 'pipeline'. */ function getLastResultFromFirstBatch({collection, pipeline}) { - // TODO: SERVER-29126 - // While change streams still uses read concern level local instead of read concern level - // majority, we need to use causal consistency to be able to immediately read our own writes - // out of the oplog. Once change streams read from the majority snapshot, we can remove - // these synchronization points from this test. - assert.commandWorked(db.runCommand({ - find: "foo", - readConcern: {level: "local", afterClusterTime: db.getSession().getOperationTime()} - })); - const cmdResponse = assert.commandWorked( db.runCommand({aggregate: collection.getName(), pipeline: pipeline, cursor: {}})); assert.neq(cmdResponse.cursor.firstBatch.length, 0); @@ -41,21 +30,6 @@ * document is present. */ function getOneDoc(cursor) { - // TODO: SERVER-29126 - assert.commandWorked(db.runCommand({ - find: "foo", - readConcern: {level: "local", afterClusterTime: db.getSession().getOperationTime()} - })); - FixtureHelpers.awaitReplication(); - // TODO: SERVER-29126 - // While change streams still uses read concern level local instead of read concern level - // majority, we need to use causal consistency to be able to immediately read our own writes - // out of the oplog. Once change streams read from the majority snapshot, we can remove - // these synchronization points from this test. - assert.commandWorked(db.runCommand({ - find: "foo", - readConcern: {level: "local", afterClusterTime: db.getSession().getOperationTime()} - })); assert.commandWorked(db.adminCommand( {configureFailPoint: "disableAwaitDataForGetMoreCmd", mode: "alwaysOn"})); let res = assert.commandWorked(db.runCommand({ @@ -279,16 +253,6 @@ coll2.drop(); assert.commandWorked(db.createCollection(coll2.getName())); assert.writeOK(coll2.insert({_id: "getMoreEnabled"})); - FixtureHelpers.awaitReplication(); - // TODO: SERVER-29126 - // While change streams still uses read concern level local instead of read concern level - // majority, we need to use causal consistency to be able to immediately read our own writes - // out of the oplog. Once change streams read from the majority snapshot, we can remove - // these synchronization points from this test. - assert.commandWorked(db.runCommand({ - find: "foo", - readConcern: {level: "local", afterClusterTime: db.getSession().getOperationTime()} - })); res = assert.commandWorked(db.runCommand({ aggregate: coll2.getName(), @@ -297,16 +261,6 @@ })); assert.writeOK(coll2.update({_id: "getMoreEnabled"}, {$set: {updated: true}})); - // TODO: SERVER-29126 - // While change streams still uses read concern level local instead of read concern level - // majority, we need to use causal consistency to be able to immediately read our own writes - // out of the oplog. Once change streams read from the majority snapshot, we can remove - // these synchronization points from this test. - assert.commandWorked(db.runCommand({ - find: "foo", - readConcern: {level: "local", afterClusterTime: db.getSession().getOperationTime()} - })); - res = assert.commandWorked(db.runCommand({ getMore: res.cursor.id, collection: getCollectionNameFromFullNamespace(res.cursor.ns), diff --git a/jstests/change_streams/report_latest_observed_oplog_timestamp.js b/jstests/change_streams/report_latest_observed_oplog_timestamp.js index 04a9ffd81b1..6c5b92f0392 100644 --- a/jstests/change_streams/report_latest_observed_oplog_timestamp.js +++ b/jstests/change_streams/report_latest_observed_oplog_timestamp.js @@ -44,16 +44,6 @@ assert.writeOK(cursorCollection.insert({_id: i}, {writeConcern: {w: 1}})); } - // TODO: SERVER-29126 - // While change streams still uses read concern level local instead of read concern level - // majority, we need to use causal consistency to be able to immediately read our own writes out - // of the oplog. Once change streams read from the majority snapshot, we can remove this - // synchronization point from this test. - assert.commandWorked(db.runCommand({ - find: "foo", - readConcern: {level: "local", afterClusterTime: db.getSession().getOperationTime()} - })); - // Look at one batch's worth. jsTestLog("Testing that operation time is present on initial aggregate command."); const cursorResponse = assert.commandWorked(cursorCollection.runCommand({ |