<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:15: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-47926] Less verbose uassert</title>
                <link>https://jira.mongodb.org/browse/SERVER-47926</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Currently, uasserts log at debug level D1. As we move to more use of exceptions to deal with error handling, we should probably consider adjusting our logging policy for uasserts. Maybe we should only log when we&apos;re returning an error to the user instead of whenever we throw an exception.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1338896">SERVER-47926</key>
            <summary>Less verbose uassert</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="3">Duplicate</resolution>
                                        <assignee username="ben.caimano@mongodb.com">Benjamin Caimano</assignee>
                                    <reporter username="lingzhi.deng@mongodb.com">Lingzhi Deng</reporter>
                        <labels>
                    </labels>
                <created>Mon, 4 May 2020 15:28:55 +0000</created>
                <updated>Thu, 12 Nov 2020 17:44:21 +0000</updated>
                            <resolved>Thu, 12 Nov 2020 17:37:07 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>8</watches>
                                                                                                                <comments>
                            <comment id="3487908" author="lingzhi.deng" created="Thu, 12 Nov 2020 17:44:21 +0000"  >&lt;p&gt;Sounds good to me. Thanks for the work!&lt;/p&gt;</comment>
                            <comment id="3487887" author="ben.caimano" created="Thu, 12 Nov 2020 17:37:07 +0000"  >&lt;p&gt;Alright, I&apos;m closing this as a duplicate of both &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-48922&quot; title=&quot;Create internal assertion macro&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-48922&quot;&gt;&lt;del&gt;SERVER-48922&lt;/del&gt;&lt;/a&gt; and &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-44570&quot; title=&quot;Create a non process-fatal variant of invariant()&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-44570&quot;&gt;&lt;del&gt;SERVER-44570&lt;/del&gt;&lt;/a&gt;. We now have both less verbose uassert &lt;em&gt;and&lt;/em&gt; more verbose uassert. &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=lingzhi.deng&quot; class=&quot;user-hover&quot; rel=&quot;lingzhi.deng&quot;&gt;lingzhi.deng&lt;/a&gt;, if you feel that we haven&apos;t met your needs, please let me know either by reopening this ticket or filing a new one.&lt;/p&gt;</comment>
                            <comment id="3223756" author="amirsaman.memaripour" created="Thu, 25 Jun 2020 14:02:13 +0000"  >&lt;p&gt;Now that we have&#160;&lt;tt&gt;internalAssert&lt;/tt&gt; (&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-48922&quot; title=&quot;Create internal assertion macro&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-48922&quot;&gt;&lt;del&gt;SERVER-48922&lt;/del&gt;&lt;/a&gt;), can we close this ticket?&lt;/p&gt;</comment>
                            <comment id="3096247" author="ben.caimano" created="Tue, 19 May 2020 21:26:55 +0000"  >&lt;p&gt;Apologies on the slow response, it&apos;s been a busy couple of weeks.&lt;/p&gt;

&lt;p&gt;Laying out my thoughts:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;This ticket as written seems like a natural pairing with the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/c650768/src/mongo/logv2/README.md#combining-uassert-with-log-statement&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;UserAssertAfterLog tag&lt;/a&gt;, which can be passed to any level of LOGV2 statement. Sadly, when I traced the code path, it looks like perhaps that tag will cause us to log twice, once at the desired level and once at D1 (see the raw &lt;tt&gt;uasserted&lt;/tt&gt;&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/7b42c50a8d89c53d4a86b26497be19047ea68861/src/mongo/logv2/uassert_sink.h#L51&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;). We could fix that up pretty easily as a way to offer &quot;internal&quot; user assertions that log at a desired level.&lt;/li&gt;
	&lt;li&gt;I think the concept of an internal-only exception pattern seems like it has been useful to Replication. ServiceArch probably has an equivalent usage of exceptions with CallbackCanceled. If we do go this route, I think I&apos;d want &lt;em&gt;something&lt;/em&gt; that throws a new type. That new type could be derived from AssertionException or just the ExceptionForCat for a new ErrorCategory (see &lt;a href=&quot;https://github.com/mongodb/mongo/blob/ec8ef5998028c6ea5e9e01c9780765d7c76b4f1e/src/mongo/util/assert_util.h#L149-L168&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;). This would allow us to make a separate code path when error handling and potentially ban these errors from reaching the user. We could probably quick win this kind of work simultaneously with&#160;PM-1620.&lt;/li&gt;
	&lt;li&gt;Anything we do along these lines will be awkward to integrate with &lt;tt&gt;uassertStatusOK&lt;/tt&gt;. Sometimes people catch-throw, futurize, or otherwise convert between Status and DBException. As is, I believe we log some errors multiple times because of this. The least intrusive thing I can think of is to reuse &lt;tt&gt;uassert&lt;/tt&gt; but only log and increment the counter if the ErrorCode involved isn&apos;t in a special ErrorCategory.&lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="3068200" author="schwerin" created="Mon, 4 May 2020 21:48:35 +0000"  >&lt;p&gt;Hmmm... &lt;tt&gt;iassert&lt;/tt&gt;? Having the exceptions built and thrown by a helper has been useful.&lt;/p&gt;</comment>
                            <comment id="3068177" author="lingzhi.deng" created="Mon, 4 May 2020 21:32:56 +0000"  >&lt;p&gt;Yes, after reading Kelsey&apos;s comment in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-47881&quot; title=&quot;Make ReplicationCoordinatorImpl::getLatestWriteOpTime return StatusWith&amp;lt;OpTime&amp;gt;&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-47881&quot;&gt;&lt;del&gt;SERVER-47881&lt;/del&gt;&lt;/a&gt;, I think this makes sense.&lt;/p&gt;</comment>
                            <comment id="3068172" author="milkie" created="Mon, 4 May 2020 21:29:01 +0000"  >&lt;p&gt;I don&apos;t think we need to change the behavior of uassert; I think we need to not abuse them as ways of throwing internal exceptions.  Instead, we should be using &quot;throw&quot; in these situations.&lt;br/&gt;
The u in uassert is for &quot;user&quot; &amp;#8211; that is, this is a problem that needs to &lt;b&gt;always&lt;/b&gt; be elevated all the way back to the client and the user.  It shouldn&apos;t be caught and converted into something else.  Note that we also have a counter for uasserts that shows up in Atlas and is useful for triaging.  We shouldn&apos;t be suppressing uasserts by catching them since the counter will still be incremented.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="1382808">SERVER-48922</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="997318">SERVER-44570</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1377011">SERVER-48688</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="1335798">SERVER-47881</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>7.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 4 May 2020 21:29:01 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        3 years, 12 weeks, 6 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_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>lingzhi.deng@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            3 years, 12 weeks, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>amirsaman.memaripour@mongodb.com</customfieldvalue>
            <customfieldvalue>schwerin@mongodb.com</customfieldvalue>
            <customfieldvalue>ben.caimano@mongodb.com</customfieldvalue>
            <customfieldvalue>milkie@mongodb.com</customfieldvalue>
            <customfieldvalue>lingzhi.deng@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hxjd53:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hx6q8v:</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="3840">Service arch 2020-05-18</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|hxizef:</customfieldvalue>

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