<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:09:28 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-45686] Increase topologyVersion and respond to waiting isMasters on mock State Change Errors from the failCommand failpoint</title>
                <link>https://jira.mongodb.org/browse/SERVER-45686</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;When the server responds with a State Change Errors from the failCommand failpoint, it should also increase topologyVersion and respond to waiting isMasters. The Drivers team uses failCommand extensively in spec tests for retryable writes+reads. Without this change, it takes the client ~10 seconds (maxAwaitTimeMS) to rediscover the server&apos;s state. &lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;client configures a failCommand with NotMaster&lt;/li&gt;
	&lt;li&gt;client runs a retryable write against Primary P&lt;/li&gt;
	&lt;li&gt;client observes a NotMaster error and sets P to Unknown&lt;/li&gt;
	&lt;li&gt;client runs the retry attempt which blocks until P is rediscovered&lt;/li&gt;
	&lt;li&gt;P&apos;s Monitor is blocked for 10 seconds waiting for an awaitable isMaster response&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;After this change to 10 seconds hang should be removed:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;client configures a failCommand with NotMaster&lt;/li&gt;
	&lt;li&gt;client runs a retryable write against Primary P&lt;/li&gt;
	&lt;li&gt;client observes a NotMaster error and sets P to Unknown&lt;/li&gt;
	&lt;li&gt;client runs the retry attempt which blocks until P is rediscovered&lt;/li&gt;
	&lt;li&gt;P&apos;s Monitor immediately receives an awaitable isMaster response and set P to Primary&lt;/li&gt;
	&lt;li&gt;client retry attempt succeeds ASAP&lt;/li&gt;
&lt;/ol&gt;
</description>
                <environment></environment>
        <key id="1107801">SERVER-45686</key>
            <summary>Increase topologyVersion and respond to waiting isMasters on mock State Change Errors from the failCommand failpoint</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="13203">Gone away</resolution>
                                        <assignee username="jason.chan@mongodb.com">Jason Chan</assignee>
                                    <reporter username="shane.harvey@mongodb.com">Shane Harvey</reporter>
                        <labels>
                    </labels>
                <created>Tue, 21 Jan 2020 22:27:04 +0000</created>
                <updated>Fri, 27 Oct 2023 20:42:25 +0000</updated>
                            <resolved>Fri, 31 Jan 2020 14:45:26 +0000</resolved>
                                                                    <component>Replication</component>
                                        <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="2773514" author="tess.avitabile" created="Thu, 30 Jan 2020 18:49:40 +0000"  >&lt;p&gt;Ah, thank you for figuring that out! Should this ticket be closed?&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jason.chan&quot; class=&quot;user-hover&quot; rel=&quot;jason.chan&quot;&gt;jason.chan&lt;/a&gt;, I&apos;m sorry we didn&apos;t catch this before you wrote the code.&lt;/p&gt;</comment>
                            <comment id="2773182" author="shane.harvey" created="Thu, 30 Jan 2020 16:46:00 +0000"  >&lt;p&gt;After testing against the latest server (v4.3.3-54-gd1fe174) I no longer believe failCommand with a State Change Error is a problem. Sorry for the confusion. At the time I was testing with a server that did not add&#160;topologyVersion to State Change Errors. Now that I&apos;m testing with a server that does, this is the behavior I see:&#160;&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;client configures a failCommand with NotMaster&lt;/li&gt;
	&lt;li&gt;client runs a retryable write against Primary P, with topologyVersion.counter = 1&lt;/li&gt;
	&lt;li&gt;client observes a NotMaster error&#160;&lt;b&gt;with topologyVersion.counter = 1&lt;/b&gt;&#160; and does not set the server to unknown because the error&apos;s&#160;topologyVersion is less-or-equal to the current server&apos;s&lt;/li&gt;
	&lt;li&gt;client runs the retry attempt which selects P and succeeds immediately&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;We still have to deal with a similar problem (10-second pauses) with failCommand that closes the connection but I think we will solve it on the client side.&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Hopefully, in practice the retry will not take 10 seconds. The driver should have an up-to-date status for the primary, so it will retry against the primary. Does that sound right to you? Maybe I&apos;m missing something.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Please ignore this. The current behavior of topologyVersion solves this problem too.&lt;/p&gt;</comment>
                            <comment id="2772867" author="tess.avitabile" created="Thu, 30 Jan 2020 15:37:39 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jason.chan&quot; class=&quot;user-hover&quot; rel=&quot;jason.chan&quot;&gt;jason.chan&lt;/a&gt; and I discussed this.&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;I want to push back on incrementing topologyVersion for mongos/standalone. Right now we have assumptions in the server that the topologyVersion never changes on mongos/standalone, and I prefer not to just that assumption for tests. However, I understand the pain of having tests take longer. Is there another solution that might work here? For example, the test could use a lower maxAwaitTimeMS against mongos/standalone. Or we could add a failpoint to make isMaster responses return immediately.&lt;/li&gt;
	&lt;li&gt;On a real shutdown, the isMaster would either return a ShutdownError or the connection would close, but the topologyVersion does not get bumped. When the server restarts, the topologyVersion has a new processId and a counter of 0. I&apos;m okay with bumping the topologyVersion in the failCommand failpoint, even though it differs from the behavior in a real shutdown.&lt;/li&gt;
