jstests/concurrency/fsm_workload_helpers/check_transaction_server_status_invariants.js
/**
 * serverStatus invariant: totalAborted = sum of all abort cause counters.
 */
serverStatus invariant: totalAborted = sum of all abort cause counters.
serverStatus invariant : totalAborted = sum of all abort cause counters .
function totalAbortedEqualsSumOfAbortCauses(txnStats) {
    const totalAborted = Number(txnStats["totalAborted"]);
    const abortCauseKeys = Object.keys(txnStats.abortCause);
    const totalAbortCauseCounters = abortCauseKeys.reduce((accum, key) => {
        return accum + Number(txnStats.abortCause[key]);
    }, 0);
    return totalAborted === totalAbortCauseCounters;
}
function totalAbortedEqualsSumOfAbortCauses ( txnStats ) { const totalAborted = Number ( txnStats [ "totalAborted" ] ) ; const abortCauseKeys = Object . keys ( txnStats . abortCause ) ; const totalAbortCauseCounters = abortCauseKeys . reduce ( ( accum , key ) => { return accum + Number ( txnStats . abortCause [ key ] ) ; } , 0 ) ; return totalAborted === totalAbortCauseCounters ; }
serverStatus invariant: totalAborted = sum of all abort cause counters.
serverStatus invariant : totalAborted = sum of all abort cause counters .