summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZixuan Zhuang <zixuan.zhuang@mongodb.com>2023-02-06 14:15:31 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-02-06 14:54:30 +0000
commit763fbdc180f5cee8c36c177ae59ac14a6f01f48b (patch)
tree406f866bff22ed82bdaab0c3cb9e1bc2d299709c
parent01adc07a164b69000b432de1d19af687e45ceec0 (diff)
downloadmongo-763fbdc180f5cee8c36c177ae59ac14a6f01f48b.tar.gz
SERVER-70219 fix spill_to_disk_secondary_read
-rw-r--r--jstests/noPassthrough/spill_to_disk_secondary_read.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/jstests/noPassthrough/spill_to_disk_secondary_read.js b/jstests/noPassthrough/spill_to_disk_secondary_read.js
index f4c2ef20104..be11fb3de70 100644
--- a/jstests/noPassthrough/spill_to_disk_secondary_read.js
+++ b/jstests/noPassthrough/spill_to_disk_secondary_read.js
@@ -9,8 +9,9 @@
load("jstests/libs/sbe_explain_helpers.js"); // For getSbePlanStages.
load("jstests/libs/sbe_util.js"); // For checkSBEEnabled.
+const kNumNodes = 3;
const replTest = new ReplSetTest({
- nodes: 3,
+ nodes: kNumNodes,
});
replTest.startSet();
@@ -20,15 +21,18 @@ replTest.initiate();
* Setup the primary and secondary collections.
*/
let primary = replTest.getPrimary();
-const insertColl = primary.getDB("test").foo;
+let bulk = primary.getDB("test").foo.initializeUnorderedBulkOp();
const cRecords = 50;
for (let i = 0; i < cRecords; ++i) {
// We'll be using a unique 'key' field for group & lookup, but we cannot use '_id' for this,
// because '_id' is indexed and would trigger Indexed Loop Join instead of Hash Join.
- assert.commandWorked(insertColl.insert({key: i, string: "test test test"}));
+ bulk.insert({key: i, string: "test test test"});
}
+assert.commandWorked(bulk.execute({w: kNumNodes, wtimeout: 5000}));
let secondary = replTest.getSecondary();
+// Wait for the insertion to be visible on 'secondary'.
+replTest.awaitLastOpCommitted(null, [secondary]);
const readColl = secondary.getDB("test").foo;
/**