<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:32:12 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-13585] Race in dist lock after winning &quot;tournament&quot; round</title>
                <link>https://jira.mongodb.org/browse/SERVER-13585</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Setup:&lt;br/&gt;
4 threads, T0, T1, T2 &amp;amp; T3 trying to acquire lock.&lt;br/&gt;
Note: time stamp ordering is ts0 &amp;lt; ts1 &amp;lt; ts2 &amp;lt; ts3&lt;br/&gt;
Description of race:&lt;br/&gt;
1. T0, T1 and T2 simultaneously tries to acquire lock and got inconsistent updates in the config server. The state will end up like this:&lt;/p&gt;

&lt;p&gt;Config0: T0 got this&lt;br/&gt;
Config1: T1 got this&lt;br/&gt;
Config2: T2 got this&lt;/p&gt;

&lt;p&gt;2. T1 checks the current document at config0.&lt;br/&gt;
3. T2 checks the current document at config0.&lt;br/&gt;
4. T1 takes over the lock by overriding the ts with it&apos;s own timestamp. Note: query is &lt;/p&gt;
{ ts: ts0 }
&lt;p&gt;, update is { ts: { $set: { ts: ts1 }}.&lt;br/&gt;
5. T2 tries to take over the lock by overriding the ts with it&apos;s own timestamp. Note: query is &lt;/p&gt;
{ ts: ts0 }
&lt;p&gt;, update is { ts: { $set: { ts: ts2 }}. But since T1 already updated the document, this update ends up modifying nothing.&lt;br/&gt;
6. After seeing that T2&apos;s higher timestamp in config2, T1 backs out, registers itself for &quot;deletion&quot; by the lock pinger.&lt;br/&gt;
7. T2 finished checking each config server and determines that it has the highest timestamp, declares that it won the tournament and prepares to finalize the lock acquisition.&lt;br/&gt;
8. Lock pinger picks up T1&apos;s entry and sets the lock state to 0 (unlocked)&lt;br/&gt;
9. T3 trues tries to acquire lock, sees the lock document once touched by T1 is in state 0 and tries to grab it. Note: query is &lt;/p&gt;
{ ts: ts1 }
&lt;p&gt;, update is set state to 1, ts to ts3.&lt;br/&gt;
10. T3 gets update not consistent exception since config2 already has T2&apos;s timestamp.&lt;br/&gt;
11. T2 sets all config server lock documents to be owned by T2 to state 2.&lt;br/&gt;
13. T2 thinks he already own the lock so goes ahead and grabs it.&lt;br/&gt;
14. T3 goes to the tournament round and since it has a higher timestamp than T2, it sets all config server lock documents to be have a timestamp of ts3.&lt;br/&gt;
15. T3 wins the tournament and grabs the lock.&lt;/p&gt;

&lt;p&gt;Now, both T2 and T3 thinks they have the lock!&lt;/p&gt;

&lt;p&gt;To reproduce this race more easily, simply add a sleepsecs(2) right on this line and run the sync6.js test:&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/blob/r2.6.0/src/mongo/s/distlock.cpp#L984&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/blob/r2.6.0/src/mongo/s/distlock.cpp#L984&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
        <key id="131059">SERVER-13585</key>
            <summary>Race in dist lock after winning &quot;tournament&quot; round</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="9">Done</resolution>
                                        <assignee username="randolph@mongodb.com">Randolph Tan</assignee>
                                    <reporter username="randolph@mongodb.com">Randolph Tan</reporter>
                        <labels>
                    </labels>
                <created>Mon, 14 Apr 2014 20:33:54 +0000</created>
                <updated>Mon, 11 Jul 2016 17:18:30 +0000</updated>
                            <resolved>Thu, 17 Apr 2014 15:23:57 +0000</resolved>
                                    <version>2.6.0</version>
                                    <fixVersion>2.7.0</fixVersion>
                                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="553191" author="xgen-internal-githook" created="Thu, 17 Apr 2014 15:23:23 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;renctan&apos;, u&apos;name&apos;: u&apos;Randolph Tan&apos;, u&apos;email&apos;: u&apos;randolph@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-13585&quot; title=&quot;Race in dist lock after winning &amp;quot;tournament&amp;quot; round&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-13585&quot;&gt;&lt;del&gt;SERVER-13585&lt;/del&gt;&lt;/a&gt; Race in dist lock after winning &quot;tournament&quot; round&lt;/p&gt;

&lt;p&gt;Remove the potential state transition from 1 to 0.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/5e737823b0cd4e56e894fb504c406caa28d8fd34&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/5e737823b0cd4e56e894fb504c406caa28d8fd34&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_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 17 Apr 2014 15:23:23 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        9 years, 43 weeks, 6 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_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>ramon.fernandez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            9 years, 43 weeks, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </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>randolph@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrlwvb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrxzp3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>112445</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_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|hrqrn3:</customfieldvalue>

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