From 32cc883b299b6d5f3bf8be4c74c448192453d818 Mon Sep 17 00:00:00 2001 From: Eliot Horowitz Date: Fri, 2 Mar 2012 13:43:23 -0500 Subject: SERVER-5177 - fetching of docs in initial sync can assert --- db/oplog.cpp | 8 ++++---- 1 file 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)); -- cgit v1.2.1