diff options
author | Kristina <kristina@10gen.com> | 2011-10-05 14:34:21 -0400 |
---|---|---|
committer | Kristina <kristina@10gen.com> | 2011-10-05 14:34:21 -0400 |
commit | 7db36ba5a388d1f8f55cd4c5a7ce9c8fb7e82d7d (patch) | |
tree | 1dbc82a982f71e9dc8a23ec457933bb1f5b30638 | |
parent | 2e48cfb4d798f2a5d3d3535a1d2cbe442d086325 (diff) | |
download | mongo-7db36ba5a388d1f8f55cd4c5a7ce9c8fb7e82d7d.tar.gz |
continuation of initial sync fix
Conflicts:
db/repl/rs_sync.cpp
-rw-r--r-- | db/repl/rs_sync.cpp | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/db/repl/rs_sync.cpp b/db/repl/rs_sync.cpp index 1417df1d6c1..d09509fb5b2 100644 --- a/db/repl/rs_sync.cpp +++ b/db/repl/rs_sync.cpp @@ -147,13 +147,25 @@ namespace mongo { return false; } const char *ns = o.getStringField("ns"); - BSONObj query = BSONObjBuilder().append(o.getObjectField("o2")[_id]).obj(); // might be more than just _id in the update criteria - BSONObj missingObj = missingObjReader.findOne( - ns, - query ); + BSONObj query = BSONObjBuilder().append(o.getObjectField("o2")["_id"]).obj(); // might be more than just _id in the update criteria + BSONObj missingObj; + try { + missingObj = missingObjReader.findOne( + ns, + query ); + } catch(...) { + log() << "replSet assertion fetching missing object" << endl; + throw; + } assert( !missingObj.isEmpty() ); - DiskLoc d = theDataFileMgr.insert(ns, (void*) missingObj.objdata(), missingObj.objsize()); - assert( !d.isNull() ); + Client::Context ctx(ns); + try { + DiskLoc d = theDataFileMgr.insert(ns, (void*) missingObj.objdata(), missingObj.objsize()); + assert( !d.isNull() ); + } catch(...) { + log() << "replSet assertion during insert of missing object" << endl; + throw; + } // now reapply the update from above bool failed = syncApply(o); if( failed ) { |