<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:25:24 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[DRIVERS-2369] Disable causal consistency in implicit sessions</title>
                <link>https://jira.mongodb.org/browse/DRIVERS-2369</link>
                <project id="10980" key="DRIVERS">Drivers</project>
                    <description>&lt;div class=&quot;panel&quot; style=&quot;background-color: #fafbfc;border-width: 1px;&quot;&gt;&lt;div class=&quot;panelContent&quot; style=&quot;background-color: #fafbfc;&quot;&gt;
&lt;h3&gt;&lt;a name=&quot;DriversChanges&quot;&gt;&lt;/a&gt;&lt;b&gt;Drivers Changes&lt;/b&gt;&lt;/h3&gt;
&lt;p&gt;Drivers should sync the new unified sessions tests in &lt;a href=&quot;https://github.com/mongodb/specifications/commit/5a15b65d6743a41ab2cb9270ba4c66dfda36bd7c&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;mongodb/specifications@5a15b65&lt;/a&gt;. Drivers that enable `causalConsistency` in &lt;b&gt;implicit&lt;/b&gt; sessions by default will require code changes. Note that `causalConsistency` must continue to be enabled by default in &lt;b&gt;explicit&lt;/b&gt; sessions.&lt;/p&gt;

&lt;h3&gt;&lt;a name=&quot;Summary&quot;&gt;&lt;/a&gt;&lt;b&gt;Summary&lt;/b&gt;&lt;/h3&gt;

