<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:51:48 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-39361] Synchronise collecting storage engine stats with shutdown</title>
                <link>https://jira.mongodb.org/browse/SERVER-39361</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;We are erroneously calling into the storage engine as part of CurOp::completeAndLogOperation() without holding any locks.  This means there is no synchronization between server shutdown (or rollbackToStable) and this function call to access the statistics on the session.&lt;br/&gt;
We need to fix the design of stats gathering and might need to gather the stats earlier, as part of the WriteUnitOfWork destruction, so that stats will be local and can be put into the slow-query log entry.&lt;/p&gt;</description>
                <environment></environment>
        <key id="682825">SERVER-39361</key>
            <summary>Synchronise collecting storage engine stats with shutdown</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="13201">Fixed</resolution>
                                        <assignee username="sulabh.mahajan@mongodb.com">Sulabh Mahajan</assignee>
                                    <reporter username="vamsi.krishna@mongodb.com">Vamsi Boyapati</reporter>
                        <labels>
                    </labels>
                <created>Sun, 3 Feb 2019 23:04:52 +0000</created>
                <updated>Sun, 29 Oct 2023 22:24:27 +0000</updated>
                            <resolved>Mon, 25 Feb 2019 22:45:49 +0000</resolved>
                                                    <fixVersion>4.0.9</fixVersion>
                    <fixVersion>4.1.9</fixVersion>
                                                        <votes>0</votes>
                                    <watches>6</watches>
                                                                                                                <comments>
                            <comment id="2200022" author="xgen-internal-githook" created="Wed, 3 Apr 2019 00:32:45 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;sulabh.mahajan@mongodb.com&apos;, &apos;name&apos;: &apos;Sulabh Mahajan&apos;, &apos;username&apos;: &apos;sulabhM&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-38239&quot; title=&quot;Define and Implement getOperationStatistics of storage interface&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-38239&quot;&gt;&lt;del&gt;SERVER-38239&lt;/del&gt;&lt;/a&gt; Added getOperationStatistics() API to fetch storage stats from WiredTiger&lt;/p&gt;

&lt;p&gt;(cherry picked from commit ba3894493a94ed3c18458f391ff181d57475f010)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-38240&quot; title=&quot;Extend OpDebug object to support storage statistics &quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-38240&quot;&gt;&lt;del&gt;SERVER-38240&lt;/del&gt;&lt;/a&gt; Added storage statistics information into the slowop log messages.&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 86b6aca9fa1940e85bba87261d1494ef2c208a4a)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-38240&quot; title=&quot;Extend OpDebug object to support storage statistics &quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-38240&quot;&gt;&lt;del&gt;SERVER-38240&lt;/del&gt;&lt;/a&gt; work around uint64_t conversion on s390x in WiredTigerOperationStats::fetchStats()&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 82161eec79fc74652dc07b1c83fe500dc4f95e79)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-38243&quot; title=&quot;Test session storage statistics are part of slow operation report&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-38243&quot;&gt;&lt;del&gt;SERVER-38243&lt;/del&gt;&lt;/a&gt; Test presence of the storage stats in slowop logs and system.profile.&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 3b4c6a689a3fdaa923d427ae112ea599513ef8ce)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-39026&quot; title=&quot;Use correct type for retrieving WiredTiger statistics&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-39026&quot;&gt;&lt;del&gt;SERVER-39026&lt;/del&gt;&lt;/a&gt; Use correct type for retrieving WiredTiger stats&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 6a9a5855048df1f4796a4032276d01318c398691)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-39488&quot; title=&quot;Test does not see the storage statistics in the profiled output .&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-39488&quot;&gt;&lt;del&gt;SERVER-39488&lt;/del&gt;&lt;/a&gt; Look for storage stats in the find command&apos;s profiled entry.&lt;/p&gt;

