jstests/sharding/internal_txns/libs/chunk_migration_test.js
/*
     * Retries the commands specified inside 'testCase' as retryable writes.
     */
Retries the commands specified inside 'testCase' as retryable writes.
Retries the commands specified inside ' testCase ' as retryable writes .
function runRetryableWriteOnRetry(testCase) {
        jsTest.log(
            `Retrying write statements executed in an internal transaction with options ${tojson({
                id: testCase.id,
                isPreparedTxn: testCase.isPreparedTxn,
                isLargeTxn: testCase.isLargeTxn,
                abortOnInitialTry: testCase.abortOnInitialTry,
                imageType: testCase.imageType,
            })} in a retryable write`);
        const lsid = testCase.parentLsid;
        const txnNumber = NumberLong(testCase.parentTxnNumber);
        for (let i = 0; i < testCase.commands.length; i++) {
            const command = testCase.commands[i];
            if (command.cmdObj.stmtId == -1) {
                continue;
            }
            const cmdObj = Object.assign({}, command.cmdObj, {lsid, txnNumber});
            const res = assert.commandWorked(st.s.getDB(testCase.dbName).runCommand(cmdObj));
            command.checkResponseFunc(res);
            assert.commandWorked(res);
        }
        testCase.checkDocsFunc(true );
    }
function runRetryableWriteOnRetry ( testCase ) { jsTest . log ( ` ${ tojson ( { id : testCase . id , isPreparedTxn : testCase . isPreparedTxn , isLargeTxn : testCase . isLargeTxn , abortOnInitialTry : testCase . abortOnInitialTry , imageType : testCase . imageType , } ) } ` ) ; const lsid = testCase . parentLsid ; const txnNumber = NumberLong ( testCase . parentTxnNumber ) ; for ( let i = 0 ; i < testCase . commands . length ; i ++ ) { const command = testCase . commands [ i ] ; if ( command . cmdObj . stmtId == - 1 ) { continue ; } const cmdObj = Object . assign ( { } , command . cmdObj , { lsid , txnNumber } ) ; const res = assert . commandWorked ( st . s . getDB ( testCase . dbName ) . runCommand ( cmdObj ) ) ; command . checkResponseFunc ( res ) ; assert . commandWorked ( res ) ; } testCase . checkDocsFunc ( true ) ; }
Retries the commands specified inside 'testCase' as retryable writes.
Retries the commands specified inside ' testCase ' as retryable writes .
// The statement in this command is not retryable so do not retry it. /* isTxnCommitted */