Details
-
Bug
-
Resolution: Duplicate
-
Major - P3
-
None
-
None
-
None
-
ALL
Description
rs.slaveOk() can generate a spurious error message depending on the order it is used in the shell when connected to a secondary.
If you remember to set slaveOk first, all is well:
$ ./mongo --port 27018
MongoDB shell version: 2.1.0-pre-
connecting to: 127.0.0.1:27018/test
SECONDARY> use training
switched to db training
SECONDARY> rs.slaveOk();
SECONDARY> db.scores.findOne();
{
"_id" : ObjectId("4c90f2543d937c033f424701"),
"student" : 0,
"name" : "quiz",
"score" : 50
}
SECONDARY>
But if you don't, you get this:
MongoDB shell version: 2.1.0-pre-
connecting to: 127.0.0.1:27018/test
SECONDARY> use training
switched to db training
SECONDARY> db.scores.findOne();
Mon Sep 12 12:20:03 uncaught exception: error
SECONDARY> rs.slaveOk();
not master and slaveok=false
SECONDARY> db.scores.findOne();
{
"_id" : ObjectId("4c90f2543d937c033f424701"),
"student" : 0,
"name" : "quiz",
"score" : 50
}
SECONDARY> exit
bye
Note the extra "not master and slaveok=false" that comes out after the rs.slaveOk().
Attachments
Issue Links
- duplicates
-
SERVER-1401 Dont call getLastError if last statement didn't go to server
-
- Closed
-