jstests/replsets/dbcheck.js
// Same thing, but now with concurrent updates.
Same thing, but now with concurrent updates.
Same thing but now with concurrent updates .
function concurrentTestConsistent() {
    let primary = replSet.getPrimary();
    clearLog();
    let db = primary.getDB(dbName);
    db[collName].insertMany([...Array(10000).keys()].map(x => ({i: x})));
    assert.commandWorked(db.runCommand({"dbCheck": collName}));
    let coll = db[collName];
    while (db.currentOp().inprog.filter(x => x["desc"] === "dbCheck").length) {
        coll.updateOne({}, {"$inc": {"i": 10}});
        coll.insertOne({"i": 42});
        coll.deleteOne({});
    }
    awaitDbCheckCompletion(db, collName);
    checkLogAllConsistent(primary);
    forEachSecondary(secondary => checkLogAllConsistent(secondary, true));
}
function concurrentTestConsistent ( ) { let primary = replSet . getPrimary ( ) ; clearLog ( ) ; let db = primary . getDB ( dbName ) ; db [ collName ] . insertMany ( [ ... Array ( 10000 ) . keys ( ) ] . map ( x => ( { i : x } ) ) ) ; assert . commandWorked ( db . runCommand ( { "dbCheck" : collName } ) ) ; let coll = db [ collName ] ; while ( db . currentOp ( ) . inprog . filter ( x => x [ "desc" ] === "dbCheck" ) . length ) { coll . updateOne ( { } , { "$inc" : { "i" : 10 } } ) ; coll . insertOne ( { "i" : 42 } ) ; coll . deleteOne ( { } ) ; } awaitDbCheckCompletion ( db , collName ) ; checkLogAllConsistent ( primary ) ; forEachSecondary ( secondary => checkLogAllConsistent ( secondary , true ) ) ; }
Same thing, but now with concurrent updates.
Same thing but now with concurrent updates .
// Add enough documents that dbCheck will take a few seconds. // Omit check for total counts, which might have changed with concurrent updates.