[GODRIVER-735] ListCollections does not use read preference primary Created: 21/Dec/18 Updated: 28/Oct/23 Resolved: 05/Jan/19 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | Command & Dispatch |
| Affects Version/s: | 0.1.0 |
| Fix Version/s: | 0.2.0 |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | David Golden | Assignee: | Divjot Arora (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
The ListCollections database method passes through the database's read selector instead of constructing a new read selector for read preference primary. (Compare to how ListDatabases does it.) Because the constructed command adds read preference primary (despite possibly selecting a non-primary server), ListCollections run on a database with secondary read preference will fail with an error: "(NotMasterNoSlaveOk) not master and slaveOk=false". |
| Comments |
| Comment by Githook User [ 05/Jan/19 ] |
|
Author: {'username': 'divjotarora', 'email': 'divjot.arora@10gen.com', 'name': 'Divjot Arora'}Message: Change ListCollections, ListIndexes, and ListDatabases to use CompositeSelector. Change-Id: Ic9627f5faa8249a860620642989dc2d292d97cd8 |
| Comment by Jeffrey Yemin [ 27/Dec/18 ] |
|
Note: it should construct a CompositeSelector, as RunCommand does, to include the LatencySelector. This is actually a bug in ListDatabases as well, since it also doesn't include the LatencySelector. |