[SERVER-3816] unexpected error messsage setting slaveOk when connected to secondary Created: 12/Sep/11 Updated: 29/Feb/12 Resolved: 01/Feb/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication, Shell |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Chris Westin | Assignee: | Randolph Tan |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Operating System: | ALL | ||||||||
| Participants: | |||||||||
| 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 But if you don't, you get this: MongoDB shell version: 2.1.0-pre- SECONDARY> rs.slaveOk(); Note the extra "not master and slaveok=false" that comes out after the rs.slaveOk(). |
| Comments |
| Comment by Randolph Tan [ 01/Feb/12 ] |
|
This bug is not reproducible in master but reproducible in stable release v2.0.2 The bug is caused by the shellPrintHelper calling getLastError and printing the message whenever undefined is passed to it. So this bug can actually be reproduced by simply typing undefined in the terminal right after the find() error. dup of |
| Comment by Eliot Horowitz (Inactive) [ 31/Jan/12 ] |
|
If rs.slaveOk() returned "OK" it would not print this. |