<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:27:56 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-31700] waitForAllEarlierOplogWritesToBeVisible might hang after rollback, in rare cases</title>
                <link>https://jira.mongodb.org/browse/SERVER-31700</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;When in &lt;tt&gt;waitForAllEarlierOplogWritesToBeVisible&lt;/tt&gt;, the method first records the &quot;oplog read timestamp&quot;: &lt;a href=&quot;https://github.com/mongodb/mongo/blob/43b018194e1a49249092b871f3b7396e473d1426/src/mongo/db/storage/wiredtiger/wiredtiger_oplog_manager.cpp#L82-L84&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/blob/43b018194e1a49249092b871f3b7396e473d1426/src/mongo/db/storage/wiredtiger/wiredtiger_oplog_manager.cpp#L82-L84&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Every iteration of the wait-loop will compare this recorded value with a current reading. If that value goes backwards, that signals a rollback happened, which breaks out of the wait loop:&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/blob/43b018194e1a49249092b871f3b7396e473d1426/src/mongo/db/storage/wiredtiger/wiredtiger_oplog_manager.cpp#L102-L109&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/blob/43b018194e1a49249092b871f3b7396e473d1426/src/mongo/db/storage/wiredtiger/wiredtiger_oplog_manager.cpp#L102-L109&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, because those values are just timestamps and not &lt;tt&gt;OpTimes&lt;/tt&gt; (which contain terms), it&apos;s possible for a rollback to not be detected. For example, consider the &quot;oplog read timestamp&quot; starting at 10 and the method is waiting for time 15 to become visible. During one wait of the condition variable, it&apos;s possible the &quot;oplog read timestamp&quot; to advance to time 13, followed by a rollback that sets the time back to 11. Thus the rollback would not be detected.&lt;/p&gt;

&lt;p&gt;I don&apos;t believe this is a matter of correctness; I expect callers must be doing rollback detection (or  alternatively, operation contexts waiting on a condition variable may be getting signaled on rollback in a way that throws an exception?).&lt;/p&gt;

&lt;p&gt;This is just a matter of liveness. In a typical case, the timestamp the reader is waiting to become visible is already committed and the system is just waiting for earlier holes (i.e: concurrent, in progress transactions) to be resolved.&lt;/p&gt;

&lt;p&gt;With the code as it is, in the case of a rollback, the history up to the previous &quot;oplog read timestamp&quot; is destroyed. The liveness guarantee of this wait for the now defunct &quot;oplog read timestamp&quot; is predicated on new activity coming into the system.&lt;/p&gt;</description>
                <environment></environment>
        <key id="450084">SERVER-31700</key>
            <summary>waitForAllEarlierOplogWritesToBeVisible might hang after rollback, in rare cases</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</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="13203">Gone away</resolution>
                                        <assignee username="milkie@mongodb.com">Eric Milkie</assignee>
                                    <reporter username="daniel.gottlieb@mongodb.com">Daniel Gottlieb</reporter>
                        <labels>
                    </labels>
                <created>Tue, 24 Oct 2017 17:40:49 +0000</created>
                <updated>Fri, 27 Oct 2023 20:43:49 +0000</updated>
                            <resolved>Fri, 1 Nov 2019 15:10:39 +0000</resolved>
                                                                    <component>Storage</component>
                                        <votes>0</votes>
                                    <watches>8</watches>
                                                                                                                <comments>
                            <comment id="2514126" author="milkie" created="Fri, 1 Nov 2019 15:10:39 +0000"  >&lt;p&gt;I believe that on rollback, everything is signaled that could be blocked waiting in this function, and thus this is no longer an issue.&lt;/p&gt;</comment>
                            <comment id="1709491" author="spencer" created="Wed, 25 Oct 2017 21:09:10 +0000"  >&lt;p&gt;Okay, so long as waitForAllEarlierOplogWritesToBeVisible respects opCtx interruption then it should be fine.&lt;/p&gt;</comment>
                            <comment id="1709266" author="milkie" created="Wed, 25 Oct 2017 20:19:40 +0000"  >&lt;p&gt;However, I would presume all remote queries from secondaries would use a socket timeout or maxTimeMS, and so they wouldn&apos;t hang forever anyway.&lt;/p&gt;</comment>
                            <comment id="1709258" author="milkie" created="Wed, 25 Oct 2017 20:17:52 +0000"  >&lt;p&gt;Maybe? You would have to call that function prior to rollback and then continue to be waiting after rollback, and I am presuming that such remote queries on secondaries would be disconnected as part of the rollback process.&lt;/p&gt;</comment>
                            <comment id="1709207" author="spencer" created="Wed, 25 Oct 2017 19:57:28 +0000"  >&lt;p&gt;We use waitForAllEarlierOplogWritesToBeVisible when serving reads on the oplog - can this cause secondaries to stop replicating?&lt;/p&gt;</comment>
                    </comments>
                    <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>1.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 25 Oct 2017 19:57:28 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        4 years, 14 weeks, 5 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>false</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, 14 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>daniel.gottlieb@mongodb.com</customfieldvalue>
            <customfieldvalue>milkie@mongodb.com</customfieldvalue>
            <customfieldvalue>spencer@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|htiliv:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hvmq87:</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="3344">Execution Team 2019-11-04</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|hti7mn:</customfieldvalue>

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