summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordwight <dwight@10gen.com>2010-10-30 15:41:35 -0400
committerEliot Horowitz <eliot@10gen.com>2010-11-19 23:30:46 -0500
commit17338d81b063812938d656074d4ab0138a260155 (patch)
tree0d68c21ecf39a3d76cd9dd36c7e8931840a1af05
parente624de4c5121a174d66fb3d372d8a3097af6d54d (diff)
downloadmongo-17338d81b063812938d656074d4ab0138a260155.tar.gz
rs fix initial sync oplog application it was grabbing the whole oplog which can be problematic and inefficient 165
-rw-r--r--db/repl/rs_sync.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/db/repl/rs_sync.cpp b/db/repl/rs_sync.cpp
index 9ea65cfe35b..9de3f60f286 100644
--- a/db/repl/rs_sync.cpp
+++ b/db/repl/rs_sync.cpp
@@ -70,7 +70,14 @@ namespace mongo {
return false;
}
- r.query(rsoplog, bo());
+ {
+ BSONObjBuilder q;
+ q.appendDate("$gte", applyGTE.asDate());
+ BSONObjBuilder query;
+ query.append("ts", q.done());
+ BSONObj queryObj = query.done();
+ r.query(rsoplog, queryObj);
+ }
assert( r.haveCursor() );
/* we lock outside the loop to avoid the overhead of locking on every operation. server isn't usable yet anyway! */