<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:53:36 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-39949] Replace uses of UninterruptibleLockGuard in TransactionParticipant</title>
                <link>https://jira.mongodb.org/browse/SERVER-39949</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;We&apos;ve added UninterruptibleLockGuards in certain parts of the TransactionParticipant to prevent interruptibility. UninterruptibleLockGuards don&apos;t stop all types of interruptions, just ones in locks. This should be done after &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-39643&quot; title=&quot;Replace UninterruptibleLockGuard with runWithoutInterruption() in shutdown&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-39643&quot;&gt;&lt;del&gt;SERVER-39643&lt;/del&gt;&lt;/a&gt; based on the outcome of that discussion.&lt;/p&gt;</description>
                <environment></environment>
        <key id="709098">SERVER-39949</key>
            <summary>Replace uses of UninterruptibleLockGuard in TransactionParticipant</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="2">Won&apos;t Fix</resolution>
                                        <assignee username="backlog-server-repl">Backlog - Replication Team</assignee>
                                    <reporter username="judah.schvimer@mongodb.com">Judah Schvimer</reporter>
                        <labels>
                            <label>prepare_errors</label>
                            <label>prepare_optional</label>
                    </labels>
                <created>Mon, 4 Mar 2019 21:04:48 +0000</created>
                <updated>Tue, 6 Dec 2022 03:04:24 +0000</updated>
                            <resolved>Fri, 17 May 2019 18:42:10 +0000</resolved>
                                                                    <component>Replication</component>
                                        <votes>0</votes>
                                    <watches>6</watches>
                                                                                                                <comments>
                            <comment id="2175183" author="judah.schvimer" created="Thu, 7 Mar 2019 22:06:14 +0000"  >&lt;p&gt;I moved it per your suggestion. I am concerned that we could add another interrupt point and forget to change this. That said, it would lead to a crash, not data corruption, so we can fix it then. Moved it to &quot;prepare_optional&quot;.&lt;/p&gt;</comment>
                            <comment id="2175097" author="siyuan.zhou@10gen.com" created="Thu, 7 Mar 2019 21:18:05 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=judah.schvimer&quot; class=&quot;user-hover&quot; rel=&quot;judah.schvimer&quot;&gt;judah.schvimer&lt;/a&gt;, given Dan and Eric&apos;s comments above, I think it&apos;s correct to use UninterruptibleLockGuard since the only thing that can call &lt;tt&gt;checkForInterrupt()&lt;/tt&gt; for the above two cases is lock acquisition. The case in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-39643&quot; title=&quot;Replace UninterruptibleLockGuard with runWithoutInterruption() in shutdown&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-39643&quot;&gt;&lt;del&gt;SERVER-39643&lt;/del&gt;&lt;/a&gt; is different since we need to check out a session there, which isn&apos;t covered by UninterruptibleLockGuard. It might be a good code cleanup to use &lt;tt&gt;runWithoutInterruptionExceptAtGlobalShutdown&lt;/tt&gt; instead, but I don&apos;t think it&apos;s urgent. I&apos;d suggest putting this ticket to backlog.&lt;/p&gt;</comment>
                            <comment id="2173197" author="milkie" created="Wed, 6 Mar 2019 20:02:14 +0000"  >&lt;p&gt;Yes; on primaries, we take steps to make sure that assumption is true even on one-node replica sets by setting the stable optime carefully (see ReplicationCoordinatorImpl::_chooseStableOpTimeFromCandidates()).  It&apos;s always true on secondaries because the logic for doing writes is different there.&lt;/p&gt;</comment>
                            <comment id="2173172" author="daniel.gottlieb@10gen.com" created="Wed, 6 Mar 2019 19:49:59 +0000"  >&lt;p&gt;A node cannot checkpoint in front of the &lt;tt&gt;all_committed&lt;/tt&gt; (i.e: the &lt;tt&gt;stable_timestamp&lt;/tt&gt; cannot be in front of the &lt;tt&gt;all_committed&lt;/tt&gt;). Making that true in all configurations (single voting primaries, EMRC=off) isn&apos;t trivial, but fundamentally, that invariant must hold or else replication recovery wouldn&apos;t start from the correct point in the oplog and could miss entries earlier than the &quot;checkpoint timestamp&quot;.&lt;/p&gt;</comment>
                            <comment id="2173065" author="judah.schvimer" created="Wed, 6 Mar 2019 19:04:20 +0000"  >&lt;blockquote&gt;
