diff options
author | Louis Williams <louis.williams@mongodb.com> | 2022-11-03 14:56:46 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-11-03 15:45:38 +0000 |
commit | ba467f46cc1bc49965e1d72b541eff0cf1d7b22e (patch) | |
tree | b4a7b214d8f41d3f73cb022d183b8b8290d6dc79 /jstests/replsets | |
parent | c73e2cf8985997ceabbe7882597ce655a11c4487 (diff) | |
download | mongo-ba467f46cc1bc49965e1d72b541eff0cf1d7b22e.tar.gz |
SERVER-67695 Remove write-blocking dbCheck
This removes the snapshotRead:false option to dbCheck which blocked concurrent writes
Diffstat (limited to 'jstests/replsets')
-rw-r--r-- | jstests/replsets/dbcheck.js | 43 |
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. |