<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:59:07 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-22002] Do not retry findAndModify operations on MMAPv1</title>
                <link>https://jira.mongodb.org/browse/SERVER-22002</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;If a findAndModify command requests a sort, we pass a limit of 1 to that sort so that it will only keep track of the top document, reducing it&apos;s memory footprint.&lt;/p&gt;

&lt;p&gt;This can lead to lots of retrying when there are many findAndModify operations which all specify a sort and are trying to update the same document, which is a common pattern for some sort of work queue.&lt;/p&gt;

&lt;p&gt;What happens is that each findAndModify operation will chug along doing it&apos;s sort (I think this is only a problem if it&apos;s an in-memory sort, not an index-provided sort), each one periodically yielding, and one will eventually finish first and update the document. Each other operation will eventually find that the matching document has already been modified, so cannot update it themselves. Since there was a limit of 1, the sort stage does not have the next matching document, and the operations have to restart, and re-sort everything.&lt;/p&gt;

&lt;p&gt;This is particularly bad on MMAPv1, since the updates have to take an exclusive lock on the collection. The logic to retry operations on MMAPv1 was only introduced in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-21434&quot; title=&quot;FindAndModify query unexpectedly returns null when using multiple readers&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-21434&quot;&gt;&lt;del&gt;SERVER-21434&lt;/del&gt;&lt;/a&gt;. We should revert this change, instead allowing clients to continue to retry (as they likely are already).&lt;/p&gt;

&lt;p&gt;As part of this work, it was discovered that there are cases where we do not retry the operation, even on WiredTiger. We should fix those places as well.&lt;/p&gt;</description>
                <environment></environment>
        <key id="244970">SERVER-22002</key>
            <summary>Do not retry findAndModify operations on MMAPv1</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="charlie.swanson@mongodb.com">Charlie Swanson</assignee>
                                    <reporter username="charlie.swanson@mongodb.com">Charlie Swanson</reporter>
                        <labels>
                            <label>code-and-test</label>
                    </labels>
                <created>Wed, 23 Dec 2015 14:37:26 +0000</created>
                <updated>Fri, 18 Nov 2016 01:16:13 +0000</updated>
                            <resolved>Thu, 21 Jan 2016 14:41:45 +0000</resolved>
                                    <version>3.2.0-rc3</version>
                                    <fixVersion>3.2.3</fixVersion>
                    <fixVersion>3.3.1</fixVersion>
                                    <component>Querying</component>
                                        <votes>0</votes>
                                    <watches>9</watches>
                                                                                                                <comments>
                            <comment id="1348757" author="xgen-internal-githook" created="Fri, 5 Aug 2016 17:38:14 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;cswanson310&apos;, u&apos;name&apos;: u&apos;Charlie Swanson&apos;, u&apos;email&apos;: u&apos;charlie.swanson@mongodb.com&apos;}
&lt;p&gt;Message: Revert &quot;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-22002&quot; title=&quot;Do not retry findAndModify operations on MMAPv1&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-22002&quot;&gt;&lt;del&gt;SERVER-22002&lt;/del&gt;&lt;/a&gt; Regression tests for concurrent findAndModify operations&quot;&lt;/p&gt;

&lt;p&gt;This reverts commit 6f3142b97b00464efebe26ef35cba73d47cf98a4.&lt;br/&gt;
Branch: develop&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-perf/commit/9a01dbc34b8dab12ff14028090610df30187ef65&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-perf/commit/9a01dbc34b8dab12ff14028090610df30187ef65&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1348755" author="xgen-internal-githook" created="Fri, 5 Aug 2016 17:38:13 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;cswanson310&apos;, u&apos;name&apos;: u&apos;Charlie Swanson&apos;, u&apos;email&apos;: u&apos;charlie.swanson@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-22002&quot; title=&quot;Do not retry findAndModify operations on MMAPv1&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-22002&quot;&gt;&lt;del&gt;SERVER-22002&lt;/del&gt;&lt;/a&gt; Regression tests for concurrent findAndModify operations&lt;br/&gt;
Branch: develop&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-perf/commit/6f3142b97b00464efebe26ef35cba73d47cf98a4&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-perf/commit/6f3142b97b00464efebe26ef35cba73d47cf98a4&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1215980" author="nick@innsenroute.com" created="Sat, 26 Mar 2016 00:50:06 +0000"  >&lt;p&gt;...and just because no one has mentioned it before, doesn&apos;t mean it isn&apos;t a bug. Just means it&apos;s an edge case.&lt;/p&gt;</comment>
                            <comment id="1215979" author="nick@innsenroute.com" created="Sat, 26 Mar 2016 00:48:55 +0000"  >&lt;p&gt;I don&apos;t personally have any problem with this as I don&apos;t use MMAP, and I can understand the reasons you&apos;ve given. My point was simply that I would not expect functional changes when switching between storage engines. Keep up the good work!&lt;/p&gt;</comment>
                            <comment id="1215347" author="charlie.swanson" created="Fri, 25 Mar 2016 15:58:16 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=nick%40innsenroute.com&quot; class=&quot;user-hover&quot; rel=&quot;nick@innsenroute.com&quot;&gt;nick@innsenroute.com&lt;/a&gt;, yes. The retrying behavior differs based on the storage engine. We made this decision for a number of reasons:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Retrying on MMAPv1 is more expensive because it does not support document granularity concurrency, so each retry will take an exclusive lock on the collection.&lt;/li&gt;
	&lt;li&gt;Conversely, retrying on WiredTiger (or other modern storage engines) is not as expensive, for the same reason. WiredTiger supports document granularity concurrency, so we do not take as many resources for retrying.&lt;/li&gt;
	&lt;li&gt;Adding the retry logic on MMAPv1 adds additional complexity to the codebase, and isn&apos;t very straightforward to add or to test. Further, for much if not all of findAndModify&apos;s history on MMAPv1, operations were not retried in this case, and no one has noticed or complained.&lt;/li&gt;
	&lt;li&gt;The decision to support retrying on WiredTiger was made for version 3.0, so we are treating the WiredTiger behavior change in version 3.2 as a regression.&lt;/li&gt;