&lt;p&gt;Read concerns &quot;linearizable&quot; and &quot;available&quot; cannot be used in causally consistent sessions (see documentation &lt;a href=&quot;https://www.mongodb.com/docs/v6.0/reference/read-concern-linearizable/#causally-consistent-sessions&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;; see server code &lt;a href=&quot;https://github.com/mongodb/mongo/blob/fdf1e87a30e8c879080839573700ceed42ab1db4/src/mongo/db/repl/read_concern_args.cpp#L234-L246&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;). However, the Causal Consistency spec &lt;a href=&quot;https://github.com/mongodb/specifications/blob/68d1095ef710ba294894474f7b8f3297c21b86f6/source/causal-consistency/causal-consistency.rst#causalconsistency&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;says&lt;/a&gt; that causal consistency should be enabled in sessions by default unless &lt;tt&gt;snapshot=true&lt;/tt&gt;. Enabling causal consistency in implicit sessions can cause server errors when a user sets read concern &quot;linearizable&quot; or &quot;available&quot;.&lt;/p&gt;

&lt;p&gt;A specific case where this causes a problem is with retryable reads because they reuse the same session and set an &quot;operation time&quot;. As a result, a retried read will send a read concern document that includes &lt;tt&gt;afterClusterTime&lt;/tt&gt;. If a user has also set the read concern to &quot;linearizable&quot; or &quot;available&quot;, that retried read will fail with error &lt;tt&gt;InvalidOptions(72)&lt;/tt&gt; with message:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;afterClusterTime field can be set only if level is equal to majority, local, or snapshot&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Update the &lt;a href=&quot;https://github.com/mongodb/specifications/blob/68d1095ef710ba294894474f7b8f3297c21b86f6/source/causal-consistency/causal-consistency.rst&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Causal Consistency&lt;/a&gt; spec to prevent read operations that use implicit sessions from sending a read concern document with field &lt;tt&gt;afterClusterTime&lt;/tt&gt; when field &lt;tt&gt;level&lt;/tt&gt; is not &quot;majority&quot;, &quot;local&quot;, or &quot;snapshot&quot;. We can accomplish that by either requiring that drivers set &lt;tt&gt;causalConsistency=false&lt;/tt&gt; for all implicit sessions or for implicit sessions where the read concern is not &quot;majority&quot;, &quot;local&quot;, or &quot;snapshot&quot;.&lt;/p&gt;

&lt;p&gt;Open questions:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Does sending &lt;tt&gt;readConcern.afterClusterTime&lt;/tt&gt; with a retried read make the read result more correct? If so, should we still require that drivers create implicit sessions with &lt;tt&gt;causalConsistency=true&lt;/tt&gt; only if the read concern is &quot;majority&quot;, &quot;local&quot;, or &quot;snapshot&quot;?&lt;/li&gt;
	&lt;li&gt;Does using implicit sessions with &lt;tt&gt;causalConsistency=true&lt;/tt&gt; for writes have any effect (positive or negative) on retryable writes?&lt;/li&gt;
&lt;/ol&gt;


&lt;h4&gt;&lt;a name=&quot;Examplereprosteps&quot;&gt;&lt;/a&gt;Example repro steps&lt;/h4&gt;
&lt;ol&gt;
	&lt;li&gt;Create a Client that uses read concern &quot;linearizable&quot;.&lt;/li&gt;
	&lt;li&gt;Set a failpoint that returns error code &lt;tt&gt;ShutdownInProgress(91)&lt;/tt&gt; for a &quot;find&quot; operation one time.&lt;/li&gt;
	&lt;li&gt;Run a &quot;find&quot; operation on a collection.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;We expect that the &quot;find&quot; operation to be retried once and then successfully return results. What actually happens is the server responds the first time with the failpoint error &lt;tt&gt;ShutdownInProgress(91)&lt;/tt&gt;, then when the &quot;find&quot; is retried the server responds with error &lt;tt&gt;InvalidOptions(72)&lt;/tt&gt; with message:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;afterClusterTime field can be set only if level is equal to majority, local, or snapshot&lt;/p&gt;&lt;/blockquote&gt;
&lt;h4&gt;&lt;a name=&quot;Additionalreferencestocausalconsistencythatmayrequireupdating&quot;&gt;&lt;/a&gt;Additional references to causal consistency that may require updating&lt;/h4&gt;

&lt;p&gt;The Retryable Reads specification mentions in question &lt;a href=&quot;https://github.com/mongodb/specifications/blob/68d1095ef710ba294894474f7b8f3297c21b86f6/source/retryable-reads/retryable-reads.rst#can-drivers-resend-the-same-wire-protocol-message-on-retry-attempts&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Can drivers resend the same wire protocol message on retry attempts?&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;2. If the initial attempt failed with a server error, then the session&apos;s &lt;tt&gt;operationTime&lt;/tt&gt; would be advanced and the next read would include a larger &lt;tt&gt;readConcern.afterClusterTime&lt;/tt&gt;.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;If we chose to disable causal consistency in implicit sessions, retried reads will not send &lt;tt&gt;readConcern.afterClusterTime&lt;/tt&gt;. We should update that answer section to describe the updated behavior.&lt;/p&gt;
&lt;h3&gt;&lt;a name=&quot;Motivation&quot;&gt;&lt;/a&gt;&lt;b&gt;Motivation&lt;/b&gt;&lt;/h3&gt;
&lt;h4&gt;&lt;a name=&quot;Whoistheaffectedenduser%3F&quot;&gt;&lt;/a&gt;Who is the affected end user?&lt;/h4&gt;

&lt;p&gt;Users who set read concern &quot;linearizable&quot; or &quot;available&quot; and leave retryable reads enabled (enabled by default).&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;Howdoesthisaffecttheenduser%3F&quot;&gt;&lt;/a&gt;How does this affect the end user?&lt;/h4&gt;

&lt;p&gt;Retried read operations will fail with server error &lt;tt&gt;InvalidOptions(72)&lt;/tt&gt; with message:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;afterClusterTime field can be set only if level is equal to majority, local, or snapshot&lt;/p&gt;&lt;/blockquote&gt;
&lt;h4&gt;&lt;a name=&quot;Howlikelyisitthatthisproblemorusecasewilloccur%3F&quot;&gt;&lt;/a&gt;How likely is it that this problem or use case will occur?&lt;/h4&gt;

&lt;p&gt;If a user sets read concern &quot;linearizable&quot; or &quot;available&quot; and doesn&apos;t explicitly disable retryable reads, any retried read will return an error.&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;Iftheproblemdoesoccur%2Cwhataretheconsequencesandhowseverearethey%3F&quot;&gt;&lt;/a&gt;If the problem does occur, what are the consequences and how severe are they?&lt;/h4&gt;

&lt;p&gt;Retried read operations that may have succeeded will always return an error instead of a result. In affected drivers, retryable reads do not work with read concern &quot;linearizable&quot; or &quot;available&quot;.&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;Isthisissueurgent%3F&quot;&gt;&lt;/a&gt;Is this issue urgent?&lt;/h4&gt;

&lt;p&gt;This bug affects at least the Go driver and could affect other drivers as well. The Java driver sets &lt;tt&gt;causalConsistency=false&lt;/tt&gt; for all implicit sessions and is not affected.&lt;/p&gt;

&lt;p&gt;The bug in the Go driver affects the &lt;tt&gt;mongosync&lt;/tt&gt; project and is moderately urgent. The team maintaining &lt;tt&gt;mongosync&lt;/tt&gt; does have a workaround, which is to use explicit sessions for all operations that need to use read concern &quot;linearizable&quot; or &quot;available&quot; and set &lt;tt&gt;causalConsistency=false&lt;/tt&gt; on the session.&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;Isthisticketrequiredbyadownstreamteam%3F&quot;&gt;&lt;/a&gt;Is this ticket required by a downstream team?&lt;/h4&gt;

&lt;p&gt;No.&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;Isthisticketonlyfortests%3F&quot;&gt;&lt;/a&gt;Is this ticket only for tests?&lt;/h4&gt;

&lt;p&gt;No.&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
        <key id="2076451">DRIVERS-2369</key>
            <summary>Disable causal consistency in implicit sessions</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="13453" iconUrl="https://jira.mongodb.org/images/icons/status_generic.gif" description="">Implementing</status>
                    <statusCategory id="4" key="indeterminate" colorName="inprogress"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="daria.pardue@mongodb.com">Daria Pardue</assignee>
                                    <reporter username="matt.dale@mongodb.com">Matt Dale</reporter>
                        <labels>
                    </labels>
                <created>Fri, 24 Jun 2022 19:37:53 +0000</created>
                <updated>Thu, 16 Feb 2023 21:57:53 +0000</updated>
                                                                <component>Causal Consistency</component>
                    <component>Retryability</component>
                    <component>Sessions</component>
                                        <votes>0</votes>
                                    <watches>7</watches>
                                                                                                                <comments>
                            <comment id="5104696" author="xgen-internal-githook" created="Tue, 10 Jan 2023 23:49:51 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Julius Park&apos;, &apos;email&apos;: &apos;Juliusgeo@gmail.com&apos;, &apos;username&apos;: &apos;juliusgeo&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/DRIVERS-2369&quot; title=&quot;Disable causal consistency in implicit sessions&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DRIVERS-2369&quot;&gt;DRIVERS-2369&lt;/a&gt; Disable causal consistency in implicit sessions (#1132)&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-python-driver/commit/eaea70bf08189d567838b3408bdc9fd5ae7cecf6&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-python-driver/commit/eaea70bf08189d567838b3408bdc9fd5ae7cecf6&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4983549" author="xgen-internal-githook" created="Tue, 15 Nov 2022 15:30:45 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Daria Pardue&apos;, &apos;email&apos;: &apos;daria.pardue@mongodb.com&apos;, &apos;username&apos;: &apos;dariakp&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/DRIVERS-2369&quot; title=&quot;Disable causal consistency in implicit sessions&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DRIVERS-2369&quot;&gt;DRIVERS-2369&lt;/a&gt; Default causal consistency should be false in implicit sessions (#1345)&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/specifications/commit/5a15b65d6743a41ab2cb9270ba4c66dfda36bd7c&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/specifications/commit/5a15b65d6743a41ab2cb9270ba4c66dfda36bd7c&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4671078" author="JIRAUSER1263031" created="Mon, 11 Jul 2022 16:37:06 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=shane.harvey%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;shane.harvey@mongodb.com&quot;&gt;shane.harvey@mongodb.com&lt;/a&gt; can you assist Daria and review this bug.&#160; Thanks.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10620">
                    <name>Issue split</name>
                                            <outwardlinks description="split to">
                                        <issuelink>
            <issuekey id="2094668">PHPLIB-915</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2094660">CDRIVER-4431</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2094662">CSHARP-4262</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2094661">CXX-2548</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2094663">GODRIVER-2497</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2094666">MOTOR-997</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2094665">NODE-4447</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2094667">PYTHON-3360</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2094669">RUBY-3058</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2094670">RUST-1414</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2094664">JAVA-4681</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="2079154">GODRIVER-2478</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                            <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_17052" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Downstream Changes Summary</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;Drivers should sync the new unified sessions tests in &lt;a href=&quot;https://github.com/mongodb/specifications/commit/5a15b65d6743a41ab2cb9270ba4c66dfda36bd7c&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;mongodb/specifications@5a15b65&lt;/a&gt;. Drivers that enable `causalConsistency` in &lt;b&gt;implicit&lt;/b&gt; sessions by default will require code changes. Note that `causalConsistency` must continue to be enabled by default in &lt;b&gt;explicit&lt;/b&gt; sessions.&lt;/p&gt;</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10951" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Driver Changes</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10748"><![CDATA[Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_23952" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Driver Compliance</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[<style type='text/css'>
         #scriptField, #scriptField *{
                border: 1px solid black;
            }

            #scriptField{
                border-collapse: collapse;
            }

            #scriptField td {
                text-align: center; /* Center-align text in table cells */
            }

            #scriptField td.key {
                text-align: left; /* Left-align text in the Key column */
            }

            #scriptField a {
                text-decoration: none; /* Remove underlines from links */
                border: none; /* Remove border from links */
            }
            
            /* Add green background color to cells with FixVersion */
            #scriptField td.hasFixVersion {
                background-color: #00FF00; /* Green color code */
            }

            /* Center-align the first row headers */
            #scriptField th {
                text-align: center;
            }
        </style>