&lt;p&gt;it will be safe if a node can never take a checkpoint beyond all_committed.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=daniel.gottlieb&quot; class=&quot;user-hover&quot; rel=&quot;daniel.gottlieb&quot;&gt;daniel.gottlieb&lt;/a&gt; or &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=milkie&quot; class=&quot;user-hover&quot; rel=&quot;milkie&quot;&gt;milkie&lt;/a&gt;, this sounds like a fair assumption, do you agree? We only take checkpoints at &lt;tt&gt;stable_timestamps&lt;/tt&gt; which are always behind the &lt;tt&gt;all_committed&lt;/tt&gt; by definition, so I think we&apos;re good. &lt;/p&gt;</comment>
                            <comment id="2173059" author="siyuan.zhou@10gen.com" created="Wed, 6 Mar 2019 19:01:50 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=judah.schvimer&quot; class=&quot;user-hover&quot; rel=&quot;judah.schvimer&quot;&gt;judah.schvimer&lt;/a&gt; pointed out the only places that check for interrupts in those two cases are all about lock acquisition, so I think it&apos;s at least correct to keep using&#160;UninterruptibleLockGuards for now. When we want to make shutdown not blocked by these two oplog writes in the future, we could use &lt;tt&gt;runWithoutInterruptionExceptAtGlobalShutdown&lt;/tt&gt; instead and allow exceptions thrown. They will be caught higher in the stack to return an error status to the client. The data should be consistent anyway as Judah mentioned above.&lt;/p&gt;</comment>
                            <comment id="2173037" author="siyuan.zhou@10gen.com" created="Wed, 6 Mar 2019 18:53:48 +0000"  >&lt;blockquote&gt;&lt;p&gt;The one concern is taking a checkpoint that includes the commit in the data without the commit oplog entry having been written. The &quot;Oplog Durability&quot; project should make this safe because the commit will not be in the data if the commit oplog entry hasn&apos;t been written.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;This will be a problem anyway, with or without shutdown. Do we have an idea to avoid that for steady state when we don&apos;t have to pin stable timestamp to the oldest active transaction timestamp? I&apos;m not sure whether the &quot;Oplog Durability&quot; project will save us here because it only guarantees the durable timestamps for both data write and oplog write are the same. If a checkpoint is taken in between, it can still only include the data without the oplog write, unless the stable timestamp is aware of oplog holes. For example, it will be safe if a node can never take a checkpoint beyond &lt;tt&gt;all_committed&lt;/tt&gt;.&lt;/p&gt;</comment>
                            <comment id="2172704" author="judah.schvimer" created="Wed, 6 Mar 2019 15:55:30 +0000"  >&lt;p&gt;There are two &lt;tt&gt;UninterruptibleLockGuards&lt;/tt&gt; in the &lt;tt&gt;TransactionParticipant&lt;/tt&gt;.  Both are uninterruptible because an interruption would be caught in a &lt;tt&gt;try...catch&lt;/tt&gt; and cause a &lt;tt&gt;std::terminate()&lt;/tt&gt;. I don&apos;t think it is safe for these places to be interrupted even at shutdown. If it needs to be safe, then we have to replace the &lt;tt&gt;std::terminate()&lt;/tt&gt; in the &lt;tt&gt;catch&lt;/tt&gt; with something that will leave the node in the correct state.&lt;/p&gt;

&lt;p&gt;Marking the &lt;tt&gt;opCtx&lt;/tt&gt; as &lt;tt&gt;opCtx-&amp;gt;setIsExecutingShutdown&lt;/tt&gt; seems like the wrong thing to do here, though. I think we need to use &lt;tt&gt;runWithoutInterruptionExceptAtGlobalShutdown()&lt;/tt&gt; as &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=siyuan.zhou&quot; class=&quot;user-hover&quot; rel=&quot;siyuan.zhou&quot;&gt;siyuan.zhou&lt;/a&gt; says, but catch interrupt exceptions (which will always be due to shutdown in this case).&lt;/p&gt;

&lt;p&gt;The two places are:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;&lt;tt&gt;commitPreparedTransaction&lt;/tt&gt;: We write the commit oplog entry after committing the storage transaction. If we shutdown too early, we will recover with the transaction in prepare. The one concern is taking a checkpoint that includes the commit in the data without the commit oplog entry having been written. The &quot;Oplog Durability&quot; project should make this safe because the commit will not be in the data if the commit oplog entry hasn&apos;t been written.&lt;/li&gt;
	&lt;li&gt;&lt;tt&gt;prepareTransaction abortGuard&lt;/tt&gt;: If we fail to prepare the transaction but have written a prepare oplog entry, then on restart we will put the transaction back into prepare. if that fails, the &lt;tt&gt;abortGuard&lt;/tt&gt; will fire outside of shutdown uninterruptibly.&lt;/li&gt;
&lt;/ol&gt;
</comment>
                            <comment id="2171933" author="siyuan.zhou@10gen.com" created="Tue, 5 Mar 2019 23:18:46 +0000"  >&lt;p&gt;After&#160;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-39427&quot; title=&quot;Modify interrupt semantics for opCtx&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-39427&quot;&gt;&lt;del&gt;SERVER-39427&lt;/del&gt;&lt;/a&gt;, using &lt;tt&gt;runWithoutInterruptionExceptAtGlobalShutdown()&lt;/tt&gt; seems more reasonable here, it will stop all interruptions except shutdown.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                        <issuelink>
            <issuekey id="699018">SERVER-39643</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="635430">SERVER-38190</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="714029">SERVER-40051</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>9.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25128"><![CDATA[Replication]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 5 Mar 2019 23:18:46 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        4 years, 48 weeks, 6 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[<s><a href='https://jira.mongodb.org/browse/SERVER-39643'>SERVER-39643</a></s>]]></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>false</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>alexander.golin@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            4 years, 48 weeks, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>backlog-server-repl</customfieldvalue>
            <customfieldvalue>daniel.gottlieb@mongodb.com</customfieldvalue>
            <customfieldvalue>milkie@mongodb.com</customfieldvalue>
            <customfieldvalue>judah.schvimer@mongodb.com</customfieldvalue>
            <customfieldvalue>siyuan.zhou@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|huphqf:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr84u7:</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|hup3zr:</customfieldvalue>

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