summaryrefslogtreecommitdiff
path: root/jstests/replsets/dbcheck.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/replsets/dbcheck.js')
-rw-r--r--jstests/replsets/dbcheck.js43
1 files changed, 5 insertions, 38 deletions
diff --git a/jstests/replsets/dbcheck.js b/jstests/replsets/dbcheck.js
index e3cab92b03e..710d986d535 100644
--- a/jstests/replsets/dbcheck.js
+++ b/jstests/replsets/dbcheck.js
@@ -40,10 +40,6 @@ function clearLog() {
forEachNode(conn => conn.getDB("local").system.healthlog.drop());
}
-function addEnoughForMultipleBatches(collection) {
- collection.insertMany([...Array(10000).keys()].map(x => ({_id: x})), {ordered: false});
-}
-
// Name for a collection which takes multiple batches to check and which shouldn't be modified
// by any of the tests.
const multiBatchSimpleCollName = "dbcheck-simple-collection";
@@ -55,29 +51,6 @@ function dbCheckCompleted(db) {
return db.currentOp().inprog.filter(x => x["desc"] == "dbCheck")[0] === undefined;
}
-// Wait for DeferredWriter writes to local.system.healthlog to eventually complete.
-// Requires clearLog() before the test case is run.
-// TODO SERVER-61765 remove this function altoghether when healthlogging becomes
-// synchronous.
-function dbCheckHealthLogCompleted(db, coll, maxKey, maxSize, maxCount) {
- let query = {"namespace": coll.getFullName(), "operation": "dbCheckBatch"};
- if (maxSize === undefined && maxCount === undefined && maxKey === undefined) {
- query['data.maxKey'] = {"$type": "maxKey"};
- }
- if (maxCount !== undefined) {
- query['data.count'] = maxCount;
- } else {
- if (maxSize !== undefined) {
- query['data.bytes'] = maxSize;
- } else {
- if (maxKey !== undefined) {
- query['data.maxKey'] = maxKey;
- }
- }
- }
- return db.getSiblingDB("local").system.healthlog.find(query).itcount() === 1;
-}
-
// Wait for dbCheck to complete (on both primaries and secondaries). Fails an assertion if
// dbCheck takes longer than maxMs.
function awaitDbCheckCompletion(db, collName, maxKey, maxSize, maxCount) {
@@ -232,17 +205,11 @@ function simpleTestNonSnapshot() {
assert.neq(primary, undefined);
let db = primary.getDB(dbName);
- assert.commandWorked(db.runCommand({"dbCheck": multiBatchSimpleCollName, snapshotRead: false}));
-
- awaitDbCheckCompletion(db, multiBatchSimpleCollName);
-
- checkLogAllConsistent(primary);
- checkTotalCounts(primary, db[multiBatchSimpleCollName]);
-
- forEachSecondary(function(secondary) {
- checkLogAllConsistent(secondary);
- checkTotalCounts(secondary, secondary.getDB(dbName)[multiBatchSimpleCollName]);
- });
+ // "dbCheck no longer supports snapshotRead:false"
+ assert.commandFailedWithCode(
+ db.runCommand({"dbCheck": multiBatchSimpleCollName, snapshotRead: false}), 6769500);
+ // "dbCheck no longer supports snapshotRead:false"
+ assert.commandFailedWithCode(db.runCommand({"dbCheck": 1, snapshotRead: false}), 6769501);
}
// Same thing, but now with concurrent updates.