mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
repair handles invalid objects better
This commit is contained in:
parent
382d7e21d3
commit
28683f8464
@ -185,8 +185,26 @@ public:
|
||||
}
|
||||
log(1) << loc << endl;
|
||||
Record* rec = loc.rec();
|
||||
log(1) << loc.obj() << endl;
|
||||
w( loc.obj() );
|
||||
BSONObj obj;
|
||||
try {
|
||||
obj = loc.obj();
|
||||
assert( obj.valid() );
|
||||
LOG(1) << obj << endl;
|
||||
w( obj );
|
||||
}
|
||||
catch ( std::exception& e ) {
|
||||
log() << "found invalid document @ " << loc << " " << e.what() << endl;
|
||||
if ( ! obj.isEmpty() ) {
|
||||
try {
|
||||
BSONElement e = obj.firstElement();
|
||||
stringstream ss;
|
||||
ss << "first element: " << e;
|
||||
log() << ss.str();
|
||||
}
|
||||
catch ( std::exception& ee ) {
|
||||
}
|
||||
}
|
||||
}
|
||||
loc = forward ? rec->getNext( loc ) : rec->getPrev( loc );
|
||||
}
|
||||
return forward ? e->xnext : e->xprev;
|
||||
|
Loading…
Reference in New Issue
Block a user