diff options
author | Benety Goh <benety@mongodb.com> | 2023-03-08 13:07:02 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-03-16 20:51:23 +0000 |
commit | 04f41a3497f02501de58e6acacd2684c466cca04 (patch) | |
tree | d5fd80a40737d3b512bebd5b1ec7be63f27c93fd | |
parent | 915cc2b1973aaf81542b53f5991c94f778e9a15c (diff) | |
download | mongo-04f41a3497f02501de58e6acacd2684c466cca04.tar.gz |
SERVER-74642 WiredTigerRecordStore::printRecordMetadata() saves timestamps
(cherry picked from commit 0c581b504fe1fde434ad4f0c5793751d86a373f8)
-rw-r--r-- | src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp index c3e72883996..e62503518bc 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp @@ -1643,6 +1643,20 @@ void WiredTigerRecordStore::printRecordMetadata(OperationContext* opCtx, "location"_attr = location, "value"_attr = redact(recordData.toBson())); + // Save all relevant timestamps that we just printed. + if (recordTimestamps) { + auto saveRecordTimestampIfValid = [recordTimestamps](Timestamp ts) { + if (ts.isNull() || ts == Timestamp::max() || ts == Timestamp::min()) { + return; + } + (void)recordTimestamps->emplace(ts); + }; + saveRecordTimestampIfValid(Timestamp(startTs)); + saveRecordTimestampIfValid(Timestamp(startDurableTs)); + saveRecordTimestampIfValid(Timestamp(stopTs)); + saveRecordTimestampIfValid(Timestamp(stopDurableTs)); + } + ret = cursor->next(cursor); } } |