summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/btree/bt_handle.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/wiredtiger/src/btree/bt_handle.c')
-rw-r--r--src/third_party/wiredtiger/src/btree/bt_handle.c10
1 files changed, 7 insertions, 3 deletions
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));