summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/include/btree.i7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/include/btree.i b/src/include/btree.i
index a4d88d5fda1..1d6fcd6272c 100644
--- a/src/include/btree.i
+++ b/src/include/btree.i
@@ -1354,8 +1354,13 @@ __wt_page_can_evict(
* the original parent page's index, because evicting an internal page
* discards its WT_REF array, and a thread traversing the original
* parent page index might see a freed WT_REF.
+ *
+ * One special case where we know this is safe is if the handle is
+ * locked exclusive (e.g., when the whole tree is being evicted). In
+ * that case, no readers can be looking at an old index.
*/
- if (WT_PAGE_IS_INTERNAL(page) && !__wt_split_obsolete(
+ if (!F_ISSET(session->dhandle, WT_DHANDLE_EXCLUSIVE) &&
+ WT_PAGE_IS_INTERNAL(page) && !__wt_split_obsolete(
session, page->pg_intl_split_gen))
return (false);