diff options
author | Michael Cahill <michael.cahill@wiredtiger.com> | 2013-03-04 13:44:30 +1100 |
---|---|---|
committer | Michael Cahill <michael.cahill@wiredtiger.com> | 2013-03-04 13:44:30 +1100 |
commit | 95ff7c0b248aa00a1cd32de8e136c1db85049755 (patch) | |
tree | 676cd1568ddf778abb318bac2927edec6e68d31e /src | |
parent | aa91e7ef46079592044f76f9ef73303ef6258756 (diff) | |
download | mongo-95ff7c0b248aa00a1cd32de8e136c1db85049755.tar.gz |
Set a page's disk_txn when it is first modified: might as well get the latest possible value.
Diffstat (limited to 'src')
-rw-r--r-- | src/include/btree.i | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/include/btree.i b/src/include/btree.i index b4b3c1ba642..33be9d8e53d 100644 --- a/src/include/btree.i +++ b/src/include/btree.i @@ -237,13 +237,6 @@ __wt_page_modify_init(WT_SESSION_IMPL *session, WT_PAGE *page) WT_RET(__wt_calloc_def(session, 1, &modify)); /* - * The page can never end up with changes older than the oldest - * running transaction. - */ - if (F_ISSET(&session->txn, TXN_RUNNING)) - modify->disk_txn = session->txn.snap_min - 1; - - /* * Multiple threads of control may be searching and deciding to modify * a page, if we don't do the update, discard the memory. */ @@ -263,7 +256,15 @@ __wt_page_modify_set(WT_SESSION_IMPL *session, WT_PAGE *page) (void)WT_ATOMIC_ADD(S2C(session)->cache->pages_dirty, 1); (void)WT_ATOMIC_ADD( S2C(session)->cache->bytes_dirty, page->memory_footprint); + + /* + * The page can never end up with changes older than the oldest + * running transaction. + */ + if (F_ISSET(&session->txn, TXN_RUNNING)) + page->modify->disk_txn = session->txn.snap_min - 1; } + /* * Publish: there must be a barrier to ensure all changes to the page * are flushed before we update the page's write generation, otherwise |