-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 0.9
-
Component/s: None
-
None
-
Environment:Windows 7 C# .net 3.5 driver version 10gen driver v0.9.
MongoDB server for linux version 1.6.3 running in a 2 nodes replica set with 2 arbiters (all running on centOS 5.5 VM)
//begin code
var m = MongoServer.Create("mongodb://192.168.1.110:27117,192.168.1.112:27117/cache?replicaset=cacheset&slaveok=true");
var col = m["cache"]["flatdoc"];
var q = Query.In("_id", BsonArray.Create(new[]
));
//this will throw: not master
var res = (from d in col.Find(q) select d).ToList();
//this will also throw: not master
res = (from d in col.Find(q).SetFlags(QueryFlags.SlaveOk) select d).ToList();
//end code
/*
The only way for this to not throw is to exclude slaveok=true from mongo url and
calling SetFlags(QueryFlags.SlaveOk) on the cursor before use.
I hope this helps
*/