<table id='scriptField'>
  <tr>
    <th>Key</th>
    <th>Status/Resolution</th>
    <th>FixVersion</th>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/CDRIVER-4431'>CDRIVER-4431</a>
    </td>
    <td>Fixed</td>
    <td class='hasFixVersion'>1.24.0</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/CXX-2548'>CXX-2548</a>
    </td>
    <td>Fixed</td>
    <td class='hasFixVersion'>3.8.0</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/CSHARP-4262'>CSHARP-4262</a>
    </td>
    <td>Done</td>
    <td class='hasFixVersion'>2.19.0</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/GODRIVER-2497'>GODRIVER-2497</a>
    </td>
    <td>Fixed</td>
    <td class='hasFixVersion'>1.11.2</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/JAVA-4681'>JAVA-4681</a>
    </td>
    <td>Fixed</td>
    <td class='hasFixVersion'>4.9.0</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/NODE-4447'>NODE-4447</a>
    </td>
    <td>Fixed</td>
    <td class='hasFixVersion'>4.13.0</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/MOTOR-997'>MOTOR-997</a>
    </td>
    <td>Duplicate</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/PYTHON-3360'>PYTHON-3360</a>
    </td>
    <td>Done</td>
    <td class='hasFixVersion'>4.4</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/PHPLIB-915'>PHPLIB-915</a>
    </td>
    <td>Backlog</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/RUBY-3058'>RUBY-3058</a>
    </td>
    <td>Fixed</td>
    <td class='hasFixVersion'>2.19.0</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/RUST-1414'>RUST-1414</a>
    </td>
    <td>Fixed</td>
    <td class='hasFixVersion'>2.8.0</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/SWIFT-1605'>SWIFT-1605</a>
    </td>
    <td>Won't Do</td>
    <td class=''></td>
  </tr>
</table>]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_21553" key="com.atlassian.jira.plugin.system.customfieldtypes:labels">
                        <customfieldname>Quarter</customfieldname>
                        <customfieldvalues>
                                        <label>FY23Q3</label>
    
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr1kbq:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        </customfields>
    </item>
</channel>
</rss>