<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:42:11 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-79892] Inconsistent profiling output for inserts</title>
                <link>https://jira.mongodb.org/browse/SERVER-79892</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;For the insert operation, the profiling output is currently inconsistent in some ways:&lt;/p&gt;

&lt;p&gt;&lt;b&gt;1) Inconsistency between inserts initiates from mongod v.s. inserts sent from mongos&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;When we do an insert directly from monogd, the profile entry in the &amp;lt;db&amp;gt;.system.profile collection will contain and entry with a field &quot;command&quot; like this:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;&#160; &#160; &quot;command&quot; : {&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;&#160; &#160; &#160; &#160; &quot;insert&quot; : &quot;coll&quot;,&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;&#160; &#160; &#160; &#160; &quot;lsid&quot; : { ... },&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;&#160; &#160; &#160; &#160; &quot;$clusterTime&quot; : { ... },&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;&#160; &#160; &#160; &#160; &quot;$db&quot; : &quot;test&quot;,&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;&#160; &#160; },&lt;/tt&gt;{&lt;tt&gt;}&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;Note that this does not include the actual documents inserted (which seems not desired), however if the insert command is sent from mongos, &quot;command&quot; field will include a subField &quot;documents&quot; that is an array of all the inserted documents.&lt;/p&gt;

&lt;p&gt;The reason of the difference is two-folded:&lt;/p&gt;

&lt;p&gt;a) For the similar reason described in&#160;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-79442&quot; title=&quot;Update command may send mirrored reads without filter, hint or collation&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-79442&quot;&gt;SERVER-79442&lt;/a&gt;, for requests initiated from mongod, any field that are marked as &apos;supports_doc_sequence&apos; (such as the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/fd837c1c905798c96fdd862a50388f89774a52d7/src/mongo/db/ops/write_ops.idl#L389&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&quot;documents&quot;&lt;/a&gt; field in the insert command, the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/fd837c1c905798c96fdd862a50388f89774a52d7/src/mongo/db/ops/write_ops.idl#L413&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&quot;updates&quot;&lt;/a&gt; field in the update command and the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/fd837c1c905798c96fdd862a50388f89774a52d7/src/mongo/db/ops/write_ops.idl#L450&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&quot;deletes&quot;&lt;/a&gt; field in the delete command) will only be present in the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/fd837c1c905798c96fdd862a50388f89774a52d7/src/mongo/rpc/op_msg.h#L178&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;OpMsg::sequences&lt;/a&gt; vector, but not in &lt;a href=&quot;https://github.com/mongodb/mongo/blob/fd837c1c905798c96fdd862a50388f89774a52d7/src/mongo/rpc/op_msg.h#L177&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;OpMsg::body&lt;/a&gt;, while for requests sent from mongos, requests are serialized in a way such that all fields are in &lt;a href=&quot;https://github.com/mongodb/mongo/blob/fd837c1c905798c96fdd862a50388f89774a52d7/src/mongo/rpc/op_msg.h#L177&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;OpMsg::body&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;b) For every command handled by mongod, &lt;a href=&quot;https://github.com/mongodb/mongo/blob/fd837c1c905798c96fdd862a50388f89774a52d7/src/mongo/db/service_entry_point_common.cpp#L2098&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;curOpCommandSetup()&lt;/a&gt; will first be called to set basic command info in &lt;tt&gt;CurOp&lt;/tt&gt;,&#160; where it calls &lt;a href=&quot;https://github.com/mongodb/mongo/blob/fd837c1c905798c96fdd862a50388f89774a52d7/src/mongo/db/service_entry_point_common.cpp#L2108&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;setOpDescription_inlock()&lt;/a&gt; to set opDescription using &lt;a href=&quot;https://github.com/mongodb/mongo/blob/fd837c1c905798c96fdd862a50388f89774a52d7/src/mongo/rpc/op_msg.h#L177&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;OpMsg::body&lt;/a&gt;, and this is basically what&apos;s printed in the &quot;command&quot; field of the profile entry. However, the problem is that unlike update and delete command where they unroll each update/delete op and &lt;a href=&quot;https://github.com/mongodb/mongo/blob/fd837c1c905798c96fdd862a50388f89774a52d7/src/mongo/db/ops/write_ops_exec.cpp#L1341&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;overwrite the opDescription&lt;/a&gt; with the individual update/delete op, insert &lt;a href=&quot;https://github.com/mongodb/mongo/blob/fd837c1c905798c96fdd862a50388f89774a52d7/src/mongo/db/ops/write_ops_exec.cpp#L1040-L1042&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;does not do that&lt;/a&gt;. Combined with a), inserts initiated from mongod will lose the &quot;documents&quot; field in the profile entry.&lt;/p&gt;

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

&lt;p&gt;&lt;b&gt;2)&lt;/b&gt;&#160;&lt;b&gt;Inconsistency between inserts v.s. updates/deletes&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;From the above example profile output, we can see that insert command includes some request-level fields like &lt;tt&gt;$clusterTime&lt;/tt&gt;,{&lt;tt&gt;} $db&lt;/tt&gt;,{&lt;tt&gt;} txnNumber&lt;/tt&gt;, etc. However due to aforementioned reason b), update and delete commands will overwrite the opDescription with individual update/delete op and so will not include those request-level fields. And we seem to be relying on this to for JS tests because when I did a &lt;a href=&quot;https://evergreen.mongodb.com/filediff/64d1f3aba4cf47be22b54112/?file_name=src%2Fmongo%2Fdb%2Fops%2Fwrite_ops_exec.cpp&amp;amp;patch_number=0&amp;amp;commit_number=0&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;one-line change&lt;/a&gt; to make inserts also overwrite opDescription with the inserted documents, I saw a bunch of &lt;a href=&quot;https://spruce.mongodb.com/version/64d1f3aba4cf47be22b54112&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;tests failed&lt;/a&gt; because they expect the request level fields being present in the insert command profile output. I think ultimately insert/update/delete should have consistent profile entry format, but I&apos;m not sure whether we want to fix insert or fix update/delete. If I have to guess, we probably want to have the request-level fields to be present in update/delete as well.&lt;/p&gt;</description>
                <environment></environment>
        <key id="2413797">SERVER-79892</key>
            <summary>Inconsistent profiling output for inserts</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="3">Duplicate</resolution>
                                        <assignee username="backlog-server-execution-namer@mongodb.com">[DO NOT USE] Backlog - Storage Execution NAMER</assignee>
                                    <reporter username="wenbin.zhu@mongodb.com">Wenbin Zhu</reporter>
                        <labels>
                    </labels>
                <created>Thu, 10 Aug 2023 01:28:56 +0000</created>
                <updated>Fri, 11 Aug 2023 01:00:52 +0000</updated>
                            <resolved>Thu, 10 Aug 2023 01:29:28 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                    <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="2413796">SERVER-79891</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>0.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="26007"><![CDATA[Storage Execution NAMER]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        26 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_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>dbeng-pm-bot</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            26 weeks ago
                        </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>backlog-server-execution-namer@mongodb.com</customfieldvalue>
            <customfieldvalue>wenbin.zhu@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i2lofj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i23qpk:</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_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|i2lakv:</customfieldvalue>

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