<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:14:04 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-27067] Some Commands do not wait for write concern for no-op writes</title>
                <link>https://jira.mongodb.org/browse/SERVER-27067</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;The wait for write concern code returns early if the ReplClientInfo is not set:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/r3.4.0-rc3/src/mongo/db/write_concern.cpp#L223-L226&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/blob/r3.4.0-rc3/src/mongo/db/write_concern.cpp#L223-L226&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This means that if certain commands that does write actually ends up as no-op, it will actually not end up waiting for write concern.&lt;/p&gt;

&lt;p&gt;Example case:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Client sends drop command to mongos.&lt;/li&gt;
	&lt;li&gt;Drop command times out waiting for write concern at mongod.&lt;/li&gt;
	&lt;li&gt;Mongos retries command since write concern timeout is a retriable error with Shard::RetryPolicy::kIdempotent.&lt;/li&gt;
	&lt;li&gt;Mongos retries drop command to mongod.&lt;/li&gt;
	&lt;li&gt;Since collection is already dropped, it will get &quot;ns does not exist&quot; error.&lt;/li&gt;
	&lt;li&gt;If the mongos used a new connection, it will not wait for replication at all because it does not have any client opTime set. However, if the same connection is used, it will wait for the write concern as expected.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Some of the commands already wait for write concern correctly even though it ends up doing a no-op write via repl::ReplClientInfo::setLastOpToSystemLastOpTime (for example, findAndModify, write commands, applyOps, etc).&lt;/p&gt;</description>
                <environment></environment>
        <key id="332329">SERVER-27067</key>
            <summary>Some Commands do not wait for write concern for no-op writes</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="judah.schvimer@mongodb.com">Judah Schvimer</assignee>
                                    <reporter username="randolph@mongodb.com">Randolph Tan</reporter>
                        <labels>
                            <label>bkp</label>
                            <label>writeconcern</label>
                    </labels>
                <created>Wed, 16 Nov 2016 18:06:49 +0000</created>
                <updated>Wed, 20 Dec 2023 19:21:43 +0000</updated>
                            <resolved>Wed, 26 Jul 2017 15:49:57 +0000</resolved>
                                    <version>3.4.0-rc3</version>
                                    <fixVersion>3.4.11</fixVersion>
                    <fixVersion>3.5.11</fixVersion>
                                    <component>Replication</component>
                                        <votes>0</votes>
                                    <watches>7</watches>
                                                                                                                <comments>
                            <comment id="1738767" author="xgen-internal-githook" created="Thu, 30 Nov 2017 19:57:37 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Judah Schvimer&apos;, &apos;username&apos;: &apos;judahschvimer&apos;, &apos;email&apos;: &apos;judah@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-27067&quot; title=&quot;Some Commands do not wait for write concern for no-op writes&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-27067&quot;&gt;&lt;del&gt;SERVER-27067&lt;/del&gt;&lt;/a&gt; Remove unnecessary references to setLastOpToSystemLastOpTime&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 50cbe6d35a3b61ce674eb0d8fae173f70f1dddd5)&lt;br/&gt;
