[CDRIVER-4110] Session causalConsistency option should not default to true if snapshot is true Created: 29/Jul/21 Updated: 28/Oct/23 Resolved: 04/Aug/21 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | libmongoc |
| Affects Version/s: | None |
| Fix Version/s: | 1.19.0 |
| Type: | Bug | Priority: | Unknown |
| Reporter: | Jeremy Mikola | Assignee: | Jeremy Mikola |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Epic Link: | Snapshot reads on Secondaries | ||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||
| Description |
|
Note: no such test exists because it would require expecting a failure when constructing the session entity (before any test operations are run). This could only be done through a valid-fail test in the unified test format spec, which currently isn't use for testing other specifications. In this case, the conflict between both session options is covered by a prose test. Having said that, the Causal Consistency spec was changed as part of Snapshot Sessions to not default to true if snapshot was explicitly set to true. Fixing this should entail changes to the session options API and entail reverting the above work-around in the test runner. |
| Comments |
| Comment by Jeremy Mikola [ 04/Aug/21 ] |
|
I don't believe there is any BC concern here as there is no behavioral change without using the new snapshot option – and even then, this fix just ensures that users don't inadvertently get a client-side error when only specifying snapshot=true. |
| Comment by Githook User [ 04/Aug/21 ] |
|
Author: {'name': 'Jeremy Mikola', 'email': 'jmikola@gmail.com', 'username': 'jmikola'}Message:
This was originally added in d5f73e18eac7acaa05f31c4ffde68c9cd565704a
This prose test is defined in the sessions spec, not transactions. It also does not require the server to support transactions.
Use mongoc_optional_t for causal_consistency and snapshot session opts to track whether or not values have been set. This also removes explicitly setting causal_consistency to true in _mongoc_client_session_new, since mongoc_session_opts_get_causal_consistency now enforces the default value. |
| Comment by Jeremy Mikola [ 30/Jul/21 ] |