<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:02:19 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-43119] FailPoint API can be significantly improved in C++17</title>
                <link>https://jira.mongodb.org/browse/SERVER-43119</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Our FailPoint API has several significant deficiencies.&lt;br/&gt;
It&apos;s hard to itemize them in a Jira ticket, but I&apos;ll try.&lt;/p&gt;

&lt;p&gt;I&apos;ve made code changes to show where I feel it should go.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://mongodbcr.appspot.com/512010001/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://mongodbcr.appspot.com/512010001/&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;https://mongodbcr.appspot.com/475530001/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://mongodbcr.appspot.com/475530001/&lt;/a&gt; (enterprise)&lt;/p&gt;

&lt;p&gt;The FailPoint::shouldFailOpenBlock and FailPoint::shouldFailCloseBlock are very hard to explain, and the docs are (necessarily) unclear. Nobody uses these functions anyway. They use the similarly obscure variadic MONGO_FAIL_POINT_BLOCK{_IF} macros. Can make these private and expose only 4 block-related functions: &lt;tt&gt;execute(F)&lt;/tt&gt;, &lt;tt&gt;executeIf(F,Pred)&lt;/tt&gt;, &lt;tt&gt;scoped()&lt;/tt&gt;, and &lt;tt&gt;scopedIf(Pred)&lt;/tt&gt; for relatively infrequent situations requiring finer flow control. &lt;tt&gt;RetCode&lt;/tt&gt; is complex and need not be public. Many uses of the MONGO_FAIL_POINT_BLOCK macro would be more efficiently rendered with a predicate but weren&apos;t, I think because it&apos;s hard to figure out how to use this old API.&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;   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;void MONGO_FAIL_POINT_PAUSE_WHILE_SET(FailPoint&amp;amp; failPoint);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&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-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;void MONGO_FAIL_POINT_PAUSE_WHILE_SET_OR_INTERRUPTED(FailPoint&amp;amp; failPoint, OperationContext*opCtx);&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;These are not even macros, but they used to be and were rewritten as functions without being renamed (out of laziness I guess). Anyway these easily can be member functions of &lt;tt&gt;FailPoint&lt;/tt&gt;: &lt;tt&gt;.pauseWhileSet()&lt;/tt&gt; and &lt;tt&gt;.pauseWhileSet(opCtx)&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;#define MONGO_FAIL_POINT(symbol) MONGO_unlikely(symbol.shouldFail())&lt;/tt&gt;&lt;br/&gt;
Doesn&apos;t pull its weight and has a confusing name. Removed. We don&apos;t make a new macro for every unlikely predicate in our codebase. It&apos;s sufficient to give advice in the docs for &lt;tt&gt;shouldFail()&lt;/tt&gt;, advising users to wrap it in &lt;tt&gt;MONGO_unlikely&lt;/tt&gt;. I&apos;ve inlined all existing uses of this macro to seed the example pool.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The most important upgrade in this ticket&lt;/em&gt;:  Bring class ScopedFailPoint inside the FailPoint class, as FailPoint::Scoped. It can be easily understood and documented as a refcount holder. Mandatory Copy Elision (MCE) in &lt;tt&gt;C+&lt;ins&gt;17&lt;/tt&gt; makes this much easier to write properly. We can just return an immovable Scoped object from the scoped() and scopedIf(pred) members and it will have proper RAII refcounting semantics. We can get rid of the very weird behavior of &lt;tt&gt;isActive()&lt;/tt&gt; returning true &quot;at most once&quot; and using the &lt;tt&gt;ScopedFailPoint&lt;/tt&gt; in &lt;tt&gt;for&lt;/tt&gt; loops. The for loop was just a hack to get a scoped decl for the loop variable, but you can do that with `if` statements now in &lt;tt&gt;C&lt;/ins&gt;+17&lt;/tt&gt;, so all the trickery can be deleted.&lt;/p&gt;

&lt;p&gt;Get rid of &lt;tt&gt;std::tuple&lt;/tt&gt; and &lt;tt&gt;std::tie&lt;/tt&gt; in parseBSON. Easier and clearer to make a struct representing the parsed data.&lt;/p&gt;

&lt;p&gt;We don&apos;t need a &lt;tt&gt;MONGO_INITIALIZER&lt;/tt&gt; for each &lt;tt&gt;FailPoint&lt;/tt&gt;. The FailPoint initialization (and possible export as ServerParameters) can all happen in one initializer. These are just bloating the mongo initializer graph. They can all get added directly to the `globalFailPointRegistry` by a static-duration registration object&apos;s initializer. There&apos;s no user-visible API change for this, as all the registered fail points are created with a MONGO_FAIL_POINT_DEFINE macro.&lt;/p&gt;

&lt;p&gt;Don&apos;t need the &lt;tt&gt;MONGO_FAIL_POINT_DECLARE(name)&lt;/tt&gt; macro. Users can write &lt;tt&gt;extern FailPoint name;&lt;/tt&gt; directly where needed. It&apos;s actually easier to write. Too many macros, and this one in particular used to be completely wrong, making a definition rather than a mere extern declaration. Of course there&apos;s no room for misinterpretation when what users type out is native &lt;tt&gt;C++&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;FailPointEnableBlock&lt;/tt&gt; needs an &lt;tt&gt;explicit&lt;/tt&gt; on its 1-arg ctor.&lt;/p&gt;

