summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/third_party/wiredtiger/import.data2
-rw-r--r--src/third_party/wiredtiger/src/btree/bt_split.c32
2 files changed, 30 insertions, 4 deletions
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data
index d797dadef6e..abf3fe5cb9c 100644
--- a/src/third_party/wiredtiger/import.data
+++ b/src/third_party/wiredtiger/import.data
@@ -1,5 +1,5 @@
{
- "commit": "534677a2eab033bf817588704417bb25f0d19551",
+ "commit": "b8f590dea0400666ef26e21adf11c5997bb5ef1b",
"github": "wiredtiger/wiredtiger.git",
"vendor": "wiredtiger",
"branch": "mongodb-3.2"
diff --git a/src/third_party/wiredtiger/src/btree/bt_split.c b/src/third_party/wiredtiger/src/btree/bt_split.c
index 627e6b9cb48..92be2125b88 100644
--- a/src/third_party/wiredtiger/src/btree/bt_split.c
+++ b/src/third_party/wiredtiger/src/btree/bt_split.c
@@ -1256,12 +1256,12 @@ err: switch (complete) {
}
/*
- * __split_internal_lock --
+ * __split_internal_lock_worker --
* Lock an internal page.
*/
static int
-__split_internal_lock(WT_SESSION_IMPL *session, WT_REF *ref, bool trylock,
- WT_PAGE **parentp, bool *hazardp)
+__split_internal_lock_worker(WT_SESSION_IMPL *session,
+ WT_REF *ref, bool trylock, WT_PAGE **parentp, bool *hazardp)
{
WT_DECL_RET;
WT_PAGE *parent;
@@ -1340,6 +1340,32 @@ err: WT_PAGE_UNLOCK(session, parent);
}
/*
+ * __split_internal_lock --
+ * Lock an internal page.
+ */
+static int
+__split_internal_lock(WT_SESSION_IMPL *session,
+ WT_REF *ref, bool trylock, WT_PAGE **parentp, bool *hazardp)
+{
+ WT_DECL_RET;
+
+ /*
+ * There's no lock on our parent page and we're about to acquire one,
+ * which implies using the WT_REF.home field to reference our parent
+ * page. As a child of the parent page, we prevent its eviction, but
+ * that's a weak guarantee. If the parent page splits, and our WT_REF
+ * were to move with the split, the WT_REF.home field might change
+ * underneath us and we could race, and end up attempting to access
+ * an evicted page. Set the session page-index generation so if the
+ * parent splits, it still can't be evicted.
+ */
+ WT_WITH_PAGE_INDEX(session,
+ ret = __split_internal_lock_worker(
+ session, ref, trylock, parentp, hazardp));
+ return (ret);
+}
+
+/*
* __split_internal_unlock --
* Unlock the parent page.
*/