[CDRIVER-1353] SecondaryPreferred fails if primary matches tags but secondaries don't. Created: 03/Jul/16 Updated: 10/Aug/16 Resolved: 05/Jul/16 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | None |
| Affects Version/s: | 1.2.0 |
| Fix Version/s: | 1.4.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | A. Jesse Jiryu Davis | Assignee: | A. Jesse Jiryu Davis |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Description |
|
Server Selection logic bug. Assume a primary P and secondary S, and a read preference with mode SecondaryPreferred and a tag set. S doesn't match the tag set, so the driver should fall back to using the primary. There's a bug if P happens to match the read preference's tag set. The driver selects no servers instead of using the primary. mongoc_topology_description_suitable_servers's logic is: 1. Set has_secondary true, because there is a secondary S. The bug is near #3: has_secondary should only be true if there is an eligible secondary, rather than if there is any eligible server? Another option is to partly rewrite the C Driver's server selection based on how other clients do SecondaryPreferred: try selection with mode Secondary, if that fails then select with mode Primary. For PrimaryPreferred, vice versa. |
| Comments |
| Comment by Githook User [ 05/Jul/16 ] |
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: |