[SERVER-170] Can the default behavior for replica pairs allow slaves to run queries? Created: 20/Jul/09  Updated: 12/Jul/16  Resolved: 17/Aug/09

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 0.9.6
Fix Version/s: 0.9.9

Type: Question Priority: Major - P3
Reporter: Mitch Pirtle Assignee: Dwight Merriman
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

Right now when you fire up a replica pair for the first time, all actions on the slave will get the following error:

error:

{"$err" : "not master"}

This requires you to manually run:

db.getMongo().setSlaveOk()

Seems a bit strange to not allow this by default, as it renders a pair somewhat useless out of the box. Or is there a legitimate reason to disallow that by default?



 Comments   
Comment by Eliot Horowitz (Inactive) [ 10/Sep/09 ]

closed b/c resolved more than 2 week ago

Comment by Dwight Merriman [ 17/Aug/09 ]

a6cd2c479430f044bd05bb4dffc11f2be9a400a0

2 commits ยป

  • dwight committed a6cd2c47:

fix compile of unit tests

  • dwight committed 4120dfc5:

fix checks that operations cannot be performed on slaves; also, allow read operations on

Comment by Dwight Merriman [ 17/Aug/09 ]

it is by design that one cannot query the slave of a replica pair. this is because it is not realtime consistent. by declearing setSlaveOk(), one is saying "i am ok with it being eventually consistent".

code was changed though s.t. slaveok is no longer required for regular slaves though.

Generated at Thu Feb 08 02:53:16 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.