<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:42:04 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-57521] FCV change unconditionally closes outgoing connections that have not finished their hello handshake</title>
                <link>https://jira.mongodb.org/browse/SERVER-57521</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Upon changing the FCV value, &lt;a href=&quot;https://github.com/mongodb/mongo/blob/9c3588341bde307f0e65effd50ea6a7558044ae1/src/mongo/db/fcv_op_observer.cpp#L78-L80&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;outgoing connections to servers with a lower binary version are closed&lt;/a&gt;. This is done by closing all the connections except those tagged with transport::Session::kKeepOpen.&lt;br/&gt;
However, there exists a race condition between &lt;a href=&quot;https://github.com/mongodb/mongo/blob/8ffd10695231a88db3cb48023b74e1ae217cea73/src/mongo/client/async_client.cpp#L129-L132&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;setting the kKeepOpen flag during the hello handshake&lt;/a&gt;, and deciding whether to close the connection by looking at the tags.&lt;br/&gt;
As a result, connections that are in the process of being established can be incorrectly dropped during setFCV.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/9c3588341bde307f0e65effd50ea6a7558044ae1/src/mongo/executor/connection_pool.cpp#L520-L521&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;ConnectionPool::dropConnections&lt;/a&gt; is not considering the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/2d3200ce27c7a71b1f9157e273596e78ec07db97/src/mongo/transport/service_state_machine.cpp#L616&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;kPending flag&lt;/a&gt;. &lt;/p&gt;</description>
                <environment></environment>
        <key id="1772411">SERVER-57521</key>
            <summary>FCV change unconditionally closes outgoing connections that have not finished their hello handshake</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="janna.golden@mongodb.com">Janna Golden</assignee>
                                    <reporter username="jordi.serra-torrens@mongodb.com">Jordi Serra Torrens</reporter>
                        <labels>
                    </labels>
                <created>Tue, 8 Jun 2021 08:46:08 +0000</created>
                <updated>Sun, 29 Oct 2023 21:52:29 +0000</updated>
                            <resolved>Tue, 29 Jun 2021 04:24:03 +0000</resolved>
                                                    <fixVersion>5.0.2</fixVersion>
                    <fixVersion>5.1.0-rc0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>6</watches>
                                                                                                                <comments>
                            <comment id="4106853" author="JIRAUSER1259052" created="Wed, 6 Oct 2021 18:10:48 +0000"  >&lt;p&gt;Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it&#8217;s been triggered. For more active release information, please keep an eye on #server-release. Thank you!&lt;/p&gt;</comment>
                            <comment id="3953940" author="xgen-internal-githook" created="Wed, 21 Jul 2021 00:55:08 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;jannaerin&apos;, &apos;email&apos;: &apos;golden.janna@gmail.com&apos;, &apos;username&apos;: &apos;jannaerin&apos;}
