0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-27 15:06:34 +01:00
mongodb/jstests/libs/storage_helpers.js
2023-08-06 20:48:04 +00:00

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;
}