<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:28:59 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-74964] Pass namespace to LastOpFixer for each operation </title>
                <link>https://jira.mongodb.org/browse/SERVER-74964</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;&lt;a href=&quot;https://github.com/10gen/mongo/blob/master/src/mongo/db/ops/write_ops_exec_util.h#L44&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;LastOpFixer&lt;/a&gt; currently can only be constructed with a Namespace. For bulkWrite we want to be able to construct it without a Namespace so we only have to use one object for the entire write which can take place across multiple namespaces. For bulkWrite we would like to move this instantiation into performWrites&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;A couple ways this could be done&lt;/p&gt;

&lt;p&gt;make a ctor that allows us to set isLocalDB directly. Unless all namespaces used in a bulkWrite are local, otherwise isLocalDB should be false and we should set lastOp correctly for no-op writes on replicated namespaces&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;let&#160;&lt;tt&gt;startingOp()&lt;/tt&gt;&#160;take in a namespace/bool indicating whether it is a local write, if it is, then we make the startingOp() and finishedOpSuccessfully() pair no-op for that particular write&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="2290496">SERVER-74964</key>
            <summary>Pass namespace to LastOpFixer for each operation </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="kaitlin.mahar@mongodb.com">Kaitlin Mahar</assignee>
                                    <reporter username="sean.zimmerman@mongodb.com">Sean Zimmerman</reporter>
                        <labels>
                            <label>milestone-1</label>
                    </labels>
                <created>Thu, 16 Mar 2023 20:53:22 +0000</created>
                <updated>Sun, 29 Oct 2023 21:24:45 +0000</updated>
                            <resolved>Fri, 7 Apr 2023 14:25:07 +0000</resolved>
                                                    <fixVersion>7.0.0-rc0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="5341860" author="kaitlin.mahar" created="Wed, 12 Apr 2023 16:19:18 +0000"  >&lt;p&gt;I realized while working on &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-75798&quot; title=&quot;Use LastOpFixer for update and delete operations in bulkWrite command&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-75798&quot;&gt;&lt;del&gt;SERVER-75798&lt;/del&gt;&lt;/a&gt; that the tests I added as part of this ticket were not sufficient to actually confirm we actually wait for write concern correctly for batched inserts via bulkWrite.&lt;/p&gt;

&lt;p&gt;The way that the &lt;tt&gt;noop_writes_wait_for_write_concern.js&lt;/tt&gt; tests work is:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Create a 3 node replica set&lt;/li&gt;
	&lt;li&gt;Stop one of the secondaries&lt;/li&gt;
	&lt;li&gt;With one connection, run setup code&lt;/li&gt;
	&lt;li&gt;With a fresh connection (where the client would have no last optime to set to begin with), run a command containing a no-op write using write concern w:3 and wtimeout: 1000&lt;/li&gt;
	&lt;li&gt;Expect that the command returns a write concern error&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;For a command containing a single write operation, step 5 proves that we set the client&apos;s last optime even when we no-op, and that we then wait for all nodes to catch up to that optime. If we did not do both of those things, then we wouldn&apos;t receive a write a concern error.&lt;/p&gt;

&lt;p&gt;However, for a batched write this assertion is not strong enough to prove that we correctly advance the client&apos;s last optime all the way to the latest oplog entry&apos;s optime. To illustrate with an example:&lt;/p&gt;

&lt;p&gt;Consider a batch of two inserts where the first insert op1 is successful and the second insert op2 is a no-op, e.g. due to a DuplicateKeyError. The correct behavior would be for op1 to advance the client last optime to its own optime, and for op2 to advance the client&apos;s last optime to the latest oplog entry&apos;s optime, and for us to then wait for the latest optime to replicate.&lt;/p&gt;

&lt;p&gt;The issue lies in that even if we only waited for op1&apos;s optime to replicate, and not the latest optime, we would still receive a write concern error, since the node has been stopped all along and neither of the writes will replicate. So the write concern error does not prove we &quot;fixed&quot; the optime for the no-op.&lt;/p&gt;

&lt;p&gt;As part of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-75798&quot; title=&quot;Use LastOpFixer for update and delete operations in bulkWrite command&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-75798&quot;&gt;&lt;del&gt;SERVER-75798&lt;/del&gt;&lt;/a&gt; I will write a new test that is similar but allows us to actually prove we update the optime for the no-op, and I will switch to running the batched insert test cases I wrote here in that way.&lt;/p&gt;</comment>
                            <comment id="5331607" author="xgen-internal-githook" created="Fri, 7 Apr 2023 01:16:12 +0000"  >&lt;p&gt;Author: &lt;/p&gt;
{&apos;name&apos;: &apos;Kaitlin Mahar&apos;, &apos;email&apos;: &apos;kaitlin.mahar@mongodb.com&apos;, &apos;username&apos;: &apos;kmahar&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-74964&quot; title=&quot;Pass namespace to LastOpFixer for each operation &quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-74964&quot;&gt;&lt;del&gt;SERVER-74964&lt;/del&gt;&lt;/a&gt; Pass namespace to LastOpFixer for each operation&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/759110fa276dc332c2dec26d71c7246f27ebc391&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/759110fa276dc332c2dec26d71c7246f27ebc391&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="5331138" author="kaitlin.mahar" created="Thu, 6 Apr 2023 20:27:39 +0000"  >&lt;p&gt;For future readers, what we decided to do here was the second solution, i.e. the namespace is now passed to startingOp() and we no longer accept the namespace in the constructor.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="2231990">SERVER-72808</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.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_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25128"><![CDATA[Replication]]></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, 5 Apr 2023 23:06:08 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        43 weeks 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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-1452</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>
                            43 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>kaitlin.mahar@mongodb.com</customfieldvalue>
            <customfieldvalue>sean.zimmerman@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i20k7j:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i1fi78:</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_22250" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Special Downgrade Instructions Required</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="23343"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="7169">Repl 2023-04-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|i206cv:</customfieldvalue>

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