mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-27 15:06:34 +01:00
13 lines
483 B
JavaScript
13 lines
483 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;
|
|
}
|