From 6cc6b78a2071de8600caf28682f84230c8beb34a Mon Sep 17 00:00:00 2001 From: Keith Bostic Date: Tue, 9 Feb 2016 09:55:15 -0500 Subject: WT-2361: column-store starting record number error Move the comment/code for setting the first dirty transaction in the page we're splitting, and the page we're creating, next to each other in the function for clarity. --- src/btree/bt_split.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/btree/bt_split.c b/src/btree/bt_split.c index e036d6e3334..3dea03316ce 100644 --- a/src/btree/bt_split.c +++ b/src/btree/bt_split.c @@ -1787,8 +1787,8 @@ __split_insert(WT_SESSION_IMPL *session, WT_REF *ref) type, WT_INSERT_RECNO(moved_ins), 0, false, &right)); /* - * The new page is dirty by definition, column-store splits update the - * page-modify structure, so create it now. + * The new page is dirty by definition, plus column-store splits update + * the page-modify structure, so create it now. */ WT_ERR(__wt_page_modify_init(session, right)); __wt_page_modify_set(session, right); @@ -1828,15 +1828,6 @@ __split_insert(WT_SESSION_IMPL *session, WT_REF *ref) page->modify->mod_split_recno = child->key.recno; } - /* - * We modified the page above, which will have set the first dirty - * transaction to the last transaction current running. However, the - * updates we installed may be older than that. Set the first dirty - * transaction to an impossibly old value so this page is never skipped - * in a checkpoint. - */ - right->modify->first_dirty_txn = WT_TXN_FIRST; - /* * Calculate how much memory we're moving: figure out how deep the skip * list stack is for the element we are moving, and the memory used by @@ -1934,15 +1925,6 @@ __split_insert(WT_SESSION_IMPL *session, WT_REF *ref) WT_ASSERT(session, ins != moved_ins); #endif - /* - * Update the page accounting. - * - * XXX - * If we fail to split the parent, the page's accounting will be wrong. - */ - __wt_cache_page_inmem_decr(session, page, page_decr); - __wt_cache_page_inmem_incr(session, right, right_incr); - /* * We perform insert splits concurrently with checkpoints, where the * requirement is a checkpoint must include either the original page @@ -1952,6 +1934,24 @@ __split_insert(WT_SESSION_IMPL *session, WT_REF *ref) */ page->modify->first_dirty_txn = WT_TXN_FIRST; + /* + * We modified the page above, which will have set the first dirty + * transaction to the last transaction current running. However, the + * updates we installed may be older than that. Set the first dirty + * transaction to an impossibly old value so this page is never skipped + * in a checkpoint. + */ + right->modify->first_dirty_txn = WT_TXN_FIRST; + + /* + * Update the page accounting. + * + * XXX + * If we fail to split the parent, the page's accounting will be wrong. + */ + __wt_cache_page_inmem_decr(session, page, page_decr); + __wt_cache_page_inmem_incr(session, right, right_incr); + /* * The act of splitting into the parent releases the pages for eviction; * ensure the page contents are consistent. -- cgit v1.2.1