jstests/replsets/tenant_migration_large_txn.js
/**
 * Runs a large transaction (>16MB) on the given collection name that requires two applyOps oplog
 * entries and asserts that it commits successfully.
 */
Runs a large transaction (>16MB) on the given collection name that requires two applyOps oplog
entries and asserts that it commits successfully.
Runs a large transaction ( > 16MB ) on the given collection name that requires two applyOps oplog entries and asserts that it commits successfully .
function runTransaction(primaryHost, dbName, collName) {
    function makeLargeDoc(numMB) {
        return {x: new Array(numMB * 1024 * 1024).join('A')};
    }
    const donorPrimary = new Mongo(primaryHost);
    const session = donorPrimary.startSession();
    session.startTransaction();
    session.getDatabase(dbName)[collName].insert({doc: makeLargeDoc(10)});
    session.getDatabase(dbName)[collName].insert({doc: makeLargeDoc(5)});
    session.getDatabase(dbName)[collName].insert({doc: makeLargeDoc(5)});
    commitRes = session.commitTransaction_forTesting();
    assert.eq(1, commitRes.ok);
    session.endSession();
}
function runTransaction ( primaryHost , dbName , collName ) { function makeLargeDoc ( numMB ) { return { x : new Array ( numMB * 1024 * 1024 ) . join ( 'A' ) } ; } const donorPrimary = new Mongo ( primaryHost ) ; const session = donorPrimary . startSession ( ) ; session . startTransaction ( ) ; session . getDatabase ( dbName ) [ collName ] . insert ( { doc : makeLargeDoc ( 10 ) } ) ; session . getDatabase ( dbName ) [ collName ] . insert ( { doc : makeLargeDoc ( 5 ) } ) ; session . getDatabase ( dbName ) [ collName ] . insert ( { doc : makeLargeDoc ( 5 ) } ) ; commitRes = session . commitTransaction_forTesting ( ) ; assert . eq ( 1 , commitRes . ok ) ; session . endSession ( ) ; }
Runs a large transaction (>16MB) on the given collection name that requires two applyOps oplog
 entries and asserts that it commits successfully.
Runs a large transaction ( > 16MB ) on the given collection name that requires two applyOps oplog entries and asserts that it commits successfully .
/**
     * Returns a doc of size 'numMB'.
     */