From 38af3bf86eb1be7cea7870f26872ec1a19c9eec7 Mon Sep 17 00:00:00 2001 From: Etienne Petrel Date: Thu, 15 Sep 2022 23:26:46 +0000 Subject: Import wiredtiger: 88a8cfc9307634879f155531cd2a79af703a887a from branch mongodb-master ref: 2ba19fce21..88a8cfc930 for: 6.2.0-rc0 WT-9817 Column store tree open should always fetch the last page with global visibility (#8241) --- src/third_party/wiredtiger/import.data | 2 +- src/third_party/wiredtiger/src/btree/bt_handle.c | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src/third_party') diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data index 5bcfd0824e6..3118bd1b22c 100644 --- a/src/third_party/wiredtiger/import.data +++ b/src/third_party/wiredtiger/import.data @@ -2,5 +2,5 @@ "vendor": "wiredtiger", "github": "wiredtiger/wiredtiger.git", "branch": "mongodb-master", - "commit": "2ba19fce21cdcf23d4b17509baaf4ecfc55e4f96" + "commit": "88a8cfc9307634879f155531cd2a79af703a887a" } diff --git a/src/third_party/wiredtiger/src/btree/bt_handle.c b/src/third_party/wiredtiger/src/btree/bt_handle.c index c1c1b7af166..8276692e147 100644 --- a/src/third_party/wiredtiger/src/btree/bt_handle.c +++ b/src/third_party/wiredtiger/src/btree/bt_handle.c @@ -853,9 +853,13 @@ __btree_get_last_recno(WT_SESSION_IMPL *session) return (0); } - flags = WT_READ_PREV; - if (!F_ISSET(session->txn, WT_TXN_HAS_SNAPSHOT)) - LF_SET(WT_READ_VISIBLE_ALL); + /* + * The endpoint for append is global; read the last page with global visibility to make sure + * that if the end of the tree is truncated we don't start appending in the truncated space + * unless the truncation has become globally visible. (Note that this path does not examine the + * visibility of individual data items; it only checks whether whole pages are deleted.) + */ + flags = WT_READ_PREV | WT_READ_VISIBLE_ALL; next_walk = NULL; WT_RET(__wt_tree_walk(session, &next_walk, flags)); -- cgit v1.2.1