From 2bedc3cf68bcd4cf6f5690ce5901df5f60b54bcb Mon Sep 17 00:00:00 2001 From: Kristina Date: Wed, 15 Feb 2012 10:14:17 -0500 Subject: [PATCH] Don't re-clone docs to capped collections SERVER-4626 --- db/oplog.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/db/oplog.cpp b/db/oplog.cpp index 4208ff626af0c..446d7304314d5 100644 --- a/db/oplog.cpp +++ b/db/oplog.cpp @@ -627,12 +627,19 @@ namespace mongo { bool shouldRetry(const BSONObj& o, const string& hn) { OplogReader missingObjReader; + const char *ns = o.getStringField("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; + } // 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)); - const char *ns = o.getStringField("ns"); // might be more than just _id in the update criteria BSONObj query = BSONObjBuilder().append(o.getObjectField("o2")["_id"]).obj(); BSONObj missingObj;