<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:42:22 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-36201] Refactor coupled transactions metrics tracking code into methods</title>
                <link>https://jira.mongodb.org/browse/SERVER-36201</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Currently, there are some transactions metrics that are always updated together. We would like to group these metrics together and create methods that will allow us to update coupled metrics at the same time.&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;SingleTransactionStats::LastClientInfo::update&lt;/tt&gt;&#160;and&#160;&lt;tt&gt;SingleTransactionStats::OpDebug::AdditiveMetrics::add&lt;/tt&gt;&#160;are called together in&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;&lt;tt&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/mongo/db/session.cpp#L735-L748&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Session::stashTransactionResources&lt;/a&gt;&lt;/tt&gt;&lt;/li&gt;
	&lt;li&gt;&lt;tt&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/mongo/db/session.cpp#L923-L928&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Session::abortActiveTransaction&lt;/a&gt;&lt;/tt&gt;&lt;/li&gt;
	&lt;li&gt;&lt;tt&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/mongo/db/session.cpp#L1072-L1076&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Session::_commitTransaction&lt;/a&gt;&lt;/tt&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;tt&gt;SingleTransactionStats::setEndTime&lt;/tt&gt;&#160;and &lt;tt&gt;SingleTransactionStats::setInactive&lt;/tt&gt;&#160;are called together in&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;&lt;tt&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/mongo/db/session.cpp#L946-L949&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Session::_abortTransaction&lt;/a&gt;&lt;/tt&gt;&lt;/li&gt;
	&lt;li&gt;&lt;tt&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/mongo/db/session.cpp#L1103-L1106&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Session::_commitTransaction&lt;/a&gt;&lt;/tt&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;tt&gt;ServerTransactionMetrics::decrementCurrentOpen&lt;/tt&gt; and &lt;tt&gt;ServerTransactionMetrics::incrementTotalAborted&lt;/tt&gt; are called together in &lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;&lt;tt&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/mongo/db/session.cpp#L944-L952&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Session::_abortTransaction&lt;/a&gt;&lt;/tt&gt;&lt;/li&gt;
	&lt;li&gt;&lt;tt&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/mongo/db/session.cpp#L1068-L1069&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Session::_commitTransaction&lt;/a&gt;&lt;/tt&gt;.&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
        <key id="573493">SERVER-36201</key>
            <summary>Refactor coupled transactions metrics tracking code into methods</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="13201">Fixed</resolution>
                                        <assignee username="jinny.byun">Jinny Byun</assignee>
                                    <reporter username="jinny.byun">Jinny Byun</reporter>
                        <labels>
                            <label>global-txn-metrics</label>
                            <label>per-txn-metrics</label>
                    </labels>
                <created>Thu, 19 Jul 2018 19:43:52 +0000</created>
                <updated>Sun, 29 Oct 2023 22:29:43 +0000</updated>
                            <resolved>Fri, 17 Aug 2018 20:10:59 +0000</resolved>
                                                    <fixVersion>4.1.3</fixVersion>
                                    <component>Diagnostics</component>
                    <component>Replication</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1979279" author="xgen-internal-githook" created="Fri, 17 Aug 2018 20:09:49 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;jinichu&apos;, &apos;email&apos;: &apos;jinnybyun@gmail.com&apos;, &apos;username&apos;: &apos;jinichu&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-36201&quot; title=&quot;Refactor coupled transactions metrics tracking code into methods&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-36201&quot;&gt;&lt;del&gt;SERVER-36201&lt;/del&gt;&lt;/a&gt; Refactor transactions metrics tracking code into TransactionMetricsObserver&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/59d4d78a68ef6347120c6dfcd6da6ec3d325722f&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/59d4d78a68ef6347120c6dfcd6da6ec3d325722f&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1963608" author="william.schultz" created="Thu, 2 Aug 2018 00:38:57 +0000"  >&lt;p&gt;Note: As part of this refactor we might also want to make sure that we are using the same value of &quot;now&quot; when we update various stats in SingleTransactionStats collectively e.g.&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/70550cf9e211611c396020f0027bd64a6e5b99c0/src/mongo/db/session.cpp#L949-L953&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/blob/70550cf9e211611c396020f0027bd64a6e5b99c0/src/mongo/db/session.cpp#L949-L953&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1962268" author="william.schultz" created="Tue, 31 Jul 2018 23:20:17 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jinny.byun&quot; class=&quot;user-hover&quot; rel=&quot;jinny.byun&quot;&gt;jinny.byun&lt;/a&gt; A thought on the implementation strategy for this. We could consider creating a &lt;tt&gt;TransactionMetricsObserver&lt;/tt&gt; class, with methods like &lt;tt&gt;onStash&lt;/tt&gt;, &lt;tt&gt;onUnstash&lt;/tt&gt;, &lt;tt&gt;onCommit&lt;/tt&gt;, &lt;tt&gt;onAbort&lt;/tt&gt;, etc., that get called when the appropriate transaction event occurs. We could consider defining this class in a separate file, but making it a friend class of &lt;tt&gt;Session&lt;/tt&gt; (or eventually &lt;tt&gt;TransactionParticipant&lt;/tt&gt;). That way it would still have access to the private members of &lt;tt&gt;Session&lt;/tt&gt;. For each observer method, we could simply pass in the necessary state needed to update the relevant metrics as function arguments. If we refactor the existing metrics tracking logic in accordance with this, it may allow us to condense most of the metrics update logic inside &lt;tt&gt;Session&lt;/tt&gt; to a few method calls throughout the file. Most of the substantial metric tracking logic would exist inside the &lt;tt&gt;TransactionsMetricsObserver&lt;/tt&gt; handler functions. This could potentially make backporting all of the transactions metrics changes to 4.0 much easier, if the only changes to &lt;tt&gt;Session&lt;/tt&gt; are a few scattered method calls.&#160;&lt;tt&gt;TransactionsMetricsObserver&lt;/tt&gt;&#160;would be a new file that encapsulates most of the metrics tracking logic, so backporting it would not be an issue.&lt;/p&gt;</comment>
                            <comment id="1961301" author="william.schultz" created="Tue, 31 Jul 2018 13:20:33 +0000"  >&lt;p&gt;We will not necessarily aim to backport this to 4.0.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4.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_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, 31 Jul 2018 13:20:33 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        5 years, 25 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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-1091</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>
                            5 years, 25 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>jinny.byun</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|hu2z13:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|htu48n:</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="2447">Repl 2018-08-13</customfieldvalue>
    <customfieldvalue id="2448">Repl 2018-08-27</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|hu2laf:</customfieldvalue>

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