&lt;p&gt;The find command will always have the storage stats because the&lt;br/&gt;
test has created a collection with btree spanning multiple pages. Scanning&lt;br/&gt;
this collection after a server restart will trigger read from the disk&lt;br/&gt;
and have the disk read stats.&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 6125b5fb078a316854f0299b96b7d16eacb944de)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-39361&quot; title=&quot;Synchronise collecting storage engine stats with shutdown&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-39361&quot;&gt;&lt;del&gt;SERVER-39361&lt;/del&gt;&lt;/a&gt; Synchronise collecting storage engine stats with shutdown&lt;/p&gt;

&lt;p&gt;(cherry picked from commit bacb6b67706a2c057fcd0f76a38f416b225aa69a)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-39061&quot; title=&quot;Fix the wt_operation_stats test to wait for the operation log to appear &quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-39061&quot;&gt;&lt;del&gt;SERVER-39061&lt;/del&gt;&lt;/a&gt; Fix the wt_operation_stats test to wait for the operation log to appear.&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 371197e4bab715a83272a4472e118ee5c5cbbf7c)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-39934&quot; title=&quot;CurOp::completeAndLogOperation should not hang waiting for global lock&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-39934&quot;&gt;&lt;del&gt;SERVER-39934&lt;/del&gt;&lt;/a&gt; Fix locking for slow ops storage stats&lt;br/&gt;
&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-39654&quot; title=&quot;Storage statistics not logged for a slow transaction&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-39654&quot;&gt;&lt;del&gt;SERVER-39654&lt;/del&gt;&lt;/a&gt; Make slow ops storage stats work with transactions&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 23ca771f76f85638f23bca2a4a6ac196a81fdc21)&lt;br/&gt;
Branch: v4.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/57edce7396271531dde4499458b22c9cde1f03d4&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/57edce7396271531dde4499458b22c9cde1f03d4&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2162401" author="sulabh.mahajan" created="Mon, 25 Feb 2019 23:02:30 +0000"  >&lt;p&gt;This needs to go into 4.0 along with other tickets in PM-1071&lt;/p&gt;</comment>
                            <comment id="2162368" author="xgen-internal-githook" created="Mon, 25 Feb 2019 22:45:19 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Sulabh Mahajan&apos;, &apos;email&apos;: &apos;sulabh.mahajan@mongodb.com&apos;, &apos;username&apos;: &apos;sulabhM&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-39361&quot; title=&quot;Synchronise collecting storage engine stats with shutdown&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-39361&quot;&gt;&lt;del&gt;SERVER-39361&lt;/del&gt;&lt;/a&gt; Synchronise collecting storage engine stats with shutdown&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/bacb6b67706a2c057fcd0f76a38f416b225aa69a&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/bacb6b67706a2c057fcd0f76a38f416b225aa69a&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2159273" author="sulabh.mahajan" created="Fri, 22 Feb 2019 00:23:01 +0000"  >&lt;p&gt;I think what worked here is letting lock&#160;acquisition be interrupted and being content with not logging storage statistics in such a case. I have put the change in review.&lt;/p&gt;</comment>
                            <comment id="2155369" author="milkie" created="Tue, 19 Feb 2019 13:47:20 +0000"  >&lt;p&gt;Regarding the hanging problem, I would take a look at how the profiler logic works, as we had to solve some of the same locking issues there, and the profiler is called in the same place that we&apos;re obtaining and writing these WT statistics.&lt;/p&gt;</comment>
                            <comment id="2155135" author="sulabh.mahajan" created="Tue, 19 Feb 2019 04:48:08 +0000"  >&lt;p&gt;Update:&lt;/p&gt;

