Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-2478

Create implicit sessions with "causalConsistency=false"

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Hide

      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?

      Show
      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?

      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.

            Assignee:
            Unassigned Unassigned
            Reporter:
            matt.dale@mongodb.com Matt Dale
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: