[CDRIVER-3633] read pref with max_staleness_seconds may not be sent Created: 23/Apr/20 Updated: 28/Oct/23 Resolved: 04/May/20 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | libmongoc |
| Affects Version/s: | 1.4.1 |
| Fix Version/s: | 1.17.0-beta2, 1.17.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Roberto Sanchez | Assignee: | Roberto Sanchez |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
While inspecting mongoc-read-prefs.c during implementation of hedged reads, it was discovered that the C driver does not properly handle sending read preference to mongos for secondary preferred mode with a specified max_staleness_seconds. Prior to the hedged reads change, the server selection spec stated:
However, the logic in the _apply_read_preferences_mongos function was never updated for the implementation of the max_staleness_seconds option. The logic is currently:
Therefore, a read preference of mode MONGOC_READ_SECONDARY_PREFERRED with a positive integer value for max_staleness_seconds will NOT be communicated to mongos as required by the spec. However, if the read preference happens to have specified the tags parameter, then correct behavior will be observed. |
| Comments |
| Comment by Githook User [ 25/May/20 ] |
|
Author: {'name': 'Roberto C. Sánchez', 'email': 'roberto@connexer.com', 'username': 'rcsanchez97'}Message: |
| Comment by Githook User [ 04/May/20 ] |
|
Author: {'name': 'Roberto C. Sánchez', 'email': 'roberto@connexer.com', 'username': 'rcsanchez97'}Message: |