[CDRIVER-2744] _mongoc_cursor_new_with_opts() rejects primary read preference within transaction Created: 12/Jul/18 Updated: 28/Oct/23 Resolved: 17/Jul/18 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | libmongoc |
| Affects Version/s: | 1.11.0 |
| Fix Version/s: | 1.12.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jeremy Mikola | Assignee: | A. Jesse Jiryu Davis |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Description |
|
In mongodb/mongo-php-library#562, a user reported an issue executing a Collection::find() operation in PHPLIB. Because the library explicitly assigns the collection's read preference on the query, it triggered the following code path in _mongoc_cursor_new_with_opts():
The first check for a non-primary read preference is consistent with _mongoc_client_command_with_opts() and mongoc_cmd_parts_assemble(), but the second conditional only exists in this function. I don't believe it serves a purpose, as a primary read preference should be permitted at this point. Note: I realize that it's a bit redundant for PHPLIB to add a read preference to a query if we're not communicating with mongos, since we would have already done server selection by this point. That is likely be something we can refactor independently of this issue. |
| Comments |
| Comment by Githook User [ 05/Nov/18 ] |
|
Author: {'name': 'Jeremy Mikola', 'email': 'jmikola@gmail.com', 'username': 'jmikola'}Message: Regression tests for find() and aggregate() using primary RP within transaction This bumps the PHPC requirement to 1.5.2+, since that includes libmongoc 1.12 and |
| Comment by Githook User [ 17/Jul/18 ] |
|
Author: {'email': 'jesse@mongodb.com', 'name': 'A. Jesse Jiryu Davis', 'username': 'ajdavis'}Message: Supplement C tests with more YAML tests that read functions accept an |
| Comment by Githook User [ 13/Jul/18 ] |
|
Author: {'username': 'jmikola', 'name': 'Jeremy Mikola', 'email': 'jmikola@gmail.com'}Message: |
| Comment by Githook User [ 13/Jul/18 ] |
|
Author: {'username': 'jmikola', 'name': 'Jeremy Mikola', 'email': 'jmikola@gmail.com'}Message: |
| Comment by Jeremy Mikola [ 12/Jul/18 ] |
|
https://evergreen.mongodb.com/version/5b47ba080305b97579e94afd (filtered to just a few replica set variants) |
| Comment by Jeremy Mikola [ 12/Jul/18 ] |