<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:43:50 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-36697] Use virtual clock for transactions metrics unit tests</title>
                <link>https://jira.mongodb.org/browse/SERVER-36697</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Currently, &lt;a href=&quot;https://github.com/mongodb/mongo/blob/4572ac2e9b78d9a42ce607e5442bf440f1a1180a/src/mongo/db/transaction_participant_test.cpp#L2563-L2665&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;many of the unit tests&lt;/a&gt; for transactions metrics in &lt;tt&gt;transaction_participant_test.cpp&lt;/tt&gt; use real time sleeps in order to measure the passage of time and to check assertions.This can make the tests flaky and also slow. We should try to virtualize the clock source used for these tests to circumvent these issues.&lt;/p&gt;</description>
                <environment></environment>
        <key id="589353">SERVER-36697</key>
            <summary>Use virtual clock for transactions metrics unit tests</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="william.schultz@mongodb.com">William Schultz</assignee>
                                    <reporter username="william.schultz@mongodb.com">William Schultz</reporter>
                        <labels>
                    </labels>
                <created>Thu, 16 Aug 2018 14:46:20 +0000</created>
                <updated>Sun, 29 Oct 2023 22:28:55 +0000</updated>
                            <resolved>Wed, 3 Oct 2018 02:26:18 +0000</resolved>
                                                    <fixVersion>4.1.4</fixVersion>
                                    <component>Replication</component>
                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="2021584" author="xgen-internal-githook" created="Wed, 3 Oct 2018 01:58:26 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;William Schultz&apos;, &apos;email&apos;: &apos;william.schultz@mongodb.com&apos;, &apos;username&apos;: &apos;will62794&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-36697&quot; title=&quot;Use virtual clock for transactions metrics unit tests&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-36697&quot;&gt;&lt;del&gt;SERVER-36697&lt;/del&gt;&lt;/a&gt; Utilize TickSource for transactions timing metrics&lt;/p&gt;

&lt;p&gt;This patch converts the existing transactions diagnostics timing related&lt;br/&gt;
metrics to use a TickSource to record transaction durations. The&lt;br/&gt;
TickSource is a high precision, mock-able time source for measuring&lt;br/&gt;
the passage of time. This patch also converts the existing unit tests&lt;br/&gt;
to use a mock TickSource, which allows the tests to fully virtualize&lt;br/&gt;
time, making them much faster and less flaky.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/982ba21e0ffbdaaf766dc8fa060728ba9b5f4914&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/982ba21e0ffbdaaf766dc8fa060728ba9b5f4914&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2014983" author="william.schultz" created="Wed, 26 Sep 2018 15:24:38 +0000"  >&lt;p&gt;After working on a patch for this, I unfortunately think it may be sensible to forgo the clock virtualization for these tests. For one, I realized that the slowness of these unit tests doesn&apos;t necessarily come from the fact they use real time sleeps. For example, the regular &lt;tt&gt;TxnParticipantTest&lt;/tt&gt; unit tests, which include almost no metrics tests, already report the following runtime:&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;TxnParticipantTest             | tests:   62 | fails:    0 | assert calls:          0 | time secs:  4.093&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;so it seems like in general the unit tests in &lt;tt&gt;TxnParticipantTest&lt;/tt&gt; are just a bit slow. Additionally, the changes necessary to virtualize the clock source for all of these tests leads to a fair amount of code churn, and I doubt that the changes would apply cleanly in a 4.0 backport, which would be necessary if we wanted to fix the test issues on 4.0 as well. Originally this ticket grew out of an attempt to address BFs that arose as a result of these tests depending on real time. At this point, I think it may just be better to fix those issues in an ad hoc manner. Also, the virtualization changes would lead to some changes about how we track metrics internally, and this could lead to divergence between 4.0 and 4.2 on how these metrics are tracked, which I think might be nice to avoid. &lt;/p&gt;</comment>
                            <comment id="2009780" author="william.schultz" created="Thu, 20 Sep 2018 20:31:12 +0000"  >&lt;p&gt;After investigation, it looks like &lt;tt&gt;TickSource&lt;/tt&gt; may actually be the right thing to use, since it is high precision and mock-able.&lt;/p&gt;</comment>
                            <comment id="1979014" author="schwerin" created="Fri, 17 Aug 2018 17:19:23 +0000"  >&lt;p&gt;I think we could pull this off pretty easily. With a small amount of extra work, we could introduce a high-resolution time point type for the return type of the curTimeMicros64 alternative. That could certainly be done separately, though.&lt;/p&gt;</comment>
                            <comment id="1977686" author="william.schultz" created="Thu, 16 Aug 2018 18:07:40 +0000"  >&lt;p&gt;One solution may be to just add a &lt;tt&gt;curTimeMicros&lt;/tt&gt; method to &lt;tt&gt;ClockSource&lt;/tt&gt; so that we can get the current time in microsecond resolution from a &lt;tt&gt;ClockSource&lt;/tt&gt;. Then we can use a MockClockSource in the unit tests. We would need to change calls to the free function &lt;tt&gt;curTimeMicros64&lt;/tt&gt; in &lt;tt&gt;transaction_participant.cpp&lt;/tt&gt; to get the time from the clock source. May be a bit tricky though since ClockSource tracks time in millisecond resolution.&lt;/p&gt;</comment>
                            <comment id="1977365" author="william.schultz" created="Thu, 16 Aug 2018 14:57:03 +0000"  >&lt;p&gt;This may be the best fix for the linked build failures.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10420">
                    <name>Backports</name>
                                            <outwardlinks description="backported by">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="609821">SERVER-37317</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="594000">SERVER-36846</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>6.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.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>Fri, 17 Aug 2018 17:19:23 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        5 years, 19 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_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>
                            5 years, 19 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>34.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>schwerin@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>william.schultz@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hu5o53:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|htw9gf:</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="2483">Repl 2018-09-10</customfieldvalue>
    <customfieldvalue id="2484">Repl 2018-09-24</customfieldvalue>
    <customfieldvalue id="2541">Repl 2018-10-08</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|hu5aef:</customfieldvalue>

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