-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
ALL
> var rt = new ReplSetTest(
{nodes:7, name:'slave_ok_no_master'});
> rt.startSet(
)
> rt.initiate()
Start up a mongos with rt.getURL() as a shard() and connect
> s='x'
x
> while (s.length < 128*1024) s += s; s.length
131072
> for (var i=0; i<1000; i++) db.foo.insert(
)
[takes a little while]
> db.foo.count()
1000
> db.foo.find().itcount()
1000
> db.getMongo().setSlaveOk()
> db.foo.find().itcount()
Fri Feb 4 17:18:30 Error: getMore: cursor didn't exist on server, possible restart or timeout? shell/query.js:104
It looks like the works/doesn't work threshold is 32/33 which is the same threshold where a the results won't fit into a single message:
> db.foo.find().limit(32).itcount()
32
> db.foo.find().limit(33).itcount()
Fri Feb 4 17:28:59 Error: getMore: cursor didn't exist on server, possible restart or timeout? shell/query.js:104
> Object.bsonsize({_id:ObjectId(), s:s})*32
4195264
> Object.bsonsize({_id:ObjectId(), s:s})*33
4326366
> 4*1024*1024
4194304
I added some debugging info into the code and it looks like the getMore is going to the master.