Branch: v3.4&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/10d74315247887467f1234b7566265ac749d5f69&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/10d74315247887467f1234b7566265ac749d5f69&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1738766" author="xgen-internal-githook" created="Thu, 30 Nov 2017 19:57:36 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Judah Schvimer&apos;, &apos;username&apos;: &apos;judahschvimer&apos;, &apos;email&apos;: &apos;judah@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-27067&quot; title=&quot;Some Commands do not wait for write concern for no-op writes&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-27067&quot;&gt;&lt;del&gt;SERVER-27067&lt;/del&gt;&lt;/a&gt; sets client last op to system last optime if the global exclusive lock was taken&lt;br/&gt;
Branch: v3.4&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/90228aceac05cffdd3b6392653b0b44492068ee6&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/90228aceac05cffdd3b6392653b0b44492068ee6&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1738765" author="xgen-internal-githook" created="Thu, 30 Nov 2017 19:57:34 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Judah Schvimer&apos;, &apos;username&apos;: &apos;judahschvimer&apos;, &apos;email&apos;: &apos;judah@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-27067&quot; title=&quot;Some Commands do not wait for write concern for no-op writes&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-27067&quot;&gt;&lt;del&gt;SERVER-27067&lt;/del&gt;&lt;/a&gt; decorates operation context with boolean when global lock is taken in X or IX mode&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 5dda752d6cc8ed1f75a564b03b7357592f488d93)&lt;br/&gt;
Branch: v3.4&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/b02fdd26ea4b3d238c33d045cd767f22c591face&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/b02fdd26ea4b3d238c33d045cd767f22c591face&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1632329" author="xgen-internal-githook" created="Wed, 26 Jul 2017 15:49:26 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;judah@mongodb.com&apos;, &apos;username&apos;: &apos;judahschvimer&apos;, &apos;name&apos;: &apos;Judah Schvimer&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-27067&quot; title=&quot;Some Commands do not wait for write concern for no-op writes&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-27067&quot;&gt;&lt;del&gt;SERVER-27067&lt;/del&gt;&lt;/a&gt; Remove unnecessary references to setLastOpToSystemLastOpTime&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/50cbe6d35a3b61ce674eb0d8fae173f70f1dddd5&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/50cbe6d35a3b61ce674eb0d8fae173f70f1dddd5&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1623596" author="xgen-internal-githook" created="Mon, 17 Jul 2017 15:09:13 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;judahschvimer&apos;, u&apos;name&apos;: u&apos;Judah Schvimer&apos;, u&apos;email&apos;: u&apos;judah@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-27067&quot; title=&quot;Some Commands do not wait for write concern for no-op writes&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-27067&quot;&gt;&lt;del&gt;SERVER-27067&lt;/del&gt;&lt;/a&gt; sets client last op to system last optime if the global exclusive lock was taken&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/27cf9fd7b31f043af913da135385367126f5691b&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/27cf9fd7b31f043af913da135385367126f5691b&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1610621" author="xgen-internal-githook" created="Thu, 29 Jun 2017 17:11:34 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;judahschvimer&apos;, u&apos;name&apos;: u&apos;Judah Schvimer&apos;, u&apos;email&apos;: u&apos;judah@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-27067&quot; title=&quot;Some Commands do not wait for write concern for no-op writes&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-27067&quot;&gt;&lt;del&gt;SERVER-27067&lt;/del&gt;&lt;/a&gt; decorates operation context with boolean when global lock is taken in X or IX mode&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/5dda752d6cc8ed1f75a564b03b7357592f488d93&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/5dda752d6cc8ed1f75a564b03b7357592f488d93&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1591306" author="spencer" created="Thu, 8 Jun 2017 17:47:01 +0000"  >&lt;p&gt;Current implementation plan:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Start decorating the operation context with a boolean any time the global lock is taken in X or IX mode.&lt;/li&gt;
	&lt;li&gt;When executing any command that supports write concern, take note of the last op on the client before and after the command runs.  If the last op on the client doesn&apos;t change but there &lt;b&gt;is&lt;/b&gt; an opctx decoration indicating the command took a global X or IX lock, then set the last op on the client to the last op on the system.&lt;/li&gt;
	&lt;li&gt;Wait for write concern for the last op on the client.&lt;/li&gt;
	&lt;li&gt;Remove unnecessary references to setLastOpToSystemLastOpTime throughout the code.  Leave the special last client op handling in the batch write commands.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Note that this solution won&apos;t automatically handle the case where a single command does multiple writes and the last one is a no-op.  In that case we could wind up not waiting long enough to include the no-op write.  The only case where this can happen currently though is in multi-writes in the batch write commands, which already have special logic to handle this case.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10420">
                    <name>Backports</name>
                                            <outwardlinks description="backported by">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="311342">SERVER-25765</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="416426">SERVER-30648</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="501848">SERVER-33475</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="507264">SERVER-33727</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="755224">SERVER-40965</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="554074">SERVER-35387</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2522146">SERVER-84081</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>7.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>6.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="14340"><![CDATA[v3.4]]></customfieldvalue>
    <customfieldvalue key="13440"><![CDATA[v3.2]]></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, 16 Nov 2016 23:00:30 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            6 years, 10 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_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>judah.schvimer@mongodb.com</customfieldvalue>
            <customfieldvalue>randolph@mongodb.com</customfieldvalue>
            <customfieldvalue>spencer@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrjqp3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|ht1a5z:</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="1313">Repl 2017-01-23</customfieldvalue>
    <customfieldvalue id="1450">Repl 2017-02-13</customfieldvalue>
    <customfieldvalue id="1618">Repl 2017-04-17</customfieldvalue>
    <customfieldvalue id="1619">Repl 2017-05-08</customfieldvalue>
    <customfieldvalue id="1710">Repl 2017-05-29</customfieldvalue>
    <customfieldvalue id="1768">Repl 2017-07-31</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|hsecfz:</customfieldvalue>

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