jstests/core/txns/libs/prepare_helpers.js
/**
     * Writes until the oplog exceeds its configured maximum, proving that the node keeps as much
     * oplog as necessary to preserve entries for the oldest active transaction.
     */
Writes until the oplog exceeds its configured maximum, proving that the node keeps as much
oplog as necessary to preserve entries for the oldest active transaction.
Writes until the oplog exceeds its configured maximum proving that the node keeps as much oplog as necessary to preserve entries for the oldest active transaction .
function growOplogPastMaxSize(replSet) {
        const primary = replSet.getPrimary();
        const oplog = primary.getDB("local").oplog.rs;
        assert.lte(oplog.dataSize(), oplogSizeBytes);
        const coll = primary.getDB("growOplogPastMaxSize").growOplogPastMaxSize;
        const numNodes = replSet.nodeList().length;
        while (oplog.dataSize() <= 2 * oplogSizeBytes) {
            assert.commandWorked(coll.insert({tenKB: tenKB}, {writeConcern: {w: numNodes}}));
        }
        print(`Oplog on ${primary} dataSize = ${oplog.dataSize()}`);
    }
function growOplogPastMaxSize ( replSet ) { const primary = replSet . getPrimary ( ) ; const oplog = primary . getDB ( "local" ) . oplog . rs ; assert . lte ( oplog . dataSize ( ) , oplogSizeBytes ) ; const coll = primary . getDB ( "growOplogPastMaxSize" ) . growOplogPastMaxSize ; const numNodes = replSet . nodeList ( ) . length ; while ( oplog . dataSize ( ) <= 2 * oplogSizeBytes ) { assert . commandWorked ( coll . insert ( { tenKB : tenKB } , { writeConcern : { w : numNodes } } ) ) ; } print ( ` ${ primary } ${ oplog . dataSize ( ) } ` ) ; }
Writes until the oplog exceeds its configured maximum, proving that the node keeps as much
 oplog as necessary to preserve entries for the oldest active transaction.
Writes until the oplog exceeds its configured maximum proving that the node keeps as much oplog as necessary to preserve entries for the oldest active transaction .