jstests/replsets/libs/rollback_test.js
/**
     * Return an instance of ReplSetTest initialized with a standard
     * three-node replica set running with the latest version.
     *
     * Note: One of the secondaries will have a priority of 0.
     */
Return an instance of ReplSetTest initialized with a standard
three-node replica set running with the latest version.

One of the secondaries will have a priority of 0.
Return an instance of ReplSetTest initialized with a standard three - node replica set running with the latest version . One of the secondaries will have a priority of 0 .
function performStandardSetup() {
        let nodeOptions = {};
        if (TestData.logComponentVerbosity) {
            nodeOptions["setParameter"] = {
                "logComponentVerbosity": tojsononeline(TestData.logComponentVerbosity)
            };
        }
        if (TestData.syncdelay) {
            nodeOptions["syncdelay"] = TestData.syncdelay;
        }
        let replSet = new ReplSetTest({name, nodes: 3, useBridge: true, nodeOptions: nodeOptions});
        replSet.startSet();
        replSet.nodes.forEach(setFastGetMoreEnabled);
        let config = replSet.getReplSetConfig();
        config.members[2].priority = 0;
        config.settings = {chainingAllowed: false};
        replSet.initiateWithHighElectionTimeout(config);
        replSet.nodes.forEach((node) => {
            assert.commandWorked(node.adminCommand({replSetResizeOplog: 1, minRetentionHours: 2}));
        });
        assert.eq(replSet.nodes.length,
                  kNumDataBearingNodes,
                  "Mismatch between number of data bearing nodes and test configuration.");
        return replSet;
    }
function performStandardSetup ( ) { let nodeOptions = { } ; if ( TestData . logComponentVerbosity ) { nodeOptions [ "setParameter" ] = { "logComponentVerbosity" : tojsononeline ( TestData . logComponentVerbosity ) } ; } if ( TestData . syncdelay ) { nodeOptions [ "syncdelay" ] = TestData . syncdelay ; } let replSet = new ReplSetTest ( { name , nodes : 3 , useBridge : true , nodeOptions : nodeOptions } ) ; replSet . startSet ( ) ; replSet . nodes . forEach ( setFastGetMoreEnabled ) ; let config = replSet . getReplSetConfig ( ) ; config . members [ 2 ] . priority = 0 ; config . settings = { chainingAllowed : false } ; replSet . initiateWithHighElectionTimeout ( config ) ; replSet . nodes . forEach ( ( node ) => { assert . commandWorked ( node . adminCommand ( { replSetResizeOplog : 1 , minRetentionHours : 2 } ) ) ; } ) ; assert . eq ( replSet . nodes . length , kNumDataBearingNodes , "Mismatch between number of data bearing nodes and test configuration." ) ; return replSet ; }
Return an instance of ReplSetTest initialized with a standard
 three-node replica set running with the latest version.
Return an instance of ReplSetTest initialized with a standard three - node replica set running with the latest version .
// Tiebreaker's replication is paused for most of the test, avoid falling off the oplog.