summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2012-03-02 13:43:23 -0500
committerEliot Horowitz <eliot@10gen.com>2012-03-02 13:43:23 -0500
commit32cc883b299b6d5f3bf8be4c74c448192453d818 (patch)
tree5f02d7db363661c80b76fb55e2b0686bc3bedda7
parentc5463305226dfb8f42eb5235ac381442006b29dd (diff)
downloadmongo-32cc883b299b6d5f3bf8be4c74c448192453d818.tar.gz
SERVER-5177 - fetching of docs in initial sync can assert
-rw-r--r--db/oplog.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/db/oplog.cpp b/db/oplog.cpp
index 6e62607949c..f4521f250e1 100644
--- a/db/oplog.cpp
+++ b/db/oplog.cpp
@@ -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));