<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:11:06 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>[SERVER-46308] Investigate dependency between commit point (lastCommitted) and cluster time</title>
                <link>https://jira.mongodb.org/browse/SERVER-46308</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/0d28657a844a06618041352cef7a125de3e1fd50/src/mongo/db/service_entry_point_common.cpp#L368-L373&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;computeOperationTime&lt;/tt&gt; &lt;/a&gt;returns the replication &lt;tt&gt;lastCommittedOpTime&lt;/tt&gt; for majority reads or the &lt;tt&gt;lastAppliedOpTime&lt;/tt&gt; otherwise. And we have &lt;a href=&quot;https://github.com/mongodb/mongo/blob/0d28657a844a06618041352cef7a125de3e1fd50/src/mongo/db/service_entry_point_common.cpp#L402&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this &lt;tt&gt;dassert&lt;/tt&gt;&lt;/a&gt; that makes sure that neither of them should be beyond the cluster time.&lt;/p&gt;

&lt;p&gt;We have a &lt;a href=&quot;https://github.com/mongodb/mongo/blob/0abcb05ffcf0f6fa0ea71923f6f81b285e0378d7/src/mongo/db/repl/replication_coordinator_impl.cpp#L1268-L1271&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;dassert&lt;/tt&gt; in &lt;tt&gt;ReplicationCoordinatorImpl::_setMyLastAppliedOpTimeAndWallTime&lt;/tt&gt;&lt;/a&gt; to assert that the &lt;tt&gt;lastAppliedOpTime&lt;/tt&gt; should never advance beyond the cluster time. However, we do not have a corresponding &lt;tt&gt;dassert&lt;/tt&gt; for the &lt;tt&gt;lastCommittedOpTime&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;Normally, for internal communications between replset members, we have the &lt;tt&gt;LogicalTimeMetadataHook&lt;/tt&gt; to parse cluster time metadata and advance the cluster time on receiving a network message. For example, when a node receives a heartbeat response, it parses the cluster time metadata as part of the network interface hooks before handing it off to repl to process the heartbeat response. And when the node processes the heartbeat, &lt;a href=&quot;https://github.com/mongodb/mongo/blob/0d28657a844a06618041352cef7a125de3e1fd50/src/mongo/db/repl/replication_coordinator_impl_heartbeat.cpp#L188-L190&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;it could advance the commit point on hearing a more recent commit point&lt;/a&gt;. So the assumption that the commit point is never ahead of the cluster time is normally correct because we parse the cluster time metadata first.&lt;/p&gt;

&lt;p&gt;However, if a heartbeat response comes from an arbiter, it could contain a more recent commit point without cluster time metadata, simply because logical clock is disabled for arbiters. So theoretically, the following could happen:&lt;br/&gt;
1. secondary&apos;s current knowledge of the cluster time is 90&lt;br/&gt;
2. secondary receives a heartbeat response without cluster time metadata from an arbiter that has a commit point 100&lt;br/&gt;
3. secondary processes the heartbeat and advances its commit point (lastCommitted) to 100.&lt;br/&gt;
4. A majority read on the secondary returns operation time 100 from computeOperationTime&lt;br/&gt;
5. dassert is hit because the secondary&apos;s logical clock is 90, being &amp;lt; the operation time.&lt;/p&gt;

&lt;p&gt;The fact that &lt;tt&gt;computeOperationTime&lt;/tt&gt; returns lastCommitted for majority reads seems weird. Because for majority reads, they dont actually read at lastCommitted but the committed snapshot. And repl guarantees that the committed snapshot is never ahead of the lastApplied, (whereas lastCommitted could). So I think it is more correct for &lt;tt&gt;computeOperationTime&lt;/tt&gt; to return the committed snapshot for majority reads.&lt;/p&gt;

