jstests/concurrency/fsm_workload_helpers/check_transaction_server_status_invariants.js
/**
 * serverStatus invariant: totalPreparedThenAborted + totalPreparedThenCommitted +
 * currentPrepared = totalPrepared
 */
serverStatus invariant: totalPreparedThenAborted + totalPreparedThenCommitted +
currentPrepared = totalPrepared
serverStatus invariant : totalPreparedThenAborted + totalPreparedThenCommitted + currentPrepared = totalPrepared
function preparedAbortedPlusPreparedCommittedPlusCurrentPreparedEqualsTotalPrepared(
    serverStatusTxnStats) {
    let preparedAborted = Number(serverStatusTxnStats["totalPreparedThenAborted"]);
    let preparedCommitted = Number(serverStatusTxnStats["totalPreparedThenCommitted"]);
    let currentPrepared = Number(serverStatusTxnStats["currentPrepared"]);
    let totalPrepared = Number(serverStatusTxnStats["totalPrepared"]);
    return (preparedAborted + preparedCommitted + currentPrepared) === totalPrepared;
}
function preparedAbortedPlusPreparedCommittedPlusCurrentPreparedEqualsTotalPrepared ( serverStatusTxnStats ) { let preparedAborted = Number ( serverStatusTxnStats [ "totalPreparedThenAborted" ] ) ; let preparedCommitted = Number ( serverStatusTxnStats [ "totalPreparedThenCommitted" ] ) ; let currentPrepared = Number ( serverStatusTxnStats [ "currentPrepared" ] ) ; let totalPrepared = Number ( serverStatusTxnStats [ "totalPrepared" ] ) ; return ( preparedAborted + preparedCommitted + currentPrepared ) === totalPrepared ; }
serverStatus invariant: totalPreparedThenAborted + totalPreparedThenCommitted +
 currentPrepared = totalPrepared
serverStatus invariant : totalPreparedThenAborted + totalPreparedThenCommitted + currentPrepared = totalPrepared