summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/btree/bt_split.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/wiredtiger/src/btree/bt_split.c')
-rw-r--r--src/third_party/wiredtiger/src/btree/bt_split.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/third_party/wiredtiger/src/btree/bt_split.c b/src/third_party/wiredtiger/src/btree/bt_split.c
index c316be6f908..0d6428349dc 100644
--- a/src/third_party/wiredtiger/src/btree/bt_split.c
+++ b/src/third_party/wiredtiger/src/btree/bt_split.c
@@ -837,6 +837,9 @@ __wt_multi_to_ref(WT_SESSION_IMPL *session,
return (0);
}
+#define WT_SPLIT_EXCLUSIVE 0x01 /* Page held exclusively */
+#define WT_SPLIT_INMEM 0x02 /* In-memory split */
+
/*
* __split_parent --
* Resolve a multi-page split, inserting new information into the parent.
@@ -890,7 +893,7 @@ __split_parent(WT_SESSION_IMPL *session, WT_REF *ref,
* trying to split a page while its parent is being
* checkpointed.
*/
- if (LF_ISSET(WT_EVICT_INMEM_SPLIT))
+ if (LF_ISSET(WT_SPLIT_INMEM))
return (EBUSY);
__wt_yield();
}
@@ -1087,7 +1090,7 @@ __split_parent(WT_SESSION_IMPL *session, WT_REF *ref,
*/
size = sizeof(WT_PAGE_INDEX) + pindex->entries * sizeof(WT_REF *);
WT_TRET(__split_safe_free(session,
- split_gen, LF_ISSET(WT_EVICT_EXCLUSIVE), pindex, size));
+ split_gen, LF_ISSET(WT_SPLIT_EXCLUSIVE) ? 1 : 0, pindex, size));
parent_decr += size;
/*
@@ -1112,7 +1115,7 @@ __split_parent(WT_SESSION_IMPL *session, WT_REF *ref,
* Do the check here because we've just grown the parent page and
* are holding it locked.
*/
- if (ret == 0 && !LF_ISSET(WT_EVICT_EXCLUSIVE) &&
+ if (ret == 0 && !LF_ISSET(WT_SPLIT_EXCLUSIVE) &&
!F_ISSET_ATOMIC(parent, WT_PAGE_REFUSE_DEEPEN) &&
__split_should_deepen(session, parent_ref)) {
/*
@@ -1375,8 +1378,8 @@ __wt_split_insert(WT_SESSION_IMPL *session, WT_REF *ref)
* longer locked, so we cannot safely look at it.
*/
page = NULL;
- if ((ret = __split_parent(session,
- ref, split_ref, 2, parent_incr, WT_EVICT_INMEM_SPLIT)) != 0) {
+ if ((ret = __split_parent(
+ session, ref, split_ref, 2, parent_incr, WT_SPLIT_INMEM)) != 0) {
/*
* Move the insert list element back to the original page list.
* For simplicity, the previous skip list pointers originally
@@ -1467,7 +1470,7 @@ __wt_split_rewrite(WT_SESSION_IMPL *session, WT_REF *ref)
* Resolve a page split.
*/
int
-__wt_split_multi(WT_SESSION_IMPL *session, WT_REF *ref, int exclusive)
+__wt_split_multi(WT_SESSION_IMPL *session, WT_REF *ref, int closing)
{
WT_DECL_RET;
WT_PAGE *page;
@@ -1491,9 +1494,12 @@ __wt_split_multi(WT_SESSION_IMPL *session, WT_REF *ref, int exclusive)
WT_ERR(__wt_multi_to_ref(session,
page, &mod->mod_multi[i], &ref_new[i], &parent_incr));
- /* Split into the parent. */
+ /*
+ * Split into the parent; if we're closing the file, we hold it
+ * exclusively.
+ */
WT_ERR(__split_parent( session, ref, ref_new,
- new_entries, parent_incr, exclusive ? WT_EVICT_EXCLUSIVE : 0));
+ new_entries, parent_incr, closing ? WT_SPLIT_EXCLUSIVE : 0));
WT_STAT_FAST_CONN_INCR(session, cache_eviction_split);
WT_STAT_FAST_DATA_INCR(session, cache_eviction_split);