diff options
Diffstat (limited to 'jstests/replsets/change_stream_speculative_majority_conflicting_catalog_changes.js')
-rw-r--r-- | jstests/replsets/change_stream_speculative_majority_conflicting_catalog_changes.js | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/jstests/replsets/change_stream_speculative_majority_conflicting_catalog_changes.js b/jstests/replsets/change_stream_speculative_majority_conflicting_catalog_changes.js index b9a55d1c3fa..8b1e9682403 100644 --- a/jstests/replsets/change_stream_speculative_majority_conflicting_catalog_changes.js +++ b/jstests/replsets/change_stream_speculative_majority_conflicting_catalog_changes.js @@ -7,47 +7,47 @@ * @tags: [uses_speculative_majority] */ (function() { - "use strict"; +"use strict"; - const replTest = new ReplSetTest({ - name: "replset", - nodes: [{}, {rsConfig: {priority: 0}}], - nodeOptions: {enableMajorityReadConcern: 'false'} - }); - replTest.startSet(); - replTest.initiate(); +const replTest = new ReplSetTest({ + name: "replset", + nodes: [{}, {rsConfig: {priority: 0}}], + nodeOptions: {enableMajorityReadConcern: 'false'} +}); +replTest.startSet(); +replTest.initiate(); - const dbName = "test"; - const collName = "coll"; +const dbName = "test"; +const collName = "coll"; - let primary = replTest.getPrimary(); - let secondary = replTest.getSecondary(); - let primaryDB = primary.getDB(dbName); - let primaryColl = primaryDB[collName]; - let secondaryDB = secondary.getDB(dbName); +let primary = replTest.getPrimary(); +let secondary = replTest.getSecondary(); +let primaryDB = primary.getDB(dbName); +let primaryColl = primaryDB[collName]; +let secondaryDB = secondary.getDB(dbName); - // Insert some documents on the primary that we can index. - var bulk = primaryColl.initializeUnorderedBulkOp(); - for (var i = 0; i < 1000; i++) { - let doc = {}; - bulk.insert({a: i, b: i, c: i, d: i, e: i}); - } - assert.commandWorked(bulk.execute()); +// Insert some documents on the primary that we can index. +var bulk = primaryColl.initializeUnorderedBulkOp(); +for (var i = 0; i < 1000; i++) { + let doc = {}; + bulk.insert({a: i, b: i, c: i, d: i, e: i}); +} +assert.commandWorked(bulk.execute()); - // Start several index builds on the primary. This should make it likely that index builds are - // in progress on the secondary while doing reads below. - primaryColl.createIndex({a: 1}); - primaryColl.createIndex({b: 1}); - primaryColl.createIndex({c: 1}); - primaryColl.createIndex({d: 1}); - primaryColl.createIndex({e: 1}); +// Start several index builds on the primary. This should make it likely that index builds are +// in progress on the secondary while doing reads below. +primaryColl.createIndex({a: 1}); +primaryColl.createIndex({b: 1}); +primaryColl.createIndex({c: 1}); +primaryColl.createIndex({d: 1}); +primaryColl.createIndex({e: 1}); - // Do a bunch of change stream reads against the secondary. We are not worried about the - // responses, since we are only verifying that the server doesn't crash. - for (var i = 0; i < 20; i++) { - assert.commandWorked(secondaryDB.runCommand( - {aggregate: collName, pipeline: [{$changeStream: {}}], cursor: {}})); - } +// Do a bunch of change stream reads against the secondary. We are not worried about the +// responses, since we are only verifying that the server doesn't crash. +for (var i = 0; i < 20; i++) { + assert.commandWorked( + secondaryDB.runCommand({aggregate: collName, pipeline: [{$changeStream: {}}], cursor: {}})); +} - replTest.stopSet(); +replTest.stopSet(); })();
\ No newline at end of file |