diff options
author | dwight <dwight@10gen.com> | 2010-10-30 15:41:35 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2010-11-19 23:30:46 -0500 |
commit | 17338d81b063812938d656074d4ab0138a260155 (patch) | |
tree | 0d68c21ecf39a3d76cd9dd36c7e8931840a1af05 | |
parent | e624de4c5121a174d66fb3d372d8a3097af6d54d (diff) | |
download | mongo-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.cpp | 9 |
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! */ |