<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:40:30 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-56908] Changing at which time the ComparableChunkVersion object is created on lookupCollection to avoid breaking causal consistency</title>
                <link>https://jira.mongodb.org/browse/SERVER-56908</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Let&apos;s take a look at what happens in the following scenario:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;We start a refresh. We are going to assume that this refresh is going to be able to find the metadata associated to a collection.&lt;/li&gt;
	&lt;li&gt;A drop collection is executed while the 1st refresh is running, triggering a second refresh. This refresh goes through the path of &lt;a href=&quot;https://github.com/mongodb/mongo/blob/952e709824d58eddff659c9ff31da69fa839470b/src/mongo/s/catalog_cache.cpp#L276-L282&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;getCollectionRoutingInfoWithRefresh&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Let&apos;s take a look at the following interleaving:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;1st refresh saw the collection on the config server and let&apos;s assume that it is executing something &lt;a href=&quot;https://github.com/mongodb/mongo/blob/952e709824d58eddff659c9ff31da69fa839470b/src/mongo/s/catalog_cache.cpp#L667-L669&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;before reaching this statement&lt;/a&gt;.&lt;/li&gt;
	&lt;li&gt;then, the 2nd refresh &lt;a href=&quot;https://github.com/mongodb/mongo/blob/952e709824d58eddff659c9ff31da69fa839470b/src/mongo/s/catalog_cache.cpp#L278-L279&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;advances the time in store&lt;/a&gt;, increasing the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/952e709824d58eddff659c9ff31da69fa839470b/src/mongo/s/chunk_manager.cpp#L823-L825&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;the forced refresh static atomic by two&lt;/a&gt;. However, even if the atomic was increased by two, the new time in store has a forced refresh value of +1. The idea is that all previous &lt;tt&gt;ComparableChunkVersions&lt;/tt&gt; will be older than the recently created but all posterior &lt;tt&gt;ComparableChunkVersions&lt;/tt&gt; will be newer. To simplify we will assume that the original value of the atomic was 4, after the creating the &lt;tt&gt;ComparableChunkVersion&lt;/tt&gt; is 6 and internally this new object is holding a 5.&lt;/li&gt;
	&lt;li&gt;then, 2nd refresh finds out that there is a refresh ongoing, so it adds itself to the waiter list, with &lt;tt&gt;minTimeStore = 5&lt;/tt&gt;.&lt;/li&gt;
	&lt;li&gt;then 1st refresh &lt;a href=&quot;https://github.com/mongodb/mongo/blob/952e709824d58eddff659c9ff31da69fa839470b/src/mongo/s/catalog_cache.cpp#L667-L669&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;resumes its execution&lt;/a&gt;, creating a new &lt;tt&gt;ComparableChunkVersion&lt;/tt&gt; with forced refresh value = 6. Note that this refresh didn&apos;t see the drop collection.&lt;/li&gt;
	&lt;li&gt;Finally, the 1st refresh finishes and fulfills all promises of the pending refreshes whose &lt;tt&gt;minTimeInStore&lt;/tt&gt; are older than the new Time, so we end up fulfilling the second refresh because its &lt;tt&gt;minTimeInStore=5&lt;/tt&gt; is older than the new time. Thus, the second refresh that was triggered because of the drop operation did find the old collection.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The proposed solution from &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=tommaso.tocci&quot; class=&quot;user-hover&quot; rel=&quot;tommaso.tocci&quot;&gt;tommaso.tocci&lt;/a&gt; is capturing the values of the atomics associated to the &lt;tt&gt;ComparableChunkVersion&lt;/tt&gt; before doing the query to the loader and using those values to create the new &lt;tt&gt;ComparableChunkVersion&lt;/tt&gt;.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1714396">SERVER-56908</key>
            <summary>Changing at which time the ComparableChunkVersion object is created on lookupCollection to avoid breaking causal consistency</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="13201">Fixed</resolution>
                                        <assignee username="jordi.serra-torrens@mongodb.com">Jordi Serra Torrens</assignee>
                                    <reporter username="sergi.mateo-bellido@mongodb.com">Sergi Mateo Bellido</reporter>
                        <labels>
                    </labels>
                <created>Thu, 13 May 2021 08:32:37 +0000</created>
                <updated>Sun, 29 Oct 2023 21:53:38 +0000</updated>
                            <resolved>Fri, 14 May 2021 12:41:22 +0000</resolved>
                                                    <fixVersion>5.0.0-rc0</fixVersion>
                                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="3773498" author="xgen-internal-githook" created="Fri, 14 May 2021 12:03:15 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Jordi Serra Torrens&apos;, &apos;email&apos;: &apos;jordi.serra-torrens@mongodb.com&apos;, &apos;username&apos;: &apos;jordist&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-56908&quot; title=&quot;Changing at which time the ComparableChunkVersion object is created on lookupCollection to avoid breaking causal consistency&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-56908&quot;&gt;&lt;del&gt;SERVER-56908&lt;/del&gt;&lt;/a&gt; Changing at which time the ComparableChunkVersion object is created on lookupCollection to avoid breaking causal consistency&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/bcbba91285231f258812ee37adcb692e6d2a026b&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/bcbba91285231f258812ee37adcb692e6d2a026b&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.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, 13 May 2021 15:53:45 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        2 years, 38 weeks, 5 days 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, 38 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>165.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>jordi.serra-torrens@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|hzaj2n:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hyvaif:</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="4839">Sharding EMEA 2021-05-17</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|hza5br:</customfieldvalue>

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