<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:22:49 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-50500] Increment topologyVersion for state change errors in failCommand</title>
                <link>https://jira.mongodb.org/browse/SERVER-50500</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;This was originally proposed in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-45686&quot; title=&quot;Increase topologyVersion and respond to waiting isMasters on mock State Change Errors from the failCommand failpoint&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-45686&quot;&gt;&lt;del&gt;SERVER-45686&lt;/del&gt;&lt;/a&gt; but was not implemented because at that time, the topology version did not change on mongos or standalones. This is no longer true as of 4.5.1 because mongos increments topologyVersion as part of the quiesce mode project (&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-46957&quot; title=&quot;Implement quiesce mode on mongos&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-46957&quot;&gt;&lt;del&gt;SERVER-46957&lt;/del&gt;&lt;/a&gt;). Can we revisit the original request? It would be helpful for drivers testing because the drivers API does not allow heartbeat frequency to be set below 500ms (non-configurable minHeartbeatFrequency), so even tuning it as low as possible means that tests still wait ~0.5s to recover from state change errors when using failCommand.&lt;/p&gt;

&lt;p&gt;EDIT: My comment about the 0.5s lag only apply to a subset of state change errors on 4.4 where the response does not contain a topologyVersion field. The drivers tests addressed by this ticket run on 4.4+, so it&apos;d be helpful to have this functionality backported. I think we&apos;d need to first backport&#160;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-47017&quot; title=&quot;Attach topologyVersion to ShutdownErrors (mongod)&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-47017&quot;&gt;&lt;del&gt;SERVER-47017&lt;/del&gt;&lt;/a&gt; and&#160;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-47018&quot; title=&quot;Attach topologyVersion to ShutdownErrors (mongos)&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-47018&quot;&gt;&lt;del&gt;SERVER-47018&lt;/del&gt;&lt;/a&gt;, though.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1450727">SERVER-50500</key>
            <summary>Increment topologyVersion for state change errors in failCommand</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="12300">Won&apos;t Do</resolution>
                                        <assignee username="tess.avitabile@mongodb.com">Tess Avitabile</assignee>
                                    <reporter username="divjot.arora@mongodb.com">Divjot Arora</reporter>
                        <labels>
                    </labels>
                <created>Mon, 24 Aug 2020 20:42:25 +0000</created>
                <updated>Thu, 10 Sep 2020 16:00:48 +0000</updated>
                            <resolved>Thu, 10 Sep 2020 16:00:48 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="3385573" author="tess.avitabile" created="Thu, 10 Sep 2020 16:00:38 +0000"  >&lt;p&gt;Cool, thanks for letting me know!&lt;/p&gt;</comment>
                            <comment id="3385562" author="divjot.arora" created="Thu, 10 Sep 2020 15:57:38 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=tess.avitabile&quot; class=&quot;user-hover&quot; rel=&quot;tess.avitabile&quot;&gt;tess.avitabile&lt;/a&gt;&#160;After discussing this some more with Shane, we don&apos;t think it&apos;ll be a good idea to implement this in the server. Adding this would actually introduce a race in drivers between the application and monitoring threads because the application thread would want to mark the server Unknown and the monitoring threads would want to continue marking the server as known based on the streamed isMaster responses.&lt;/p&gt;

&lt;p&gt;Adding a failpoint like configureMaxAwaitTimeMS would work, but I&apos;d prefer to avoid adding extra failpoints that we&apos;d have to continue to support indefinitely if we can work around this by setting a low heartbeatFrequencyMS in drivers.&lt;/p&gt;

&lt;p&gt;Given all of that, I think we can close out this ticket.&lt;/p&gt;</comment>
                            <comment id="3382120" author="tess.avitabile" created="Wed, 9 Sep 2020 14:24:09 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=divjot.arora&quot; class=&quot;user-hover&quot; rel=&quot;divjot.arora&quot;&gt;divjot.arora&lt;/a&gt;, I just wanted to check whether you&apos;re still interested in this ticket or if you decided to pursue a different solution, such as canceling in-progress monitor checks for shutdown errors without a topology version.&lt;/p&gt;</comment>
                            <comment id="3370073" author="tess.avitabile" created="Tue, 1 Sep 2020 14:39:27 +0000"  >&lt;p&gt;Thanks, &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=divjot.arora&quot; class=&quot;user-hover&quot; rel=&quot;divjot.arora&quot;&gt;divjot.arora&lt;/a&gt;. Would it be concerning that the server increments its topology version without actually changing its state (and returning something different in the isMaster response)?&lt;/p&gt;</comment>
                            <comment id="3369923" author="divjot.arora" created="Tue, 1 Sep 2020 14:00:47 +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;&#160;A new failpoint could work, but I think it&apos;d be worth considering the option where we cancel in-progress monitor checks for shutdown errors without a topology version.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=tess.avitabile&quot; class=&quot;user-hover&quot; rel=&quot;tess.avitabile&quot;&gt;tess.avitabile&lt;/a&gt;&#160;The driver tests primarily care that the server is marked Unknown when an application thread sees a state change error. Right now, however, the error triggered via failCommand causes the application thread to mark the server Unknown, but the server is not re-discovered for ~10s because the server is actually healthy so the in-progress streaming check does not receive a new response.&lt;/p&gt;</comment>
                            <comment id="3369893" author="tess.avitabile" created="Tue, 1 Sep 2020 13:51:01 +0000"  >&lt;p&gt;I agree that it would be better to make the errors from failCommand act more like real state change errors. It&apos;s a little worrisome that today, we simulate the server responding with a NotMaster error without the topologyVersion changing, since that doesn&apos;t match real server behavior. However, making failCommand increment the topologyVersion won&apos;t match real server behavior either, since then we would increment the topologyVersion without changing anything in the isMaster response. I&apos;m interested to learn more about what behavior the drivers tests want to simulate in the server, in order to know the right way to solve this.&lt;/p&gt;

