<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:00:16 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-64408] VectorClock&apos;s topology time may be wrongly advanced in case of rollback</title>
                <link>https://jira.mongodb.org/browse/SERVER-64408</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;The CSRS is registering a topology time tick point (timestamp &lt;b&gt;X&lt;/b&gt;)when observing local &lt;a href=&quot;https://github.com/mongodb/mongo/blob/791ee094eda098c4c369258838994961cbe799d4/src/mongo/db/s/config_server_op_observer.cpp#L130&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;inserts&lt;/a&gt; and &lt;a href=&quot;https://github.com/mongodb/mongo/blob/791ee094eda098c4c369258838994961cbe799d4/src/mongo/db/s/config_server_op_observer.cpp#L198&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;applyOps&lt;/a&gt; modifying &lt;tt&gt;config.shards&lt;/tt&gt;. On &lt;a href=&quot;https://github.com/mongodb/mongo/blob/791ee094eda098c4c369258838994961cbe799d4/src/mongo/db/s/config_server_op_observer.cpp#L255&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;majority commit&lt;/a&gt;, if the timestamp of the majority committed oplog entry is &lt;a href=&quot;https://github.com/mongodb/mongo/blob/791ee094eda098c4c369258838994961cbe799d4/src/mongo/db/s/config_server_op_observer.cpp#L231&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;greater or equal&lt;/a&gt; than &lt;b&gt;X&lt;/b&gt;, the topology time is then &lt;a href=&quot;https://github.com/mongodb/mongo/blob/791ee094eda098c4c369258838994961cbe799d4/src/mongo/db/s/config_server_op_observer.cpp#L243&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;advanced&lt;/a&gt; to &lt;b&gt;X&lt;/b&gt;.&lt;/p&gt;

&lt;p&gt;The current implementation does not take into account rollbacks and may end up bumping wrongly the topology time. Example:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;A shard entry is added to &lt;tt&gt;config.shards&lt;/tt&gt; at time &lt;b&gt;T&lt;/b&gt;&lt;/li&gt;
	&lt;li&gt;A tick point is registered with timestamp &lt;b&gt;T&lt;/b&gt;&lt;/li&gt;
	&lt;li&gt;Rollback happens, oplog gets truncated to the operation registered at &lt;b&gt;T-2&lt;/b&gt;&lt;/li&gt;
	&lt;li&gt;A new CSRS primary steps up, the shard is added at time &lt;b&gt;T-1&lt;/b&gt; and then any write happens at time &lt;b&gt;T&lt;/b&gt;&lt;/li&gt;
	&lt;li&gt;On majority commit, the old primary ticks the topology time to &lt;b&gt;T&lt;/b&gt; instead of &lt;b&gt;T-1&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
        <key id="1998554">SERVER-64408</key>
            <summary>VectorClock&apos;s topology time may be wrongly advanced in case of rollback</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="3">Duplicate</resolution>
                                        <assignee username="sergi.mateo-bellido@mongodb.com">Sergi Mateo Bellido</assignee>
                                    <reporter username="pierlauro.sciarelli@mongodb.com">Pierlauro Sciarelli</reporter>
                        <labels>
                    </labels>
                <created>Thu, 10 Mar 2022 14:41:34 +0000</created>
                <updated>Thu, 12 May 2022 05:22:24 +0000</updated>
                            <resolved>Thu, 12 May 2022 05:22:24 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="4543891" author="JIRAUSER1256927" created="Thu, 12 May 2022 05:21:51 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-64433&quot; title=&quot;A new topology time could be gossiped without being majority committed&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-64433&quot;&gt;&lt;del&gt;SERVER-64433&lt;/del&gt;&lt;/a&gt; fixes this problem and a few other more, closing this ticket.&lt;/p&gt;</comment>
                            <comment id="4403546" author="pierlauro.sciarelli" created="Thu, 10 Mar 2022 14:51:15 +0000"  >&lt;p&gt;Considering that add/remove shard are not happening so often, a possible solution would be to not locally commit &lt;a href=&quot;https://github.com/mongodb/mongo/blob/791ee094eda098c4c369258838994961cbe799d4/src/mongo/db/s/config/sharding_catalog_manager_shard_operations.cpp#L730&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;addShard&lt;/a&gt; and &lt;a href=&quot;https://github.com/mongodb/mongo/blob/791ee094eda098c4c369258838994961cbe799d4/src/mongo/db/s/config/sharding_catalog_manager_shard_operations.cpp#L825&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;removeShard&lt;/a&gt; operations. Instead, we could synchronously wait for majority and then advance the topology time with the newly committed timestamp.&lt;/p&gt;

&lt;p&gt;This solution works also in case an improbale shutdown happens exactly after majority committing the entry and before advancing the topology time, because on step-up the new primary CSRS node will &lt;a href=&quot;https://github.com/mongodb/mongo/blob/791ee094eda098c4c369258838994961cbe799d4/src/mongo/db/vector_clock_mongod.cpp#L190-L209&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;recover&lt;/a&gt; the correct topology time from disk.&lt;/p&gt;

&lt;p&gt;It would be great to throw away the unnecessarily complex ticking semantics.&lt;/p&gt;

&lt;p&gt;CC &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=sergi.mateo-bellido&quot; class=&quot;user-hover&quot; rel=&quot;sergi.mateo-bellido&quot;&gt;sergi.mateo-bellido&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10420">
                    <name>Backports</name>
                                            <outwardlinks description="backported by">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                        <issuelink>
            <issuekey id="1999415">SERVER-64433</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1999415">SERVER-64433</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="2009033">SERVER-64931</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="23470"><![CDATA[v6.0]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 12 May 2022 05:21:51 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        1 year, 39 weeks ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[<s><a href='https://jira.mongodb.org/browse/SERVER-64433'>SERVER-64433</a></s>]]></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_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>sergi.mateo-bellido@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            1 year, 39 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>pierlauro.sciarelli@mongodb.com</customfieldvalue>
            <customfieldvalue>sergi.mateo-bellido@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i0mqiv:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i05rx8:</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="5817">Sharding EMEA 2022-04-04</customfieldvalue>
    <customfieldvalue id="5818">Sharding EMEA 2022-04-18</customfieldvalue>
    <customfieldvalue id="6073">Sharding EMEA 2022-05-02</customfieldvalue>
    <customfieldvalue id="6074">Sharding EMEA 2022-05-16</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|i0mco7:</customfieldvalue>

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