jstests/libs/override_methods/network_error_and_txn_override.js
// Creates the given collection, retrying if needed. Throws on failure.
Creates the given collection, retrying if needed. Throws on failure.
Creates the given collection retrying if needed . Throws on failure .
function createCollectionExplicitly(conn, dbName, collName, lsid) {
    logMsgFull(
        'create',
        `Explicitly creating collection ${dbName}.${collName} and then retrying transaction`);
    const createCmdObj = {
        create: collName,
        lsid: lsid,
        writeConcern: {w: 'majority'},
    };
    assert.commandWorked(conn.getDB(dbName).runCommand(createCmdObj));
}
function createCollectionExplicitly ( conn , dbName , collName , lsid ) { logMsgFull ( 'create' , ` ${ dbName } ${ collName } ` ) ; const createCmdObj = { create : collName , lsid : lsid , writeConcern : { w : 'majority' } , } ; assert . commandWorked ( conn . getDB ( dbName ) . runCommand ( createCmdObj ) ) ; }
Creates the given collection, retrying if needed.
Creates the given collection retrying if needed .
// Always majority commit the create because this is not expected to roll back once // successful. // Running the command on conn will reenter from the top of `runCommandOverride`, retrying // as needed. If an error returned by `create` were tolerable, it would already have been // retried by the time it surfaced here.