&lt;p&gt;For the purpose of speeding up the tests, adding a failpoint like configureMaxAwaitTimeMS would work for me.&lt;/p&gt;</comment>
                            <comment id="3368932" author="shane.harvey" created="Mon, 31 Aug 2020 21:55:24 +0000"  >&lt;p&gt;Divjot and I talked about this issue when he created the ticket and I was in favor of the change because it would make the errors from failCommand act more like real state&#160;change errors. However given your response it sounds like we&apos;re asking to backport a lot of the&#160;quiesce mode project to 4.4.&lt;/p&gt;

&lt;p&gt;The best we can do in some drivers right now is set maxAwaitTimeMS to 500ms. That&apos;s as low as it can go due to API restrictions in&#160;some drivers. This means that some tests take at least 500ms which adds up quite fast when running 10&apos;s/100&apos;s of these tests. Perhaps we can add a failpoint like configureMaxAwaitTimeMS to override the&#160;maxAwaitTimeMS on all isMaster commands? Then we could speed up these slow tests by setting the&#160;maxAwaitTimeMS to 5ms with the failpoint.&#160;&lt;/p&gt;

&lt;p&gt;Another workaround is that when a driver sees a&#160;shutdown error without topologyVersion it can cancel the monitor heartbeat (similar to &lt;a href=&quot;https://github.com/mongodb/specifications/blob/87e367a/source/server-discovery-and-monitoring/server-monitoring.rst#drivers-cancel-in-progress-monitor-checks&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;what we do for network errors&lt;/a&gt;). This would trigger the next heartbeat sooner than heartbeatFrequencyMS but probably not faster than 500ms.&lt;/p&gt;

&lt;p&gt;What do you think Divjot?&lt;/p&gt;</comment>
                            <comment id="3368784" author="tess.avitabile" created="Mon, 31 Aug 2020 21:20:35 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=divjot.arora&quot; class=&quot;user-hover&quot; rel=&quot;divjot.arora&quot;&gt;divjot.arora&lt;/a&gt;. I have some of the same concerns about this work as previously. While topology version now changes on mongos, it still does not change on standalone, and it doesn&apos;t change on mongos in 4.4, so we wouldn&apos;t want to backport incrementing the topology version on mongos to 4.4. Also, it&apos;s important that we not backport&#160;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-47017&quot; title=&quot;Attach topologyVersion to ShutdownErrors (mongod)&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-47017&quot;&gt;&lt;del&gt;SERVER-47017&lt;/del&gt;&lt;/a&gt; and&#160;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-47018&quot; title=&quot;Attach topologyVersion to ShutdownErrors (mongos)&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-47018&quot;&gt;&lt;del&gt;SERVER-47018&lt;/del&gt;&lt;/a&gt; to 4.4, since we must only attach the topology version to ShutdownErrors if the topology version has been incremented (due to quiesce mode), and 4.4 doesn&apos;t support quiesce mode (see&#160;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-45882&quot; title=&quot;Do not attach topologyVersion to ShutdownErrors&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-45882&quot;&gt;&lt;del&gt;SERVER-45882&lt;/del&gt;&lt;/a&gt; for why it was a bug to attach topology version to ShutdownErrors on 4.4).&lt;/p&gt;

&lt;p&gt;Do you think there are other workarounds we could consider? Some things we discussed on&#160;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-45686&quot; title=&quot;Increase topologyVersion and respond to waiting isMasters on mock State Change Errors from the failCommand failpoint&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-45686&quot;&gt;&lt;del&gt;SERVER-45686&lt;/del&gt;&lt;/a&gt; were using a lower maxAwaitTimeMS (unless this has to be the same as minHeartbeatFrequency?) or adding a failpoint to make the isMaster response return immediately.&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>8.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_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 31 Aug 2020 21:20:35 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        3 years, 21 weeks, 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_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>tess.avitabile@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            3 years, 21 weeks, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>divjot.arora@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|hy1upb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hxogcf:</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="4141">Repl 2020-09-07</customfieldvalue>
    <customfieldvalue id="4248">Repl 2020-09-21</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|hy1gyn:</customfieldvalue>

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