diff options
author | Dan Pasette <dan@10gen.com> | 2015-02-04 06:48:51 -0500 |
---|---|---|
committer | Dan Pasette <dan@mongodb.com> | 2015-02-04 06:55:52 -0500 |
commit | 7d9ec251cf0e70bc0f9bb246aacfb6e62226ad37 (patch) | |
tree | 5b436359112bc5610dcf9fd1e1f7331854b388d6 /src/third_party/wiredtiger/src/reconcile | |
parent | fc14926f9c8256edce8bbd15d439ca34667c6ebb (diff) | |
download | mongo-7d9ec251cf0e70bc0f9bb246aacfb6e62226ad37.tar.gz |
Import wiredtiger-wiredtiger-mongodb-2.8-rc7-105-g92325a3.tar.gz from wiredtiger branch mongodb-2.8
Diffstat (limited to 'src/third_party/wiredtiger/src/reconcile')
-rw-r--r-- | src/third_party/wiredtiger/src/reconcile/rec_track.c | 41 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/reconcile/rec_write.c | 27 |
2 files changed, 34 insertions, 34 deletions
diff --git a/src/third_party/wiredtiger/src/reconcile/rec_track.c b/src/third_party/wiredtiger/src/reconcile/rec_track.c index c5c72391248..2533ad9e201 100644 --- a/src/third_party/wiredtiger/src/reconcile/rec_track.c +++ b/src/third_party/wiredtiger/src/reconcile/rec_track.c @@ -335,12 +335,12 @@ __ovfl_reuse_wrapup(WT_SESSION_IMPL *session, WT_PAGE *page) * fixing up skiplist links. */ for (i = WT_SKIP_MAXDEPTH - 1; i > 0; --i) - for (e = &head[i]; *e != NULL;) { - if (F_ISSET(*e, WT_OVFL_REUSE_INUSE)) { - e = &(*e)->next[i]; + for (e = &head[i]; (reuse = *e) != NULL;) { + if (F_ISSET(reuse, WT_OVFL_REUSE_INUSE)) { + e = &reuse->next[i]; continue; } - *e = (*e)->next[i]; + *e = reuse->next[i]; } /* @@ -359,19 +359,20 @@ __ovfl_reuse_wrapup(WT_SESSION_IMPL *session, WT_PAGE *page) if (F_ISSET(reuse, WT_OVFL_REUSE_INUSE)) { F_CLR(reuse, WT_OVFL_REUSE_INUSE | WT_OVFL_REUSE_JUST_ADDED); - e = &(*e)->next[0]; + e = &reuse->next[0]; continue; } - *e = (*e)->next[0]; + *e = reuse->next[0]; WT_ASSERT(session, !F_ISSET(reuse, WT_OVFL_REUSE_JUST_ADDED)); - decr += WT_OVFL_SIZE(reuse, WT_OVFL_REUSE); if (WT_VERBOSE_ISSET(session, WT_VERB_OVERFLOW)) WT_RET( __ovfl_reuse_verbose(session, page, reuse, "free")); + WT_RET(bm->free( bm, session, WT_OVFL_REUSE_ADDR(reuse), reuse->addr_size)); + decr += WT_OVFL_SIZE(reuse, WT_OVFL_REUSE); __wt_free(session, reuse); } @@ -404,12 +405,12 @@ __ovfl_reuse_wrapup_err(WT_SESSION_IMPL *session, WT_PAGE *page) * fixing up skiplist links. */ for (i = WT_SKIP_MAXDEPTH - 1; i > 0; --i) - for (e = &head[i]; *e != NULL;) { - if (!F_ISSET(*e, WT_OVFL_REUSE_JUST_ADDED)) { - e = &(*e)->next[i]; + for (e = &head[i]; (reuse = *e) != NULL;) { + if (!F_ISSET(reuse, WT_OVFL_REUSE_JUST_ADDED)) { + e = &reuse->next[i]; continue; } - *e = (*e)->next[i]; + *e = reuse->next[i]; } /* @@ -420,17 +421,17 @@ __ovfl_reuse_wrapup_err(WT_SESSION_IMPL *session, WT_PAGE *page) for (e = &head[0]; (reuse = *e) != NULL;) { if (!F_ISSET(reuse, WT_OVFL_REUSE_JUST_ADDED)) { F_CLR(reuse, WT_OVFL_REUSE_INUSE); - e = &(*e)->next[0]; + e = &reuse->next[0]; continue; } - *e = (*e)->next[0]; + *e = reuse->next[0]; if (WT_VERBOSE_ISSET(session, WT_VERB_OVERFLOW)) WT_RET( __ovfl_reuse_verbose(session, page, reuse, "free")); + WT_TRET(bm->free( bm, session, WT_OVFL_REUSE_ADDR(reuse), reuse->addr_size)); - decr += WT_OVFL_SIZE(reuse, WT_OVFL_REUSE); __wt_free(session, reuse); } @@ -722,26 +723,26 @@ __ovfl_txnc_wrapup(WT_SESSION_IMPL *session, WT_PAGE *page) for (i = WT_SKIP_MAXDEPTH - 1; i > 0; --i) for (e = &head[i]; (txnc = *e) != NULL;) { if (TXNID_LE(oldest_txn, txnc->current)) { - e = &(*e)->next[i]; + e = &txnc->next[i]; continue; } - *e = (*e)->next[i]; + *e = txnc->next[i]; } /* Second, discard any no longer needed transaction-cache records. */ decr = 0; for (e = &head[0]; (txnc = *e) != NULL;) { if (TXNID_LE(oldest_txn, txnc->current)) { - e = &(*e)->next[0]; + e = &txnc->next[0]; continue; } - *e = (*e)->next[0]; - - decr += WT_OVFL_SIZE(txnc, WT_OVFL_TXNC); + *e = txnc->next[0]; if (WT_VERBOSE_ISSET(session, WT_VERB_OVERFLOW)) WT_RET( __ovfl_txnc_verbose(session, page, txnc, "free")); + + decr += WT_OVFL_SIZE(txnc, WT_OVFL_TXNC); __wt_free(session, txnc); } diff --git a/src/third_party/wiredtiger/src/reconcile/rec_write.c b/src/third_party/wiredtiger/src/reconcile/rec_write.c index 0300596f90b..be66309c77f 100644 --- a/src/third_party/wiredtiger/src/reconcile/rec_write.c +++ b/src/third_party/wiredtiger/src/reconcile/rec_write.c @@ -440,8 +440,11 @@ __wt_reconcile(WT_SESSION_IMPL *session, * Root pages are special, splits have to be done, we can't put it off * as the parent's problem any more. */ - if (__wt_ref_is_root(ref)) - return (__rec_root_write(session, page, flags)); + if (__wt_ref_is_root(ref)) { + WT_WITH_PAGE_INDEX(session, + ret = __rec_root_write(session, page, flags)); + return (ret); + } /* * Otherwise, mark the page's parent dirty. @@ -504,6 +507,7 @@ __rec_root_write(WT_SESSION_IMPL *session, WT_PAGE *page, uint32_t flags) WT_ILLEGAL_VALUE(session); } + WT_ASSERT(session, session->split_gen != 0); pindex = WT_INTL_INDEX_COPY(next); for (i = 0; i < mod->mod_multi_entries; ++i) { WT_ERR(__wt_multi_to_ref(session, @@ -2895,7 +2899,7 @@ __wt_bulk_init(WT_SESSION_IMPL *session, WT_CURSOR_BULK *cbulk) WT_RET_MSG(session, EINVAL, "bulk-load is only possible for newly created trees"); - /* Set a reference to the empty leaf page. */ + /* Get a reference to the empty leaf page. */ pindex = WT_INTL_INDEX_COPY(btree->root.page); cbulk->ref = pindex->index[0]; cbulk->leaf = cbulk->ref->page; @@ -4005,7 +4009,6 @@ __rec_row_int(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_PAGE *page) WT_ERR(__rec_child_modify(session, r, ref, &hazard, &state)); addr = ref->addr; child = ref->page; - vtype = 0; /* Deleted child we don't have to write. */ if (state == WT_CHILD_IGNORE) { @@ -4023,10 +4026,6 @@ __rec_row_int(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_PAGE *page) continue; } - /* Deleted child requiring a proxy cell. */ - if (state == WT_CHILD_PROXY) - vtype = WT_CELL_ADDR_DEL; - /* * Modified child. Empty pages are merged into the parent and * discarded. @@ -4076,22 +4075,22 @@ __rec_row_int(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_PAGE *page) /* * Build the value cell, the child page's address. Addr points - * to an on-page cell or an off-page WT_ADDR structure. The - * cell type has been set in the case of page deletion requiring + * to an on-page cell or an off-page WT_ADDR structure. There's + * a special cell type in the case of page deletion requiring * a proxy cell, otherwise use the information from the addr or * original cell. */ if (__wt_off_page(page, addr)) { p = addr->addr; size = addr->size; - if (vtype == 0) - vtype = __rec_vtype(addr); + vtype = state == WT_CHILD_PROXY ? + WT_CELL_ADDR_DEL : __rec_vtype(addr); } else { __wt_cell_unpack(ref->addr, vpack); p = vpack->data; size = vpack->size; - if (vtype == 0) - vtype = vpack->raw; + vtype = state == WT_CHILD_PROXY ? + WT_CELL_ADDR_DEL : (u_int)vpack->raw; } __rec_cell_build_addr(r, p, size, vtype, 0); CHILD_RELEASE_ERR(session, hazard, ref); |