diff options
Diffstat (limited to 'src/third_party/wiredtiger/test/format/util.c')
-rw-r--r-- | src/third_party/wiredtiger/test/format/util.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/third_party/wiredtiger/test/format/util.c b/src/third_party/wiredtiger/test/format/util.c index 30f446da4e7..d0566e456a4 100644 --- a/src/third_party/wiredtiger/test/format/util.c +++ b/src/third_party/wiredtiger/test/format/util.c @@ -401,6 +401,27 @@ set_oldest_timestamp(void) } /* + * maximum_read_ts -- + * Return the largest safe read timestamp. + */ +uint64_t +maximum_read_ts(void) +{ + TINFO **tlp; + uint64_t ts; + + /* + * We can't use a read timestamp that's ahead of a commit timestamp. Find the maximum safe read + * timestamp. + */ + for (ts = g.timestamp, tlp = tinfo_list; *tlp != NULL; ++tlp) + ts = WT_MIN(ts, (*tlp)->commit_ts); + if (ts != 0) + --ts; + return (ts); +} + +/* * lock_init -- * Initialize abstract lock that can use either pthread of wt reader-writer locks. */ |