From eb66a29554f56fd2dd858affa033be090c968355 Mon Sep 17 00:00:00 2001 From: dwight Date: Sat, 30 Oct 2010 15:41:35 -0400 Subject: rs fix initial sync oplog application it was grabbing the whole oplog which can be problematic and inefficient 165 --- db/repl/rs_sync.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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! */ -- cgit v1.2.1