<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:26:58 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-74265] Create class for concurrent relaxed readers</title>
                <link>https://jira.mongodb.org/browse/SERVER-74265</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Some TSAN failures are not an actual issue as the reader already can accept relaxed memory semantics and there&apos;s only a single separate writer thread.&lt;/p&gt;

&lt;p&gt;This is the case most notably with all of our metrics. Most of the time the solution performed is to wrap the value in an AtomicWord and perform the operations using that wrapper. However, the writes are performed with strong ordering guarantees that have a slight overhead. These aren&apos;t really necessary as there&apos;s only one writer thread that is the same throughout the metric&apos;s lifetime and the readers can accept relaxed memory semantics.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-72481&quot; title=&quot;Use relaxed atomic operations for LockStats&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-72481&quot;&gt;SERVER-72481&lt;/a&gt; for example found that using AtomicWord semantics for the metrics contributed to a 0.8% regression. The same ticket asks for creating a better version for metrics that generates the same assembly code but explicitly tells TSAN that it&apos;s fine.&lt;/p&gt;

&lt;p&gt;To avoid the boilerplate process of solving these TSAN failures with AtomicWord we could try to have a class that acts as if it&apos;s the normal variable yet offers relaxed atomic semantics. Whenever we encounter a TSAN failure that we can match with this pattern we would simply wrap the type with this class and be done with the change.&lt;/p&gt;</description>
                <environment></environment>
        <key id="2272197">SERVER-74265</key>
            <summary>Create class for concurrent relaxed readers</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="2">Won&apos;t Fix</resolution>
                                        <assignee username="backlog-server-servicearch">Backlog - Service Architecture</assignee>
                                    <reporter username="jordi.olivares-provencio@mongodb.com">Jordi Olivares Provencio</reporter>
                        <labels>
                    </labels>
                <created>Wed, 22 Feb 2023 15:43:17 +0000</created>
                <updated>Thu, 16 Mar 2023 01:41:01 +0000</updated>
                            <resolved>Thu, 16 Mar 2023 01:41:01 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="5276309" author="billy.donahue" created="Thu, 16 Mar 2023 01:36:42 +0000"  >&lt;p&gt;We&apos;re gonna close this in favor of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-74931&quot; title=&quot;Add AtomicWord::storeRelaxed&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-74931&quot;&gt;&lt;del&gt;SERVER-74931&lt;/del&gt;&lt;/a&gt;, which is to add storeRelaxed to AtomicWord.&lt;/p&gt;

&lt;p&gt;The concurrent relaxed readers pattern being captured in a utility class is perhaps still valuable.&lt;br/&gt;
But we can start with the storeRelaxed and build from that.&lt;/p&gt;</comment>
                            <comment id="5225641" author="billy.donahue" created="Thu, 23 Feb 2023 16:48:50 +0000"  >&lt;p&gt;It should be ok to add to AtomicWord.&lt;br/&gt;
it should not be more of a &quot;footgun&quot; than loadRelaxed.&lt;/p&gt;

&lt;p&gt;Changing to a facade type as proposed could be inconvenient for interoperability with AtomicWord, so I&apos;m not in favor of that.&lt;/p&gt;

&lt;p&gt;All we need is one more kind of operation on AtomicWord and adding it is super easy. Duplicating the AtomicWord API in another class is much harder to make, maintain over time,  teach or discover.&lt;/p&gt;

&lt;p&gt;If the storeRelaxed should be used with caution, we can be sure document it. I assume we would write appropriate docs regardless.&lt;/p&gt;</comment>
                            <comment id="5225265" author="JIRAUSER1264163" created="Thu, 23 Feb 2023 15:36:27 +0000"  >&lt;p&gt;Yes, but I wouldn&apos;t add that to AtomicWord since it&apos;s a footgun ripe for misuse. My idea was to create a look-alike AtomicWord class that implements all the operators in terms of AtomicWord so it acts as a drop-in replacement without having to make everything use AtomicWord methods to access the data.&lt;/p&gt;</comment>
                            <comment id="5225149" author="billy.donahue" created="Thu, 23 Feb 2023 15:12:03 +0000"  >&lt;p&gt;it sounds like you might just need a AtomicWord::storeRelaxed operation.&lt;/p&gt;</comment>
                            <comment id="5221588" author="JIRAUSER1264163" created="Wed, 22 Feb 2023 16:18:02 +0000"  >&lt;p&gt;Sure:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-74263&quot; title=&quot;Avoid data race in AdmissionContext&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-74263&quot;&gt;&lt;del&gt;SERVER-74263&lt;/del&gt;&lt;/a&gt; is one where the AdmissionPriority is only read by curOp&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-48687&quot; title=&quot;ReplicationCoordinatorMock is not thread safe and causes errors with tsan&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-48687&quot;&gt;&lt;del&gt;SERVER-48687&lt;/del&gt;&lt;/a&gt; notably considers the data races as benign so the extra mutex is unnecessary&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-50240&quot; title=&quot;Make CurOp::_numYields atomic&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-50240&quot;&gt;&lt;del&gt;SERVER-50240&lt;/del&gt;&lt;/a&gt; also deals with curOp&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-73591&quot; title=&quot;Data race involving SorterFileStats::_bytesSpilled &quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-73591&quot;&gt;&lt;del&gt;SERVER-73591&lt;/del&gt;&lt;/a&gt; fixed the problem but sadly affected query execution even if it wasn&apos;t susceptible to it&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-74088&quot; title=&quot;Fix data race on batchedCatalogWriteInstance&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-74088&quot;&gt;&lt;del&gt;SERVER-74088&lt;/del&gt;&lt;/a&gt; also mentions that the race is benign and doesn&apos;t cause any issues&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-70785&quot; title=&quot;data race on the _rsConfigState field inside waitUntilOpTimeForReadUntil&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-70785&quot;&gt;&lt;del&gt;SERVER-70785&lt;/del&gt;&lt;/a&gt; for a more recent case where this is considered also benign and resulted in adding a mutex that is potentially unnecessary.&lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="5221422" author="JIRAUSER1263153" created="Wed, 22 Feb 2023 15:50:43 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jordi.olivares-provencio%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;jordi.olivares-provencio@mongodb.com&quot;&gt;jordi.olivares-provencio@mongodb.com&lt;/a&gt; could you link to some examples where this happens (other than LockStats)?&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="2289562">SERVER-74931</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>6.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25132"><![CDATA[Service Arch]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 22 Feb 2023 15:50:43 +0000</customfieldvalue>

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


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>billy.donahue@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            47 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>backlog-server-servicearch</customfieldvalue>
            <customfieldvalue>billy.donahue@mongodb.com</customfieldvalue>
            <customfieldvalue>daniel.gomezferro@mongodb.com</customfieldvalue>
            <customfieldvalue>jordi.olivares-provencio@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i1xblr:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i1fqq0:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i1wxr3:</customfieldvalue>

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