&lt;/ol&gt;
</comment>
                            <comment id="1166108" author="nick@innsenroute.com" created="Mon, 8 Feb 2016 03:42:31 +0000"  >&lt;p&gt;So does this mean different behavior for different storage engines? I would be extremely careful making an assumption on &quot;letting a client retry&quot;. This would break any typical queue implementation.&lt;/p&gt;</comment>
                            <comment id="1150414" author="xgen-internal-githook" created="Thu, 21 Jan 2016 20:22:13 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;cswanson310&apos;, u&apos;name&apos;: u&apos;Charlie Swanson&apos;, u&apos;email&apos;: u&apos;charlie.swanson@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-22002&quot; title=&quot;Do not retry findAndModify operations on MMAPv1&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-22002&quot;&gt;&lt;del&gt;SERVER-22002&lt;/del&gt;&lt;/a&gt; Do not retry findAndModify on MMAPv1&lt;br/&gt;
Branch: v3.2&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/c7c5010151e6e0d29a16e14429c864b0c7dd8386&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/c7c5010151e6e0d29a16e14429c864b0c7dd8386&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1149813" author="xgen-internal-githook" created="Thu, 21 Jan 2016 14:29:28 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;cswanson310&apos;, u&apos;name&apos;: u&apos;Charlie Swanson&apos;, u&apos;email&apos;: u&apos;charlie.swanson@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-22002&quot; title=&quot;Do not retry findAndModify operations on MMAPv1&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-22002&quot;&gt;&lt;del&gt;SERVER-22002&lt;/del&gt;&lt;/a&gt; Do not retry findAndModify on MMAPv1&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/f1ba338629578aaa6bff4ccadd4efbb8f862b37d&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/f1ba338629578aaa6bff4ccadd4efbb8f862b37d&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1134126" author="xgen-internal-githook" created="Wed, 13 Jan 2016 19:59:03 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;cswanson310&apos;, u&apos;name&apos;: u&apos;Charlie Swanson&apos;, u&apos;email&apos;: u&apos;charlie.swanson@mongodb.com&apos;}
&lt;p&gt;Message: Revert &quot;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-22002&quot; title=&quot;Do not retry findAndModify operations on MMAPv1&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-22002&quot;&gt;&lt;del&gt;SERVER-22002&lt;/del&gt;&lt;/a&gt; Regression tests for concurrent findAndModify operations&quot;&lt;/p&gt;

&lt;p&gt;This reverts commit 6f3142b97b00464efebe26ef35cba73d47cf98a4.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-perf/commit/9a01dbc34b8dab12ff14028090610df30187ef65&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-perf/commit/9a01dbc34b8dab12ff14028090610df30187ef65&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1134123" author="xgen-internal-githook" created="Wed, 13 Jan 2016 19:58:13 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;cswanson310&apos;, u&apos;name&apos;: u&apos;Charlie Swanson&apos;, u&apos;email&apos;: u&apos;charlie.swanson@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-22002&quot; title=&quot;Do not retry findAndModify operations on MMAPv1&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-22002&quot;&gt;&lt;del&gt;SERVER-22002&lt;/del&gt;&lt;/a&gt; Regression tests for concurrent findAndModify operations&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-perf/commit/6f3142b97b00464efebe26ef35cba73d47cf98a4&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-perf/commit/6f3142b97b00464efebe26ef35cba73d47cf98a4&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1131826" author="charlie.swanson" created="Mon, 11 Jan 2016 22:55:22 +0000"  >&lt;p&gt;Updated the description once again to reflect our new solution.&lt;/p&gt;</comment>
                            <comment id="1126691" author="charlie.swanson" created="Tue, 5 Jan 2016 19:09:43 +0000"  >&lt;p&gt;Updated description to reflect the fix we went with. We decided not to make the size of the limit configurable, since the 32MB sort limit already is configurable.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10320">
                    <name>Documented</name>
                                                                <inwardlinks description="is documented by">
                                        <issuelink>
            <issuekey id="319574">DOCS-8935</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="261176">SERVER-22324</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="239085">SERVER-21434</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>12.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12451" key="com.atlassian.jira.plugin.system.customfieldtypes:multiversion">
                        <customfieldname>Backport Completed</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="15909">3.2.3</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>Wed, 13 Jan 2016 19:58:13 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            7 years, 27 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>charlie.swanson@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>nick@innsenroute.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrkln3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrdqgf:</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="817">QuInt E (01/11/16)</customfieldvalue>
    <customfieldvalue id="859">Query F (02/01/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|hsfcg7:</customfieldvalue>

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