summaryrefslogtreecommitdiff
path: root/db/dur_recover.cpp
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2011-01-04 20:01:22 -0500
committerMathias Stearn <mathias@10gen.com>2011-01-04 20:01:22 -0500
commit0dca1c2332f945737631eea120c08ab799fd1f9f (patch)
treee3a38dbcdd9712804c1222677cf1225f5f26611c /db/dur_recover.cpp
parent1558b7543baafd7bf6c90f390bba69e7f85a0c36 (diff)
downloadmongo-0dca1c2332f945737631eea120c08ab799fd1f9f.tar.gz
recoveryJob now knows if doing recovery or WRITETODATAFILES
Diffstat (limited to 'db/dur_recover.cpp')
-rw-r--r--db/dur_recover.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/db/dur_recover.cpp b/db/dur_recover.cpp
index e9a77e2ca51..f89f719d5ae 100644
--- a/db/dur_recover.cpp
+++ b/db/dur_recover.cpp
@@ -277,11 +277,11 @@ namespace mongo {
log() << "END section" << endl;
}
- void RecoveryJob::processSection(const void *p, unsigned len, bool doDurOps) {
+ void RecoveryJob::processSection(const void *p, unsigned len) {
scoped_lock lk(_mx);
vector<ParsedJournalEntry> entries;
- JournalSectionIterator i(p, len, doDurOps);
+ JournalSectionIterator i(p, len, _recovering);
if( _lastDataSyncedFromLastRun > i.seqNumber() + ExtraKeepTimeMs ) {
log() << "recover skipping application of section " << i.seqNumber() << " < lsn:" << _lastDataSyncedFromLastRun << endl;
@@ -323,7 +323,7 @@ namespace mongo {
while ( !br.atEof() ) {
JSectHeader h;
br.peek(h);
- processSection(br.skip(h.len), h.len, /*doDurOps*/true);
+ processSection(br.skip(h.len), h.len);
// ctrl c check
killCurrentOp.checkForInterrupt(false);
@@ -350,6 +350,7 @@ namespace mongo {
/** @param files all the j._0 style files we need to apply for recovery */
void RecoveryJob::go(vector<path>& files) {
log() << "recover begin" << endl;
+ _recovering = true;
// load the last sequence number synced to the datafiles on disk before the last crash
_lastDataSyncedFromLastRun = journalReadLSN();
@@ -374,6 +375,7 @@ namespace mongo {
removeJournalFiles();
log() << "recover done" << endl;
okToCleanUp = true;
+ _recovering = false;
}
void _recover() {