diff options
Diffstat (limited to 'src/third_party/wiredtiger/src/reconcile/rec_write.c')
-rw-r--r-- | src/third_party/wiredtiger/src/reconcile/rec_write.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/src/third_party/wiredtiger/src/reconcile/rec_write.c b/src/third_party/wiredtiger/src/reconcile/rec_write.c index 667e8c119b7..f66d898e268 100644 --- a/src/third_party/wiredtiger/src/reconcile/rec_write.c +++ b/src/third_party/wiredtiger/src/reconcile/rec_write.c @@ -1516,7 +1516,7 @@ err: * Initialize the page write generation number. */ static void -__rec_set_page_write_gen(WT_PAGE_HEADER *dsk, WT_BTREE *btree) +__rec_set_page_write_gen(WT_BTREE *btree, WT_PAGE_HEADER *dsk) { /* * We increment the block's write generation so it's easy to identify newer versions of blocks @@ -1553,7 +1553,7 @@ __rec_split_write_header(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_REC_CHUNK dsk->recno = btree->type == BTREE_ROW ? WT_RECNO_OOB : multi->key.recno; - __rec_set_page_write_gen(dsk, btree); + __rec_set_page_write_gen(btree, dsk); dsk->mem_size = multi->size; dsk->u.entries = chunk->entries; dsk->type = page->type; @@ -2088,6 +2088,22 @@ __rec_write_wrapup(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_PAGE *page) WT_TIME_AGGREGATE_INIT(&ta); /* + * If using the history store table eviction path and we found updates that weren't globally + * visible when reconciling this page, copy them into the database's history store. This can + * fail, so try before clearing the page's previous reconciliation state. + */ + if (F_ISSET(r, WT_REC_HS)) + WT_RET(__rec_hs_wrapup(session, r)); + + /* + * Wrap up overflow tracking. If we are about to create a checkpoint, the system must be + * entirely consistent at that point (the underlying block manager is presumably going to do + * some action to resolve the list of allocated/free/whatever blocks that are associated with + * the checkpoint). + */ + WT_RET(__wt_ovfl_track_wrapup(session, page)); + + /* * This page may have previously been reconciled, and that information is now about to be * replaced. Make sure it's discarded at some point, and clear the underlying modification * information, we're creating a new reality. @@ -2137,21 +2153,6 @@ __rec_write_wrapup(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_PAGE *page) /* Reset the reconciliation state. */ mod->rec_result = 0; - /* - * If using the history store table eviction path and we found updates that weren't globally - * visible when reconciling this page, copy them into the database's history store. - */ - if (F_ISSET(r, WT_REC_HS)) - WT_RET(__rec_hs_wrapup(session, r)); - - /* - * Wrap up overflow tracking. If we are about to create a checkpoint, the system must be - * entirely consistent at that point (the underlying block manager is presumably going to do - * some action to resolve the list of allocated/free/whatever blocks that are associated with - * the checkpoint). - */ - WT_RET(__wt_ovfl_track_wrapup(session, page)); - __wt_verbose(session, WT_VERB_RECONCILE, "%p reconciled into %" PRIu32 " pages", (void *)ref, r->multi_next); @@ -2367,7 +2368,7 @@ __wt_rec_cell_build_ovfl(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_REC_KV *k dsk = tmp->mem; memset(dsk, 0, WT_PAGE_HEADER_SIZE); dsk->type = WT_PAGE_OVFL; - __rec_set_page_write_gen(dsk, btree); + __rec_set_page_write_gen(btree, dsk); dsk->u.datalen = (uint32_t)kv->buf.size; memcpy(WT_PAGE_HEADER_BYTE(btree, dsk), kv->buf.data, kv->buf.size); dsk->mem_size = WT_PAGE_HEADER_BYTE_SIZE(btree) + (uint32_t)kv->buf.size; |