<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:41:17 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-35872] Reconstruct prepared transactions on replication rollback</title>
                <link>https://jira.mongodb.org/browse/SERVER-35872</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;After the work for &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-35879&quot; title=&quot;Add support for reconstituting transactions in their correct state from the transaction table during startup recovery&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-35879&quot;&gt;&lt;del&gt;SERVER-35879&lt;/del&gt;&lt;/a&gt; goes in, we will already have a way to apply prepare oplog entries during replication recovery. This work includes iterating over the transactions table, finding which sessions had a prepared transaction on them, and applying the prepare oplog entry. &lt;/p&gt;

&lt;p&gt;Before we apply these oplog entries, however, we will need to correctly refresh the session state as well as the state of the transaction participant because these will have both been invalidated at the beginning of replication rollback. This must happen before we try to &lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/mongo/db/repl/apply_ops.cpp#L319&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;modify the transaction participant&lt;/a&gt; (i.e. call &lt;tt&gt;unstashTransactionResources&lt;/tt&gt; or &lt;tt&gt;prepareTransaction&lt;/tt&gt;). There are a couple ways that we can approach this.&lt;/p&gt;

&lt;p&gt;First, we could thread a boolean through &lt;tt&gt;_recoverFromOplog&lt;/tt&gt;, &lt;tt&gt;_reconstructPreparedTransactions&lt;/tt&gt;, and &lt;tt&gt;applyRecoveredPrepareTransaction&lt;/tt&gt;. Once we get to &lt;tt&gt;applyRecoveredPrepareTransaction&lt;/tt&gt;, we can check to see if we are recovering from a rollback and refresh the session and transaction participant states. &lt;/p&gt;

&lt;p&gt;The second option is to check the &lt;tt&gt;OplogApplication&lt;/tt&gt; mode and if its in &lt;tt&gt;OplogApplication::Mode::kRecovering&lt;/tt&gt;, then refresh the session and transaction participant. Since kRecovering applies to startup recovery AND replication recovery, this would only work if it&apos;s safe to do this during startup recovery. During replication recovery, we would not be making any writes to the transactions table, so refreshing the state from disk would not cause us to read those writes and start a new transaction. If the same thing applies to startup recovery, this could be a more elegant solution than the first. &lt;/p&gt;

&lt;p&gt;Finally, in both solutions, we would need to introduce a new helper (something like &lt;tt&gt;refreshTxnParticipantFromTable&lt;/tt&gt;) that reconstructs the state of the transaction participant before we cleared it for rollback. This information should be available from the prepare oplog entry. &lt;/p&gt;

