diff options
author | Michael Cahill <michael.cahill@wiredtiger.com> | 2015-03-26 14:30:47 +1100 |
---|---|---|
committer | Michael Cahill <michael.cahill@wiredtiger.com> | 2015-03-26 14:30:47 +1100 |
commit | 62087f7528714a69295b4dc01aeacd1549a0e8f6 (patch) | |
tree | a7554cb39224d693963fa1da002c18f0c76c45f6 | |
parent | fe5a1c3b0e5e51bf4980841233e6335c92d7dcf6 (diff) | |
download | mongo-62087f7528714a69295b4dc01aeacd1549a0e8f6.tar.gz |
Implement Keith's review feedback.
-rw-r--r-- | src/btree/bt_sync.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/btree/bt_sync.c b/src/btree/bt_sync.c index a6ad86c888f..9f9a7cae893 100644 --- a/src/btree/bt_sync.c +++ b/src/btree/bt_sync.c @@ -109,6 +109,17 @@ __sync_file(WT_SESSION_IMPL *session, int syncop) /* Write all dirty in-cache pages. */ flags |= WT_READ_NO_EVICT; for (walk = NULL;;) { + /* + * If we have a page, and it was ever modified, track + * the highest transaction ID in the tree. We do this + * here because we want the value after reconciling + * dirty pages. + */ + if (walk != NULL && walk->page != NULL && + (mod = walk->page->modify) != NULL && + TXNID_LT(btree->rec_max_txn, mod->rec_max_txn)) + btree->rec_max_txn = mod->rec_max_txn; + WT_ERR(__wt_tree_walk(session, &walk, NULL, flags)); if (walk == NULL) break; @@ -117,12 +128,8 @@ __sync_file(WT_SESSION_IMPL *session, int syncop) mod = page->modify; /* Skip clean pages. */ - if (!__wt_page_is_modified(page)) { - if (mod != NULL && TXNID_LT( - btree->rec_max_txn, mod->rec_max_txn)) - btree->rec_max_txn = mod->rec_max_txn; + if (!__wt_page_is_modified(page)) continue; - } /* * Write dirty pages, unless we can be sure they only @@ -157,9 +164,6 @@ __sync_file(WT_SESSION_IMPL *session, int syncop) ++leaf_pages; } WT_ERR(__wt_reconcile(session, walk, NULL, 0)); - - if (TXNID_LT(btree->rec_max_txn, mod->rec_max_txn)) - btree->rec_max_txn = mod->rec_max_txn; } break; } |