diff options
author | Michael Cahill <michael.cahill@wiredtiger.com> | 2015-01-27 09:58:32 +1100 |
---|---|---|
committer | Michael Cahill <michael.cahill@wiredtiger.com> | 2015-01-27 09:58:32 +1100 |
commit | c2e108e2774ae79504579bcdca33f26fcff8cb07 (patch) | |
tree | 6de16c27d7171f1b2cb5f698ada844aedad0b415 | |
parent | 13ab5da875bbc700f84d8593fe3d95c51536a540 (diff) | |
download | mongo-c2e108e2774ae79504579bcdca33f26fcff8cb07.tar.gz |
Change recovery to start from the checkpoint LSN in the metadata. Don't assert that we see a checkpoint complete in the available log: if the application crashes in between syncing the metadata and writing the final checkpoint record, there is no need to roll anything forward but we don't have the final checkpoint.
refs #1529
-rw-r--r-- | src/txn/txn_recover.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/txn/txn_recover.c b/src/txn/txn_recover.c index b2515e3c8cd..62890db7895 100644 --- a/src/txn/txn_recover.c +++ b/src/txn/txn_recover.c @@ -452,12 +452,17 @@ __wt_txn_recover(WT_SESSION_IMPL *session) if (WT_IS_INIT_LSN(&metafile->ckpt_lsn)) WT_ERR(__wt_log_scan(session, NULL, WT_LOGSCAN_FIRST, __txn_log_recover, &r)); - else + else { + /* + * Start at the last checkpoint LSN referenced in the + * metadata. If we see the end of a checkpoint while + * scanning, we will change the full scan to start from + * there. + */ + r.ckpt_lsn = metafile->ckpt_lsn; WT_ERR(__wt_log_scan(session, &metafile->ckpt_lsn, 0, __txn_log_recover, &r)); - - WT_ASSERT(session, - LOG_CMP(&r.ckpt_lsn, &conn->log->first_lsn) >= 0); + } } /* Scan the metadata to find the live files and their IDs. */ |