mirror of https://github.com/mongodb/mongo
12 lines
472 B
JavaScript
12 lines
472 B
JavaScript
/**
|
|
* Retrieves the oldest required timestamp from the serverStatus output.
|
|
*
|
|
* @return {Timestamp} oldest required timestamp for crash recovery.
|
|
*/
|
|
export function getOldestRequiredTimestampForCrashRecovery(database) {
|
|
const res = database.serverStatus().storageEngine;
|
|
const ts = res.oldestRequiredTimestampForCrashRecovery;
|
|
assert(ts instanceof Timestamp, "oldestRequiredTimestampForCrashRecovery was not a Timestamp: " + tojson(res));
|
|
return ts;
|
|
}
|