&lt;p&gt;Message:  &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-57521&quot; title=&quot;FCV change unconditionally closes outgoing connections that have not finished their hello handshake&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-57521&quot;&gt;&lt;del&gt;SERVER-57521&lt;/del&gt;&lt;/a&gt; Avoid dropping connections with pending flag set, unset pending flag if binary versions incompatible&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 39505432404a35ebd35e05dffec0ad29d7f79262)&lt;br/&gt;
Branch: v5.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/803c423fd5d055b4e3c82e645273800998dc2362&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/803c423fd5d055b4e3c82e645273800998dc2362&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3906641" author="xgen-internal-githook" created="Tue, 29 Jun 2021 04:07:48 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;jannaerin&apos;, &apos;email&apos;: &apos;golden.janna@gmail.com&apos;, &apos;username&apos;: &apos;jannaerin&apos;}
&lt;p&gt;Message:  &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-57521&quot; title=&quot;FCV change unconditionally closes outgoing connections that have not finished their hello handshake&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-57521&quot;&gt;&lt;del&gt;SERVER-57521&lt;/del&gt;&lt;/a&gt; Avoid dropping connections with pending flag set, unset pending flag if binary versions incompatible&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/39505432404a35ebd35e05dffec0ad29d7f79262&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/39505432404a35ebd35e05dffec0ad29d7f79262&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3872527" author="JIRAUSER1257318" created="Fri, 11 Jun 2021 08:03:13 +0000"  >&lt;p&gt;AsyncDBClient::_parseIsMasterResponse does &lt;a href=&quot;https://github.com/mongodb/mongo/blob/b962214f9061c94078f6195e80b7109e8f2552f8/src/mongo/client/async_client.cpp#L129&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;check the wire version&lt;/a&gt; prior to &lt;a href=&quot;https://github.com/mongodb/mongo/blob/b962214f9061c94078f6195e80b7109e8f2552f8/src/mongo/client/async_client.cpp#L130-L131&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;setting the kKeepOpen flag&lt;/a&gt;, but this can race. In fact, I think a race condition already exists where:&lt;br/&gt;
1. Let&apos;s say the local server has minWireVersion 9&lt;br/&gt;
2. &lt;span class=&quot;error&quot;&gt;&amp;#91;th1&amp;#93;&lt;/span&gt; A connection is being established to a remote server with wire version 9. We have passed the wire version check &lt;a href=&quot;https://github.com/mongodb/mongo/blob/b962214f9061c94078f6195e80b7109e8f2552f8/src/mongo/client/async_client.cpp#L129&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;.&lt;br/&gt;
3. &lt;span class=&quot;error&quot;&gt;&amp;#91;th2&amp;#93;&lt;/span&gt; setFCV runs and &lt;a href=&quot;https://github.com/mongodb/mongo/blob/b962214f9061c94078f6195e80b7109e8f2552f8/src/mongo/db/fcv_op_observer.cpp#L66&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;advances minWireVersion&lt;/a&gt; to 10&lt;br/&gt;
4. &lt;span class=&quot;error&quot;&gt;&amp;#91;th1&amp;#93;&lt;/span&gt; the kKeepOpen flag will be &lt;a href=&quot;https://github.com/mongodb/mongo/blob/b962214f9061c94078f6195e80b7109e8f2552f8/src/mongo/client/async_client.cpp#L130-L131&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;set&lt;/a&gt; for the connection, although the wire version is no longer compatible&lt;br/&gt;
5. &lt;span class=&quot;error&quot;&gt;&amp;#91;th2&amp;#93;&lt;/span&gt; the connection &lt;a href=&quot;https://github.com/mongodb/mongo/blob/b962214f9061c94078f6195e80b7109e8f2552f8/src/mongo/db/fcv_op_observer.cpp#L79-L80&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;won&apos;t be closed&lt;/a&gt; because it has been tagged with kKeepOpen&lt;/p&gt;

&lt;p&gt;So either this has to be safe, or I think we already have a bug there. Someone from repl or service arch may be more familiar with this code to confirm this.&lt;/p&gt;</comment>
                            <comment id="3871777" author="matthew.saltz" created="Thu, 10 Jun 2021 20:07:10 +0000"  >&lt;p&gt;Is it a problem if we don&#8217;t drop a pending connection and then it turns out to be a connection that&#8217;s not marked &#8220;kKeepOpen&#8221; and is also to an older binary version?&lt;/p&gt;</comment>
                            <comment id="3870957" author="janna.golden" created="Thu, 10 Jun 2021 15:29:35 +0000"  >&lt;p&gt;I have a repro of this issue that I&apos;ve attached to this ticket. Adding a check for `kPending` in &lt;a href=&quot;https://github.com/mongodb/mongo/blob/9c3588341bde307f0e65effd50ea6a7558044ae1/src/mongo/executor/connection_pool.cpp#L520-L521&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;ConnectionPool::dropConnections&lt;/a&gt; fixes the issue. I can take this ticket and put up a CR if we agree that adding a check for `kPending` in `ConnectionPool:dropConnections` is the right fix.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10420">
                    <name>Backports</name>
                                            <outwardlinks description="backported by">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="1757675">SERVER-57202</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                                        </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="319724" name="setfcv_conndrop_repro.js" size="4044" author="janna.golden@mongodb.com" created="Thu, 10 Jun 2021 15:29:45 +0000"/>
                    </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>1.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="21777"><![CDATA[v5.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>Tue, 8 Jun 2021 17:44:50 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        2 years, 18 weeks 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_17050" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Downstream Team Attention</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16941"><![CDATA[Not Needed]]></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>
                            2 years, 18 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>50.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>janna.golden@mongodb.com</customfieldvalue>
            <customfieldvalue>jordi.serra-torrens@mongodb.com</customfieldvalue>
            <customfieldvalue>matthew.saltz@mongodb.com</customfieldvalue>
            <customfieldvalue>vivian.ge@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hzkcs7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hz4xvr:</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="4520">Sharding 2021-06-28</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|hzjz1b:</customfieldvalue>

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