[GODRIVER-2478] Create implicit sessions with "causalConsistency=false" Created: 28/Jun/22  Updated: 08/Feb/23  Resolved: 08/Feb/23

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Unknown
Reporter: Matt Dale Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Duplicate
duplicates GODRIVER-2497 Disable causal consistency in implici... Closed
Related
related to GODRIVER-2497 Disable causal consistency in implici... Closed
is related to DRIVERS-2369 Disable causal consistency in implici... Implementing
Documentation Changes Summary:

1. What would you like to communicate to the user about this feature?
2. Would you like the user to see examples of the syntax and/or executable code and its output?
3. Which versions of the driver/connector does this apply to?


 Description   

Read concerns "linearizable" and "available" cannot be used in causally consistent sessions (see documentation here; see server code here). However, the Causal Consistency spec says that causal consistency should be enabled in sessions by default unless snapshot=true. Enabling causal consistency in implicit sessions can cause server errors when a user sets read concern "linearizable" or "available".

A specific case where this causes a problem is with retryable reads because they reuse the same session and set an "operation time". As a result, a retried read will send a read concern document that includes afterClusterTime. If a user has also set the read concern to "linearizable" or "available", that retried read will fail with error InvalidOptions(72) with message:

afterClusterTime field can be set only if level is equal to majority, local, or snapshot 

Update the Go driver to always set causalConsistency=false for implicit sessions to prevent sending afterClusterTime.

Note that the Causal Consistency spec isn't clear on whether implicit sessions should have causal consistency disabled and under what circumstances. DRIVERS-2369 is a ticket to clarify the behavior of implicit sessions in the Causal Consistency spec. The implementer of this ticket should check for updates on DRIVERS-2369 and for any related Causal Consistency spec changes. For now we chose to follow the implementation of the Java driver that always disables causal consistency in implicit sessions.



 Comments   
Comment by Matt Dale [ 08/Feb/23 ]

Closing as a duplicate of GODRIVER-2497.

Generated at Thu Feb 08 08:38:43 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.