summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gorrod <alexg@wiredtiger.com>2014-12-03 15:58:33 +1100
committerAlex Gorrod <alexg@wiredtiger.com>2014-12-03 15:58:33 +1100
commite397880e4795aa298500052bf61b7ae679f6b6b9 (patch)
tree1f069a32b43f4699e39c02e19c0ea769d9d8c345
parent3f295999acfdced50112dc08e9a391e50a37f7e4 (diff)
parentda4fbf00fce2fc9881162e59bbfae694b1e4a1ce (diff)
downloadmongo-e397880e4795aa298500052bf61b7ae679f6b6b9.tar.gz
Merge pull request #1427 from wiredtiger/split-fixes
Fixes for in-memory splits
-rw-r--r--src/btree/rec_evict.c35
-rw-r--r--src/btree/rec_split.c9
2 files changed, 21 insertions, 23 deletions
diff --git a/src/btree/rec_evict.c b/src/btree/rec_evict.c
index f8dd4708ffd..4fec0f023de 100644
--- a/src/btree/rec_evict.c
+++ b/src/btree/rec_evict.c
@@ -284,24 +284,6 @@ __rec_review(WT_SESSION_IMPL *session, WT_REF *ref,
* valid memory.
*/
__wt_evict_list_clear_page(session, ref);
-
- /*
- * Check for an append-only workload needing an in-memory split.
- *
- * We can't do this earlier because in-memory splits require
- * exclusive access. If an in-memory split completes, the page
- * stays in memory and the tree is left in the desired state:
- * avoid the usual cleanup.
- *
- * Attempt the split before checking whether a checkpoint is
- * running - that's not a problem here because we aren't
- * evicting any dirty pages.
- */
- if (top) {
- WT_RET(__wt_split_insert(session, ref, inmem_splitp));
- if (*inmem_splitp)
- return (0);
- }
}
/*
@@ -377,6 +359,23 @@ __rec_review(WT_SESSION_IMPL *session, WT_REF *ref,
}
/*
+ * Check for an append-only workload needing an in-memory split.
+ *
+ * We can't do this earlier because in-memory splits require exclusive
+ * access. If an in-memory split completes, the page stays in memory
+ * and the tree is left in the desired state: avoid the usual cleanup.
+ *
+ * Attempt the split before checking whether a checkpoint is running -
+ * that's not a problem here because we aren't evicting any dirty
+ * pages.
+ */
+ if (top && !exclusive) {
+ WT_RET(__wt_split_insert(session, ref, inmem_splitp));
+ if (*inmem_splitp)
+ return (0);
+ }
+
+ /*
* Fail if any page in the top-level page's subtree won't be merged into
* its parent, the page that cannot be merged must be evicted first.
* The test is necessary but should not fire much: the eviction code is
diff --git a/src/btree/rec_split.c b/src/btree/rec_split.c
index dea44503c55..e25f0b73e01 100644
--- a/src/btree/rec_split.c
+++ b/src/btree/rec_split.c
@@ -1033,15 +1033,14 @@ __wt_split_insert(WT_SESSION_IMPL *session, WT_REF *ref, int *splitp)
* discarding the tree, check and see if it's worth doing a split to
* let the threads continue before doing eviction.
*
- * Ignore anything other than row-store leaf pages.
- * Ignore small pages.
+ * Ignore anything other than large, dirty row-store leaf pages.
*
* XXX KEITH
* Need a better test for append-only workloads.
*/
- if (page->type != WT_PAGE_ROW_LEAF)
- return (0);
- if (page->memory_footprint < 10 * btree->maxleafpage)
+ if (page->type != WT_PAGE_ROW_LEAF ||
+ page->memory_footprint < btree->maxmempage ||
+ !__wt_page_is_modified(page))
return (0);
/*