&lt;p&gt;For the reasons given above, I decided to follow the approach 2, ie to take a &lt;tt&gt;MODE_IS&lt;/tt&gt; lock before calling into the storage engine. I hit the following hurdles:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;When this operation is performed under a transaction, taking &lt;tt&gt;MODE_IS&lt;/tt&gt; lock blocks as there is a transaction thread that already holds a &lt;tt&gt;MODE_IX&lt;/tt&gt; lock. Since that transaction thread can&apos;t proceed unless the individual operation finishes and the operation is blocked on taking the &lt;tt&gt;MODE_IS&lt;/tt&gt; lock, the process gets hung forever.&lt;/li&gt;
	&lt;li&gt;Also while testing patches for this ticket, I figured that storage statistics are not getting reported for the slow transactions. I have created &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-39654&quot; title=&quot;Storage statistics not logged for a slow transaction&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-39654&quot;&gt;&lt;del&gt;SERVER-39654&lt;/del&gt;&lt;/a&gt; to fix it.&lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="2148152" author="sulabh.mahajan" created="Thu, 14 Feb 2019 00:32:04 +0000"  >&lt;p&gt;Update:&lt;/p&gt;

&lt;p&gt;I have been working on the following approaches:&lt;/p&gt;

&lt;p&gt;1. Initially thought of updating stats into a variable in the storage engines implementation of the operation context. Each time the WUOW gets destroyed we could update these stats and &lt;tt&gt;CurOp::completeAndLogOperation()&lt;/tt&gt; could then extract these stats as needed instead of calling into the storage engine. On implementing a prototype found the following issues:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Instead of extracting storage stats for only the slow operations, this will cause all the operations to extract the stats. There could be a performance penalty because of this implementation&lt;/li&gt;
	&lt;li&gt;Figured that WUOW might not have the same lifetime as an operation. A query operation could span several WUOW objects, making this solution somewhat challenging as we will have to sum up stats over multiple WUOW followed by a reset on collection by &lt;tt&gt;CurOp::completeAndLogOperation()&lt;/tt&gt;&lt;br/&gt;
With the above issues decided not to follow this approach.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;2. Another approach that &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=milkie&quot; class=&quot;user-hover&quot; rel=&quot;milkie&quot;&gt;milkie&lt;/a&gt; suggested and I am still working on is to take a global &lt;tt&gt;MODE_IS&lt;/tt&gt; lock in &lt;tt&gt;CurOp::completeAndLogOperation()&lt;/tt&gt; before calling into the storage engine. Shut down is supposed to acquire a &lt;tt&gt;MODE_X&lt;/tt&gt; global lock and will either wait for &lt;tt&gt;CurOp::completeAndLogOperation()&lt;/tt&gt; to finish or stop storage engine being called and shut down instead. I have been facing issues in jstests with this approach. It appears like the last operation in jstests are not getting their result as expected, shutdown kills the process before the results are visible to the test. Still working on resolving this issue.&lt;/p&gt;</comment>
                            <comment id="2136159" author="vamsi.krishna" created="Sun, 3 Feb 2019 23:27:51 +0000"  >&lt;p&gt;Please discuss with &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=milkie&quot; class=&quot;user-hover&quot; rel=&quot;milkie&quot;&gt;milkie&lt;/a&gt; for changes needed to handle this design fix.  &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="10520">
                    <name>Problem/Incident</name>
                                            <outwardlinks description="causes">
                                        <issuelink>
            <issuekey id="707700">SERVER-39934</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="700004">SERVER-39654</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>8.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_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="15640"><![CDATA[v4.0]]></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>Thu, 14 Feb 2019 00:32:04 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        4 years, 45 weeks, 1 day 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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-1071</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>
                            4 years, 45 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>25.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>milkie@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>sulabh.mahajan@mongodb.com</customfieldvalue>
            <customfieldvalue>vamsi.krishna@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hul2g7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr8fbb:</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="2804">Storage Engines 2019-02-11</customfieldvalue>
    <customfieldvalue id="2805">Storage Engines 2019-02-25</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10555" key="com.atlassian.jira.plugin.system.customfieldtypes:float">
                        <customfieldname>Story Points</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>5.0</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|hukopj:</customfieldvalue>

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