Skip to content

Commit

Permalink
Don't re-clone docs to capped collections SERVER-4626
Browse files Browse the repository at this point in the history
  • Loading branch information
kchodorow committed Feb 15, 2012
1 parent ad9f37f commit 2bedc3c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion db/oplog.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 2bedc3c

Please sign in to comment.