Permalink
Browse files

SERVER-5177 - fetching of docs in initial sync can assert

  • Loading branch information...
1 parent c546330 commit 32cc883b299b6d5f3bf8be4c74c448192453d818 @erh erh committed Mar 2, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 db/oplog.cpp
View
@@ -629,16 +629,16 @@ namespace mongo {
OplogReader missingObjReader;
const char *ns = o.getStringField("ns");
+ // should already have write lock
+ Client::Context ctx(ns);
+
// capped collections
NamespaceDetails *nsd = nsdetails(ns);
if (nsd && nsd->capped) {
log() << "replication missing doc, but this is okay for a capped collection (" << ns << ")" << endl;
return false;
}
-
- // should already have write lock
- Client::Context ctx(ns);
-
+
// we don't have the object yet, which is possible on initial sync. get it.
log() << "replication info adding missing object" << endl; // rare enough we can log
uassert(15916, str::stream() << "Can no longer connect to initial sync source: " << hn, missingObjReader.connect(hn));

0 comments on commit 32cc883

Please sign in to comment.