src/mongo/shell/replsettest.js
/**
     * Returns the last durable OpTime for the host if running with journaling.
     * Returns the last applied OpTime otherwise.
     */
Returns the last durable OpTime for the host if running with journaling.
Returns the last applied OpTime otherwise.
Returns the last durable OpTime for the host if running with journaling . Returns the last applied OpTime otherwise .
function _getDurableOpTime(conn) {
        var replSetStatus = asCluster(
            conn,
            () => assert.commandWorked(conn.getDB("admin").runCommand({replSetGetStatus: 1})));
        var opTimeType = "durableOpTime";
        if (_isRunningWithoutJournaling(conn)) {
            opTimeType = "appliedOpTime";
        }
        var opTime = replSetStatus.optimes[opTimeType];
        if (_isEmptyOpTime(opTime)) {
            throw new Error("last durable OpTime is empty -- connection: " + conn);
        }
        return opTime;
    }
function _getDurableOpTime ( conn ) { var replSetStatus = asCluster ( conn , ( ) => assert . commandWorked ( conn . getDB ( "admin" ) . runCommand ( { replSetGetStatus : 1 } ) ) ) ; var opTimeType = "durableOpTime" ; if ( _isRunningWithoutJournaling ( conn ) ) { opTimeType = "appliedOpTime" ; } var opTime = replSetStatus . optimes [ opTimeType ] ; if ( _isEmptyOpTime ( opTime ) ) { throw new Error ( "last durable OpTime is empty -- connection: " + conn ) ; } return opTime ; }
Returns the last durable OpTime for the host if running with journaling.
Returns the last durable OpTime for the host if running with journaling .