summaryrefslogtreecommitdiff
path: root/db/dur_recover.cpp
diff options
context:
space:
mode:
authordwight <dwight@10gen.com>2011-03-01 08:05:51 -0500
committerEliot Horowitz <eliot@10gen.com>2011-03-01 10:51:56 -0500
commitbd4605194760d9cb3c8f0f284c7346712deb86e0 (patch)
tree7e34d0884d117e54cd6ce0cb57e750500a42470d /db/dur_recover.cpp
parented6273ba49319928e3c241c4dec33c3195e612f4 (diff)
downloadmongo-bd4605194760d9cb3c8f0f284c7346712deb86e0.tar.gz
fix invalid 'unexpected file in journal directory' error message.
180
Diffstat (limited to 'db/dur_recover.cpp')
-rw-r--r--db/dur_recover.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/db/dur_recover.cpp b/db/dur_recover.cpp
index 94aa4a1b28c..18e722f868c 100644
--- a/db/dur_recover.cpp
+++ b/db/dur_recover.cpp
@@ -73,16 +73,17 @@ namespace mongo {
if( m.count(u) ) {
uasserted(13531, str::stream() << "unexpected files in journal directory " << dir.string() << " : " << fileName);
}
- if( !m.empty() && !m.count(u-1) ) {
- uasserted(13532,
- str::stream() << "unexpected file in journal directory " << dir.string()
- << " : " << fileName << " : can't find its preceeding file");
- }
m.insert( pair<unsigned,path>(u,filepath) );
}
}
- for( map<unsigned,path>::iterator i = m.begin(); i != m.end(); ++i )
+ for( map<unsigned,path>::iterator i = m.begin(); i != m.end(); ++i ) {
+ if( i != m.begin() && m.count(i->first - 1) == 0 ) {
+ uasserted(13532,
+ str::stream() << "unexpected file in journal directory " << dir.string()
+ << " : " << filesystem::path(i->second).leaf() << " : can't find its preceeding file");
+ }
files.push_back(i->second);
+ }
}
/** read through the memory mapped data of a journal file (journal/j._<n> file)