</description>
                <environment></environment>
        <key id="914788">SERVER-43119</key>
            <summary>FailPoint API can be significantly improved in C++17</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="13201">Fixed</resolution>
                                        <assignee username="billy.donahue@mongodb.com">Billy Donahue</assignee>
                                    <reporter username="billy.donahue@mongodb.com">Billy Donahue</reporter>
                        <labels>
                    </labels>
                <created>Sun, 1 Sep 2019 22:07:25 +0000</created>
                <updated>Sun, 29 Oct 2023 22:17:32 +0000</updated>
                            <resolved>Tue, 10 Sep 2019 21:37:38 +0000</resolved>
                                                    <fixVersion>4.3.1</fixVersion>
                                    <component>Internal Code</component>
                                        <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="2505705" author="billy.donahue" created="Mon, 28 Oct 2019 21:29:49 +0000"  >&lt;p&gt;ok let&apos;s discuss possibilities on BACKPORT-5479&lt;/p&gt;</comment>
                            <comment id="2441320" author="billy.donahue" created="Mon, 30 Sep 2019 21:27:38 +0000"  >&lt;p&gt;Dan, sorry I missed this comment when you posted it, and you&apos;re right. I&apos;m trying to make the thing EASIER to use, so the last thing I&apos;d want is for the upgrades to catch users off guard. Sorry about that. I&apos;m going to combine all the failpoint APIs into one header, centralize and refresh its documentation there, and post a heads-up to kernel@ before committing that change (&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-43317&quot; title=&quot;Update failPoint documentation&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-43317&quot;&gt;&lt;del&gt;SERVER-43317&lt;/del&gt;&lt;/a&gt;).&lt;/p&gt;</comment>
                            <comment id="2415085" author="xgen-internal-githook" created="Tue, 10 Sep 2019 19:03:50 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Billy Donahue&apos;, &apos;username&apos;: &apos;BillyDonahue&apos;, &apos;email&apos;: &apos;billy.donahue@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-43119&quot; title=&quot;FailPoint API can be significantly improved in C++17&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-43119&quot;&gt;&lt;del&gt;SERVER-43119&lt;/del&gt;&lt;/a&gt; FailPoint cleanup&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Don&apos;t use MONGO_INITIALIZER to declare each fail point.&lt;br/&gt;
  We only need one init task in total: freeze and iterate the registry.&lt;/li&gt;
&lt;/ul&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;remove MONGO_FAIL_POINT_DECLARE macro (extern)&lt;/li&gt;
	&lt;li&gt;remove MONGO_FAIL_POINT_SHOULD_FAIL macro (FailPoint::shouldFail)&lt;/li&gt;
	&lt;li&gt;remove MONGO_FAIL_POINT_BLOCK_IF (FailPoint::executeIf)&lt;/li&gt;
	&lt;li&gt;remove MONGO_FAIL_POINT_BLOCK (FailPoint::execute)&lt;/li&gt;
	&lt;li&gt;clean up FailPointRegistry and fail_point_service implementation.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/5a0f718e1309a4484580d8038016d043ef3b887f&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/5a0f718e1309a4484580d8038016d043ef3b887f&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="2415084" author="xgen-internal-githook" created="Tue, 10 Sep 2019 19:03:39 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Billy Donahue&apos;, &apos;username&apos;: &apos;BillyDonahue&apos;, &apos;email&apos;: &apos;billy.donahue@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-43119&quot; title=&quot;FailPoint API can be significantly improved in C++17&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-43119&quot;&gt;&lt;del&gt;SERVER-43119&lt;/del&gt;&lt;/a&gt; FailPoint cleanup&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/10gen/mongo-enterprise-modules/commit/c366ab7e33fdeb4365df8bb2f4b902dcb7cc8f22&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/10gen/mongo-enterprise-modules/commit/c366ab7e33fdeb4365df8bb2f4b902dcb7cc8f22&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2405544" author="billy.donahue" created="Tue, 3 Sep 2019 15:58:38 +0000"  >&lt;p&gt;Code Reviews:&lt;/p&gt;


&lt;p&gt;&lt;a href=&quot;https://mongodbcr.appspot.com/512010001/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://mongodbcr.appspot.com/512010001/&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;https://mongodbcr.appspot.com/475530001/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://mongodbcr.appspot.com/475530001/&lt;/a&gt; (enterprise)&lt;/p&gt;
</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10420">
                    <name>Backports</name>
                                            <outwardlinks description="backported by">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10520">
                    <name>Problem/Incident</name>
                                            <outwardlinks description="causes">
                                        <issuelink>
            <issuekey id="925885">SERVER-43317</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>5.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>
    
                        </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, 10 Sep 2019 19:03:39 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        4 years, 15 weeks, 2 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, 15 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>20.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>billy.donahue@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|hvo6jb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hvcxcn:</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="3246">Dev Tools 2019-09-09</customfieldvalue>
    <customfieldvalue id="3280">Dev Tools 2019-09-23</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|hvnssn:</customfieldvalue>

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