&lt;/ol&gt;


&lt;blockquote&gt;&lt;p&gt;When directly connected to a secondary, every write will fail with NotMaster and trigger a retry. If the server does not increment the topologyVersion in practice then each retry will take 10 seconds. This seems like an oversight/bug in retryable reads/writes that can be addressed separately.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Hopefully, in practice the retry will not take 10 seconds. The driver should have an up-to-date status for the primary, so it will retry against the primary. Does that sound right to you? Maybe I&apos;m missing something.&lt;/p&gt;</comment>
                            <comment id="2771680" author="shane.harvey" created="Wed, 29 Jan 2020 23:02:01 +0000"  >&lt;p&gt;1. Yes,&#160;topologyVersion needs to change on&#160;mongos anytime it returns a State Change Error to the client. Otherwise, a NotMaster error returned from a mongos could cause a driver&apos;s retryable write/read to take 10 seconds. Drivers reset a server to Unknown on State Change Errors regardless if it&apos;s a standalone, mongos, or replica set member so I think standalones should also have the same behavior.&#160;&lt;br/&gt;
 2. I think the answer is also yes. Can you explain the expected behavior on a real shutdown?&#160;&#160;&lt;/p&gt;

&lt;p&gt;Number 1 brings up an interesting case. When directly connected to a secondary, every write will fail with NotMaster and trigger a retry. If the server does not increment the&#160;topologyVersion in practice then each retry will take 10 seconds. This seems like an oversight/bug in retryable reads/writes that can be addressed separately.&#160;&lt;/p&gt;</comment>
                            <comment id="2771492" author="jason.chan" created="Wed, 29 Jan 2020 21:24:55 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=shane.harvey&quot; class=&quot;user-hover&quot; rel=&quot;shane.harvey&quot;&gt;shane.harvey&lt;/a&gt;, some requirements questions came up during the implementation we are hoping you could help answer:&lt;br/&gt;
 1. Does Drivers expect the topologyVersion to be incremented even for mongos/standalones? We expect the answer to be &apos;no&apos; since we don&apos;t expect them to ever increment their TopologyVersion in practice.&lt;/p&gt;

&lt;p&gt;2. The design includes the category of ShutdownErrors as a State Change Error. Does Drivers still expect the TopologyVersion to be incremented on shutdown errors? This does not simulate the true server behaviour since the server won&apos;t increment TopologyVersion on a real shutdown, but we are wondering if this would be helpful for drivers spec tests.&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, 29 Jan 2020 20:19:10 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        4 years, 1 week, 6 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-1400</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, 1 week, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>jason.chan@mongodb.com</customfieldvalue>
            <customfieldvalue>shane.harvey@mongodb.com</customfieldvalue>
            <customfieldvalue>tess.avitabile@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hwk0q7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hvl7b3:</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="3575">Repl 2020-02-10</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|hwjmzj:</customfieldvalue>

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