summaryrefslogtreecommitdiff
path: root/src/btree/col_srch.c
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2014-03-03 14:22:15 -0500
committerKeith Bostic <keith@wiredtiger.com>2014-03-03 14:22:15 -0500
commit07fd9661ed3efe8121ff615aa25713763ab19421 (patch)
tree4116c2c45fb35a73244482869dd22b3c202d977b /src/btree/col_srch.c
parent4a35b129f111896666044ab8f9c08c886270428d (diff)
downloadmongo-07fd9661ed3efe8121ff615aa25713763ab19421.tar.gz
Support eviction of pages that include unresolved changes.
Split the page being evicted into two groups of blocks: blocks without changes that cannot be written (cold blocks), and blocks with unresolved changes that cannot be written (hot blocks). Cold blocks are written by reconciliation as usual, and the resulting block address copied into the WT_PAGE.modify structure for eviction's use. Hot blocks: the disk image for each hot block is copied into the WT_PAGE.modify structure, along with a list of WT_UPDATE structures, one for each unresolved change that prevented the page from being written. Eviction then uses the disk image to create a new in-memory page, and the list of WT_UPDATE structures to re-create the list of unresolved changes on that page. Both cold and hot blocks are then moved into a WT_REF array, and split into the parent page.
Diffstat (limited to 'src/btree/col_srch.c')
-rw-r--r--src/btree/col_srch.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/btree/col_srch.c b/src/btree/col_srch.c
index a2c2d804e02..e1a7664a38e 100644
--- a/src/btree/col_srch.c
+++ b/src/btree/col_srch.c
@@ -12,7 +12,8 @@
* Search a column-store tree for a specific record-based key.
*/
int
-__wt_col_search(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt)
+__wt_col_search(WT_SESSION_IMPL *session,
+ uint64_t recno, WT_PAGE *leaf_page, WT_CURSOR_BTREE *cbt)
{
WT_BTREE *btree;
WT_COL *cip;
@@ -22,15 +23,22 @@ __wt_col_search(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt)
WT_PAGE *page;
WT_PAGE_INDEX *pindex;
WT_REF *ref;
- uint64_t recno;
uint32_t base, indx, limit;
int depth;
btree = S2BT(session);
- recno = cbt->iface.recno;
__cursor_search_clear(cbt);
+ /*
+ * In the service of eviction splits, we're only searching a single leaf
+ * page, not a full tree.
+ */
+ if (leaf_page != NULL) {
+ page = leaf_page;
+ goto leaf_only;
+ }
+
restart:
/* Search the internal pages of the tree. */
ref = NULL;
@@ -97,13 +105,11 @@ descend: WT_ASSERT(session, ref != NULL);
return (ret);
}
- /*
- * We want to know how deep the tree gets because excessive depth can
- * happen because of how WiredTiger splits.
- */
+ /* Track how deep the tree gets. */
if (depth > btree->maximum_depth)
btree->maximum_depth = depth;
+leaf_only:
cbt->page = page;
cbt->recno = recno;
cbt->compare = 0;