summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristina <kristina@10gen.com>2012-02-15 10:14:17 -0500
committerKristina <kristina@10gen.com>2012-02-15 10:14:17 -0500
commit2bedc3cf68bcd4cf6f5690ce5901df5f60b54bcb (patch)
treeadd7894fcff674bea0c61adc4e2010093dccfad7
parentad9f37fddbbbf4b4bbcdb2ae1870f0cc9d0f5eb9 (diff)
downloadmongo-2bedc3cf68bcd4cf6f5690ce5901df5f60b54bcb.tar.gz
Don't re-clone docs to capped collections SERVER-4626
-rw-r--r--db/oplog.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/db/oplog.cpp b/db/oplog.cpp
index 4208ff626af..446d7304314 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;