<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:06:38 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-44675] server_status_metrics.js fails due to racy repl.buffer.count metric in serverStatus</title>
                <link>https://jira.mongodb.org/browse/SERVER-44675</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;The test fails (very rarely) due to a race in how the repl.buffer.count metric is calculated. There&apos;s a period when the&#160;rsBackgroundSync thread has added oplog entries to the buffer but hasn&apos;t yet incremented repl.buffer.count. During this period, the ReplBatcher thread can clear the buffer and&#160;&lt;b&gt;decrement&lt;/b&gt;&#160;repl.buffer.count. Since the count can be decremented&#160;&lt;b&gt;before&lt;/b&gt;&#160;it&apos;s incremented, it can be briefly negative.&#160;The server_status_metrics.js test doesn&apos;t expect this race.&lt;/p&gt;

&lt;p&gt;First, the&#160;test inserts 1000 docs with w: 2. The secondary&apos;s oplog buffer fills and empties, the metric is incremented by 1000 and decremented by 1000.&#160;The test calls serverStatus on the secondary and checks that repl.buffer.count &amp;gt;= 0, in fact it&apos;s 0, and the assertion passes.&#160;&lt;/p&gt;

&lt;p&gt;Next, the test updates all 1000 docs with w: 2. Events proceed perhaps in this order:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;the rsBackgroundSync thread in BackgroundSync::_enqueueDocuments buffers 1000 oplog entries, bufferCountGauge is still 0&lt;/li&gt;
	&lt;li&gt;the ReplBatcher thread in SyncTail::tryPopAndWaitForMore calls bufferCountGauge.decrement(1) a thousand times, now it&apos;s -1000&lt;/li&gt;
	&lt;li&gt;the test calls serverStatus, repl.buffer.count is -1000 so the test will fail&lt;/li&gt;
	&lt;li&gt;the rsBackgroundSync thread in BackgroundSync::_enqueueDocuments calls bufferCountGauge.increment(1000)&lt;/li&gt;
&lt;/ol&gt;
</description>
                <environment></environment>
        <key id="1005050">SERVER-44675</key>
            <summary>server_status_metrics.js fails due to racy repl.buffer.count metric in serverStatus</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="jesse@mongodb.com">A. Jesse Jiryu Davis</assignee>
                                    <reporter username="jesse@mongodb.com">A. Jesse Jiryu Davis</reporter>
                        <labels>
                    </labels>
                <created>Fri, 15 Nov 2019 21:19:42 +0000</created>
                <updated>Sun, 29 Oct 2023 22:14:51 +0000</updated>
                            <resolved>Tue, 19 Nov 2019 18:38:47 +0000</resolved>
                                    <version>3.6.15</version>
                                    <fixVersion>3.6.16</fixVersion>
                    <fixVersion>4.2.2</fixVersion>
                    <fixVersion>4.0.14</fixVersion>
                    <fixVersion>4.3.2</fixVersion>
                                    <component>Replication</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="2562645" author="xgen-internal-githook" created="Fri, 22 Nov 2019 20:19:49 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;A. Jesse Jiryu Davis&apos;, &apos;username&apos;: &apos;ajdavis&apos;, &apos;email&apos;: &apos;jesse@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-44675&quot; title=&quot;server_status_metrics.js fails due to racy repl.buffer.count metric in serverStatus&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-44675&quot;&gt;&lt;del&gt;SERVER-44675&lt;/del&gt;&lt;/a&gt; Handle race in repl metrics test&lt;br/&gt;
Branch: v4.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/e461d954679f23ae6b465d5fccd8e7afd492f41c&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/e461d954679f23ae6b465d5fccd8e7afd492f41c&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2562640" author="xgen-internal-githook" created="Fri, 22 Nov 2019 20:15:55 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;jesse@mongodb.com&apos;, &apos;name&apos;: &apos;A. Jesse Jiryu Davis&apos;, &apos;username&apos;: &apos;ajdavis&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-44675&quot; title=&quot;server_status_metrics.js fails due to racy repl.buffer.count metric in serverStatus&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-44675&quot;&gt;&lt;del&gt;SERVER-44675&lt;/del&gt;&lt;/a&gt; Handle race in repl metrics test&lt;br/&gt;
Branch: v4.2&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/257f01131fd83915c7ac6c5964075ce7a805569c&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/257f01131fd83915c7ac6c5964075ce7a805569c&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2562637" author="xgen-internal-githook" created="Fri, 22 Nov 2019 20:13:27 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;A. Jesse Jiryu Davis&apos;, &apos;username&apos;: &apos;ajdavis&apos;, &apos;email&apos;: &apos;jesse@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-44675&quot; title=&quot;server_status_metrics.js fails due to racy repl.buffer.count metric in serverStatus&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-44675&quot;&gt;&lt;del&gt;SERVER-44675&lt;/del&gt;&lt;/a&gt; Handle race in repl metrics test&lt;br/&gt;
Branch: v3.6&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/204ab367a130a4fd2db1c54b02cd6a86e4e07f56&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/204ab367a130a4fd2db1c54b02cd6a86e4e07f56&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2549768" author="jesse" created="Tue, 19 Nov 2019 18:39:34 +0000"  >&lt;p&gt;The BF that motivated this change is on the 3.6 branch. Let&apos;s backport all the way to 3.6.&lt;/p&gt;</comment>
                            <comment id="2548899" author="xgen-internal-githook" created="Tue, 19 Nov 2019 13:44:33 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;A. Jesse Jiryu Davis&apos;, &apos;username&apos;: &apos;ajdavis&apos;, &apos;email&apos;: &apos;jesse@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-44675&quot; title=&quot;server_status_metrics.js fails due to racy repl.buffer.count metric in serverStatus&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-44675&quot;&gt;&lt;del&gt;SERVER-44675&lt;/del&gt;&lt;/a&gt; Handle race in repl metrics test&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/04e8cf864b283af0d5355bc242e6bbab3b925246&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/04e8cf864b283af0d5355bc242e6bbab3b925246&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2548341" author="jesse" created="Tue, 19 Nov 2019 03:31:55 +0000"  >&lt;p&gt;Now that I&apos;ve looked at that code, I don&apos;t think it&apos;s the right answer for this bug. The code in check_transaction_server_status_invariants.js asserts that only a small percentage of serverStatus calls returned inconsistent metrics. For server_status_metrics.js however, we only have &lt;b&gt;one&lt;/b&gt; sample, so it&apos;s either right or wrong and we should handle wrong metrics by retrying for a short period.&lt;/p&gt;</comment>
                            <comment id="2547409" author="jesse" created="Mon, 18 Nov 2019 18:54:11 +0000"  >&lt;p&gt;Consider factoring the proposed retry loop with &lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/jstests/concurrency/fsm_workload_helpers/check_transaction_server_status_invariants.js#L113-L120&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;that in the transactions concurrency suite&apos;s serverStatus metrics tests&lt;/a&gt;, which also compensate for races like this one.&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>
                    </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>2.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16775"><![CDATA[v4.2]]></customfieldvalue>
    <customfieldvalue key="15640"><![CDATA[v4.0]]></customfieldvalue>
    <customfieldvalue key="15141"><![CDATA[v3.6]]></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>Tue, 19 Nov 2019 13:44:33 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        4 years, 11 weeks, 5 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_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_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, 11 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>8.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>jesse@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hw355j:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hvrezz:</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="3304">Repl 2019-11-18</customfieldvalue>
    <customfieldvalue id="3436">Repl 2019-12-02</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|hw2rev:</customfieldvalue>

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