diff options
author | Sam Helman <sam.helman@10gen.com> | 2014-09-26 11:50:05 -0400 |
---|---|---|
committer | Sam Helman <sam.helman@10gen.com> | 2014-09-26 11:50:05 -0400 |
commit | 032f87a8ea2c018a3b7de16e49551cfe1790c54e (patch) | |
tree | 4872c70abadcc83f3e56a592d19013f7fd242916 /src | |
parent | 9bac46f41123ead179332fd586671ca3e2653818 (diff) | |
download | mongo-032f87a8ea2c018a3b7de16e49551cfe1790c54e.tar.gz |
Iter() for parity
Former-commit-id: ba00786f08ec035cf26addec9ded425f88b14aba
Diffstat (limited to 'src')
-rw-r--r-- | src/github.com/mongodb/mongo-tools/mongooplog/mongooplog.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/github.com/mongodb/mongo-tools/mongooplog/mongooplog.go b/src/github.com/mongodb/mongo-tools/mongooplog/mongooplog.go index 3a468b4a728..f3cc66f8ab4 100644 --- a/src/github.com/mongodb/mongo-tools/mongooplog/mongooplog.go +++ b/src/github.com/mongodb/mongo-tools/mongooplog/mongooplog.go @@ -69,6 +69,9 @@ func (self *MongoOplog) Run() error { } defer fromSession.Close() + // set slave ok + fromSession.SetMode(mgo.Eventual, true) + // get the tailing cursor for the source server's oplog tail := buildTailingCursor(fromSession.DB(oplogDB).C(oplogColl), self.SourceOptions) @@ -128,7 +131,7 @@ type OplogEntry struct { Query bson.M `bson:"o2" json:"o2"` } -// get the tailing cursor for the oplog collection, based on the options +// get the cursor for the oplog collection, based on the options // passed in to mongooplog func buildTailingCursor(oplog *mgo.Collection, sourceOptions *options.SourceOptions) *mgo.Iter { @@ -152,6 +155,6 @@ func buildTailingCursor(oplog *mgo.Collection, } // TODO: wait time - return oplog.Find(oplogQuery).Tail() + return oplog.Find(oplogQuery).Iter() } |