diff options
author | Will Korteland <will.korteland@mongodb.com> | 2022-04-29 04:01:20 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-04-29 04:41:56 +0000 |
commit | c713d9d06f173a692d98d26e6b7e32171b201068 (patch) | |
tree | fd14955eb8d72544ade0e95afa138935e8ceff91 /src/third_party/wiredtiger/src/include/btree_inline.h | |
parent | 8a3dc0b3d84b06c74ebeea4fa0bd3bbda7df060a (diff) | |
download | mongo-c713d9d06f173a692d98d26e6b7e32171b201068.tar.gz |
Import wiredtiger: ec674a59338b67dfd75ea682f52037390b85502d from branch mongodb-master
ref: c2c06e9771..ec674a5933
for: 6.1.0-rc0
WT-9183 Fast-truncate in readonly trees can result in truncated items reappearing
Diffstat (limited to 'src/third_party/wiredtiger/src/include/btree_inline.h')
-rw-r--r-- | src/third_party/wiredtiger/src/include/btree_inline.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/third_party/wiredtiger/src/include/btree_inline.h b/src/third_party/wiredtiger/src/include/btree_inline.h index 7857277c948..589dbcd3a92 100644 --- a/src/third_party/wiredtiger/src/include/btree_inline.h +++ b/src/third_party/wiredtiger/src/include/btree_inline.h @@ -1509,6 +1509,14 @@ __wt_page_del_active(WT_SESSION_IMPL *session, WT_REF *ref, bool visible_all) return (false); if (page_del->txnid == WT_TXN_ABORTED) return (false); + /* + * If we are reading from a checkpoint, visible_all checks don't work (they check the current + * state of the world and not the checkpoint) so operate under the assumption that if the + * truncate operation appears in the checkpoint, it must have been visible to somebody, and + * because the checkpoint is immutable, that won't ever change. + */ + if (WT_READING_CHECKPOINT(session) && visible_all) + return (true); WT_ORDERED_READ(prepare_state, page_del->prepare_state); if (prepare_state == WT_PREPARE_INPROGRESS || prepare_state == WT_PREPARE_LOCKED) return (true); |