[SERVER-22043] count helper doesn't apply read preference Created: 03/Jan/16 Updated: 21/Nov/16 Resolved: 04/Jan/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Shell |
| Affects Version/s: | 3.2.0 |
| Fix Version/s: | 3.2.6, 3.3.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Hoyt Ren | Assignee: | Adam Midvidy |
| Resolution: | Done | Votes: | 0 |
| Labels: | test-only | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Debian 7 |
||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | Linux | ||||||||
| Backport Completed: | |||||||||
| Steps To Reproduce: | mongo XXX.XXX.XXX.XXX:XXXX |
||||||||
| Participants: | |||||||||
| Description |
|
I setup a v3.2 mongos with 3 shards and 3 replica for each shard. But from shell, no matter I set readpref to 'secondary' or 'secondarypreferred', my query always go to primary. I haven't tried other api like java, etc. By the way, when I miss-spell the mode, it doesn't tell me an error. |
| Comments |
| Comment by Githook User [ 19/Apr/16 ] |
|
Author: {u'username': u'amidvidy', u'name': u'Adam Midvidy', u'email': u'amidvidy@gmail.com'}Message: (cherry picked from commit a7820c6af9c4474239f8f80c88d9de7722fa900a) |
| Comment by Githook User [ 04/Jan/16 ] |
|
Author: {u'username': u'amidvidy', u'name': u'Adam Midvidy', u'email': u'amidvidy@gmail.com'}Message: |
| Comment by Randolph Tan [ 04/Jan/16 ] |
|
Ran into this while writing tests. It looks like the problem was that the count helper was calling runCommand instead of runReadCommand: https://github.com/mongodb/mongo/blob/r3.2.0/src/mongo/shell/query.js#L357 |