Permalink
Browse files

Don't re-clone docs to capped collections SERVER-4626

  • Loading branch information...
1 parent ad9f37f commit 2bedc3cf68bcd4cf6f5690ce5901df5f60b54bcb @kchodorow kchodorow committed Feb 15, 2012
Showing with 8 additions and 1 deletion.
  1. +8 −1 db/oplog.cpp
View
@@ -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;

0 comments on commit 2bedc3c

Please sign in to comment.