diff options
author | Alex Gorrod <alexander.gorrod@mongodb.com> | 2015-03-09 10:57:15 +1100 |
---|---|---|
committer | Alex Gorrod <alexander.gorrod@mongodb.com> | 2015-03-09 10:57:15 +1100 |
commit | a54d08b4bb2e37c9839caf45a19f38316d0c6561 (patch) | |
tree | fd6c5d0c7de8574482e7d0b9abd45194e33f2cfd | |
parent | 603254f2c464653a36c5727c1a1fae6e057c9cab (diff) | |
parent | 4235c69d37474fb4e14673e0ea99337659db948d (diff) | |
download | mongo-a54d08b4bb2e37c9839caf45a19f38316d0c6561.tar.gz |
Merge pull request #1735 from wiredtiger/checkpoint-skip-tree-dirty
When skipping a dirty page during a checkpoint, make sure the tree is marked dirty
-rw-r--r-- | src/btree/bt_sync.c | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/src/btree/bt_sync.c b/src/btree/bt_sync.c index d925eefc2fe..bc5d1051b1e 100644 --- a/src/btree/bt_sync.c +++ b/src/btree/bt_sync.c @@ -113,6 +113,13 @@ __sync_file(WT_SESSION_IMPL *session, int syncop) if (walk == NULL) break; + page = walk->page; + mod = page->modify; + + /* Skip clean pages. */ + if (!__wt_page_is_modified(page)) + continue; + /* * Write dirty pages, unless we can be sure they only * became dirty after the checkpoint started. @@ -125,23 +132,27 @@ __sync_file(WT_SESSION_IMPL *session, int syncop) * (3) the first dirty update on the page is * sufficiently recent that the checkpoint * transaction would skip them. + * + * Mark the tree dirty: the checkpoint marked it clean + * and we can't skip future checkpoints until this page + * is written. */ - page = walk->page; - mod = page->modify; - if (__wt_page_is_modified(page) && - (WT_PAGE_IS_INTERNAL(page) || - !F_ISSET(txn, TXN_HAS_SNAPSHOT) || - TXNID_LE(mod->first_dirty_txn, txn->snap_max))) { - if (WT_PAGE_IS_INTERNAL(page)) { - internal_bytes += - page->memory_footprint; - ++internal_pages; - } else { - leaf_bytes += page->memory_footprint; - ++leaf_pages; - } - WT_ERR(__wt_reconcile(session, walk, NULL, 0)); + if (!WT_PAGE_IS_INTERNAL(page) && + F_ISSET(txn, TXN_HAS_SNAPSHOT) && + TXNID_LT(txn->snap_max, mod->first_dirty_txn)) { + __wt_page_modify_set(session, page); + continue; + } + + if (WT_PAGE_IS_INTERNAL(page)) { + internal_bytes += + page->memory_footprint; + ++internal_pages; + } else { + leaf_bytes += page->memory_footprint; + ++leaf_pages; } + WT_ERR(__wt_reconcile(session, walk, NULL, 0)); } break; } |