From a9eb8c3bb3673c2a39cfb047a501771358591809 Mon Sep 17 00:00:00 2001 From: Rui Liu Date: Thu, 18 Nov 2021 16:59:21 +0000 Subject: SERVER-61597 Use deterministic order for random_moveChunk_timeseries_inserts.js (cherry picked from commit 5c186ebcd37f16e9acca78e4d9d3a1436b9da61d) --- .../concurrency/fsm_workloads/random_moveChunk_timeseries_inserts.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jstests/concurrency/fsm_workloads/random_moveChunk_timeseries_inserts.js b/jstests/concurrency/fsm_workloads/random_moveChunk_timeseries_inserts.js index d2fb1ae0794..ab283c2a1df 100644 --- a/jstests/concurrency/fsm_workloads/random_moveChunk_timeseries_inserts.js +++ b/jstests/concurrency/fsm_workloads/random_moveChunk_timeseries_inserts.js @@ -124,7 +124,8 @@ var $config = extendWorkload($config, function($config, $super) { jsTestLog("NumBuckets " + numBuckets + ", numDocs on sharded cluster" + db[collName].find().itcount() + "numDocs on unsharded collection " + db[this.nonShardCollName].find({}).itcount()); - const pipeline = [{$project: {_id: "$_id", m: "$m", t: "$t"}}, {$sort: {m: 1, t: 1}}]; + const pipeline = + [{$project: {_id: "$_id", m: "$m", t: "$t"}}, {$sort: {m: 1, t: 1, _id: 1}}]; const diff = DataConsistencyChecker.getDiff(db[collName].aggregate(pipeline), db[this.nonShardCollName].aggregate(pipeline)); assertAlways.eq( @@ -177,6 +178,7 @@ var $config = extendWorkload($config, function($config, $super) { assert.commandWorked(db[this.nonShardCollName].createIndex({m: 1})); assert.commandWorked(db[collName].createIndex({m: 1, t: 1})); assert.commandWorked(db[this.nonShardCollName].createIndex({m: 1, t: 1})); + assert.commandWorked(db[this.nonShardCollName].createIndex({m: 1, t: 1, _id: 1})); const bulk = db[collName].initializeUnorderedBulkOp(); const bulkUnsharded = db[this.nonShardCollName].initializeUnorderedBulkOp(); -- cgit v1.2.1