&lt;p&gt;We would test this via jstests since we would need to induce a rollback and ensure that we have not lost any prepared transactions by the end of the recovery process.&lt;/p&gt;</description>
                <environment></environment>
        <key id="565188">SERVER-35872</key>
            <summary>Reconstruct prepared transactions on replication rollback</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="13201">Fixed</resolution>
                                        <assignee username="pavithra.vetriselvan@mongodb.com">Pavithra Vetriselvan</assignee>
                                    <reporter username="greg.mckeon@mongodb.com">Gregory McKeon</reporter>
                        <labels>
                            <label>open_todo_in_code</label>
                            <label>prepare_durability</label>
                    </labels>
                <created>Thu, 28 Jun 2018 15:53:35 +0000</created>
                <updated>Sun, 29 Oct 2023 22:30:17 +0000</updated>
                            <resolved>Thu, 28 Feb 2019 15:40:17 +0000</resolved>
                                                    <fixVersion>4.1.9</fixVersion>
                                    <component>Replication</component>
                                        <votes>0</votes>
                                    <watches>6</watches>
                                                                                                                <comments>
                            <comment id="2166240" author="xgen-internal-githook" created="Thu, 28 Feb 2019 15:38:44 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Pavi Vetriselvan&apos;, &apos;username&apos;: &apos;pvselvan&apos;, &apos;email&apos;: &apos;pvselvan@umich.edu&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-35872&quot; title=&quot;Reconstruct prepared transactions on replication rollback&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-35872&quot;&gt;&lt;del&gt;SERVER-35872&lt;/del&gt;&lt;/a&gt; fix TODOs&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/434347f4fab56a9a749d3698fbf46679f2c73f74&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/434347f4fab56a9a749d3698fbf46679f2c73f74&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2160308" author="judah.schvimer" created="Fri, 22 Feb 2019 20:30:29 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=pavithra.vetriselvan&quot; class=&quot;user-hover&quot; rel=&quot;pavithra.vetriselvan&quot;&gt;pavithra.vetriselvan&lt;/a&gt;, I think you missed the TODO &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jack.mulrow&quot; class=&quot;user-hover&quot; rel=&quot;jack.mulrow&quot;&gt;jack.mulrow&lt;/a&gt; left and left a TODO for this ticket that should point to &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-39762&quot; title=&quot;Fix fastcount after rollback recovery of prepared transactions. &quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-39762&quot;&gt;&lt;del&gt;SERVER-39762&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="2160157" author="xgen-internal-githook" created="Fri, 22 Feb 2019 19:16:37 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Pavi Vetriselvan&apos;, &apos;email&apos;: &apos;pvselvan@umich.edu&apos;, &apos;username&apos;: &apos;pvselvan&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-35872&quot; title=&quot;Reconstruct prepared transactions on replication rollback&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-35872&quot;&gt;&lt;del&gt;SERVER-35872&lt;/del&gt;&lt;/a&gt; reconstruct prepared transactions on rollback, fastcount inaccurate&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/0ab7df179a7329fea4c28049d1ff532010720280&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/0ab7df179a7329fea4c28049d1ff532010720280&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2147859" author="jack.mulrow" created="Wed, 13 Feb 2019 20:43:09 +0000"  >&lt;p&gt;Just a heads up - I&apos;m adding a TODO on this ticket in a test for &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-36498&quot; title=&quot;Remove &amp;#39;config.transactions&amp;#39; entries with &amp;#39;state&amp;#39; field on shutdown in fCV 4.0&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-36498&quot;&gt;&lt;del&gt;SERVER-36498&lt;/del&gt;&lt;/a&gt; for behavior relying on transactions that aborted after being prepared entering the kAbortedWithPrepare state after refreshing from storage.&lt;/p&gt;</comment>
                            <comment id="2126722" author="xgen-internal-githook" created="Thu, 24 Jan 2019 23:09:58 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;pvselvan@umich.edu&apos;, &apos;name&apos;: &apos;Pavi Vetriselvan&apos;, &apos;username&apos;: &apos;pvselvan&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-35872&quot; title=&quot;Reconstruct prepared transactions on replication rollback&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-35872&quot;&gt;&lt;del&gt;SERVER-35872&lt;/del&gt;&lt;/a&gt; reconstruct prepared transactions on replication rollback&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/c215687d366bef79cd821d69899e9d2689e9fd6f&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/c215687d366bef79cd821d69899e9d2689e9fd6f&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2074387" author="samy.lanka" created="Wed, 28 Nov 2018 19:15:51 +0000"  >&lt;p&gt;We need to make sure that we are correctly refreshing state when a session has been invalidated. &lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                        <issuelink>
            <issuekey id="565213">SERVER-35879</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="666284">SERVER-38865</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="702920">SERVER-39762</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="627942">SERVER-37886</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>6.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>6.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 28 Nov 2018 19:15:51 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        4 years, 49 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-35879'>SERVER-35879</a></s>, <s><a href='https://jira.mongodb.org/browse/SERVER-38865'>SERVER-38865</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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-1032</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, 49 weeks, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>greg.mckeon@mongodb.com</customfieldvalue>
            <customfieldvalue>jack.mulrow@mongodb.com</customfieldvalue>
            <customfieldvalue>judah.schvimer@mongodb.com</customfieldvalue>
            <customfieldvalue>pavithra.vetriselvan@mongodb.com</customfieldvalue>
            <customfieldvalue>samy.lanka@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hu1lmv:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr8rf3:</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="2607">Repl 2018-12-17</customfieldvalue>
    <customfieldvalue id="2701">Repl 2019-01-14</customfieldvalue>
    <customfieldvalue id="2702">Repl 2019-01-28</customfieldvalue>
    <customfieldvalue id="2783">Repl 2019-02-11</customfieldvalue>
    <customfieldvalue id="2784">Repl 2019-02-25</customfieldvalue>
    <customfieldvalue id="2822">Repl 2019-03-11</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|hu17w7:</customfieldvalue>

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