&lt;p&gt;This ticket should investigate whether what mentioned above could actually happen with arbiters. No matter which time we decide &lt;tt&gt;computeOperationTime&lt;/tt&gt; should return for majority reads, we should add a corresponding dassert in repl like we did for the lastApplied to enforce that assumption. And we should have a targeted test for it.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1170097">SERVER-46308</key>
            <summary>Investigate dependency between commit point (lastCommitted) and cluster time</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="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="13201">Fixed</resolution>
                                        <assignee username="randolph@mongodb.com">Randolph Tan</assignee>
                                    <reporter username="lingzhi.deng@mongodb.com">Lingzhi Deng</reporter>
                        <labels>
                            <label>sharding-wfbf-day</label>
                    </labels>
                <created>Fri, 21 Feb 2020 19:55:12 +0000</created>
                <updated>Sun, 29 Oct 2023 22:11:55 +0000</updated>
                            <resolved>Mon, 4 Oct 2021 19:32:53 +0000</resolved>
                                                    <fixVersion>5.1.0-rc0</fixVersion>
                                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>7</watches>
                                                                                                                <comments>
                            <comment id="4107983" author="JIRAUSER1259052" created="Wed, 6 Oct 2021 18:53:27 +0000"  >&lt;p&gt;Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it&#8217;s been triggered. For more active release information, please keep an eye on #server-release. Thank you!&lt;/p&gt;</comment>
                            <comment id="4100527" author="xgen-internal-githook" created="Mon, 4 Oct 2021 19:12:57 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Randolph Tan&apos;, &apos;email&apos;: &apos;randolph@10gen.com&apos;, &apos;username&apos;: &apos;renctan&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-46308&quot; title=&quot;Investigate dependency between commit point (lastCommitted) and cluster time&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-46308&quot;&gt;&lt;del&gt;SERVER-46308&lt;/del&gt;&lt;/a&gt; Use current committed snapshot time instead of last comm&#8230;&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/e80a562c2135ad6e0b79f41efb993e3485052ac0&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/e80a562c2135ad6e0b79f41efb993e3485052ac0&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4095459" author="renctan" created="Thu, 30 Sep 2021 21:35:25 +0000"  >&lt;p&gt;Attached test.js demonstrating the scenario as described.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="561024">SERVER-35663</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="338204" name="test.js" size="1997" author="randolph@mongodb.com" created="Thu, 30 Sep 2021 21:44:40 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>26.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 30 Sep 2021 21:35:25 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        2 years, 18 weeks ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_17050" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Downstream Team Attention</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16941"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>luke.bonanomi@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            2 years, 18 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>lingzhi.deng@mongodb.com</customfieldvalue>
            <customfieldvalue>randolph@mongodb.com</customfieldvalue>
            <customfieldvalue>vivian.ge@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hwspgv:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hyctdz:</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>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="3837">Sharding 2020-04-20</customfieldvalue>
    <customfieldvalue id="3841">Sharding 2020-05-04</customfieldvalue>
    <customfieldvalue id="3842">Sharding 2020-05-18</customfieldvalue>
    <customfieldvalue id="3954">Sharding 2020-07-13</customfieldvalue>
    <customfieldvalue id="3955">Sharding 2020-06-01</customfieldvalue>
    <customfieldvalue id="3956">Sharding 2020-06-15</customfieldvalue>
    <customfieldvalue id="3957">Sharding 2020-06-29</customfieldvalue>
    <customfieldvalue id="4135">Sharding 2020-07-27</customfieldvalue>
    <customfieldvalue id="4136">Sharding 2020-08-10</customfieldvalue>
    <customfieldvalue id="4137">Sharding 2020-08-24</customfieldvalue>
    <customfieldvalue id="4252">Sharding 2020-09-21</customfieldvalue>
    <customfieldvalue id="4253">Sharding 2020-10-05</customfieldvalue>
    <customfieldvalue id="4254">Sharding 2020-10-19</customfieldvalue>
    <customfieldvalue id="4255">Sharding 2020-11-02</customfieldvalue>
    <customfieldvalue id="4256">Sharding 2020-11-16</customfieldvalue>
    <customfieldvalue id="4257">Sharding 2020-11-30</customfieldvalue>
    <customfieldvalue id="4258">Sharding 2020-12-14</customfieldvalue>
    <customfieldvalue id="4259">Sharding 2020-12-28</customfieldvalue>
    <customfieldvalue id="4482">Sharding 2021-01-11</customfieldvalue>
    <customfieldvalue id="4483">Sharding 2021-01-25</customfieldvalue>
    <customfieldvalue id="4485">Sharding 2021-02-22</customfieldvalue>
    <customfieldvalue id="4486">Sharding 2021-03-08</customfieldvalue>
    <customfieldvalue id="4487">Sharding 2021-03-22</customfieldvalue>
    <customfieldvalue id="4497">Sharding 2021-04-05</customfieldvalue>
    <customfieldvalue id="4515">Sharding 2021-04-19</customfieldvalue>
    <customfieldvalue id="4516">Sharding 2021-05-03</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hwsbq7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>