<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:15:31 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-47883] Newly-elected primaries do not wait for single-phase background index builds to complete before accepting writes</title>
                <link>https://jira.mongodb.org/browse/SERVER-47883</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Definition of &quot;single-phase background builds&quot;: Index builds started on versions 4.2 and prior; in 4.4, index builds started in FCV 4.2.&#160;&lt;/p&gt;

&lt;p&gt;Consider the scenario:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Node 1, Primary, starts and completes a single-phase background index build. It replicates a &quot;createIndexes&quot; oplog entry&lt;/li&gt;
	&lt;li&gt;Node 2, Secondary, starts the index build&lt;/li&gt;
	&lt;li&gt;Node 2 steps up as primary, but the index build is still incomplete&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Say a client created an index and waited for it to complete on the primary before issuing read queries. After the state transition, the client will see that the index build is no longer available for queries until the new primary completes the index build.&#160;&lt;/p&gt;

&lt;p&gt;Proposed solution: on a state transition to primary, wait for all BackgroundOperations to complete &lt;a href=&quot;https://github.com/mongodb/mongo/blob/92478cbbdbfd036f7d812942d55044e026b95118/src/mongo/db/repl/rollback_impl.cpp#L376&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;like we already do for rollback&lt;/a&gt;.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1335827">SERVER-47883</key>
            <summary>Newly-elected primaries do not wait for single-phase background index builds to complete before accepting writes</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="13201">Fixed</resolution>
                                        <assignee username="louis.williams@mongodb.com">Louis Williams</assignee>
                                    <reporter username="louis.williams@mongodb.com">Louis Williams</reporter>
                        <labels>
                    </labels>
                <created>Fri, 1 May 2020 15:16:56 +0000</created>
                <updated>Sun, 29 Oct 2023 22:08:48 +0000</updated>
                            <resolved>Thu, 2 Jul 2020 19:21:46 +0000</resolved>
                                    <version>4.0.0</version>
                    <version>4.2.0</version>
                                    <fixVersion>4.2.9</fixVersion>
                    <fixVersion>4.0.21</fixVersion>
                                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="3385864" author="xgen-internal-githook" created="Thu, 10 Sep 2020 17:49:37 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Louis Williams&apos;, &apos;email&apos;: &apos;louis.williams@mongodb.com&apos;, &apos;username&apos;: &apos;louiswilliams&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-47883&quot; title=&quot;Newly-elected primaries do not wait for single-phase background index builds to complete before accepting writes&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-47883&quot;&gt;&lt;del&gt;SERVER-47883&lt;/del&gt;&lt;/a&gt; Override stepdown suites to ensure background index builds are complete after stepdown&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 045cbbe721087ab7d36c5b0c99096103eb7a7d45)&lt;/p&gt;

&lt;p&gt;Backports causally_consistent_index_builds.js&lt;br/&gt;
Branch: v4.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/6771000c858db2358a7ef49378fcfd92ea2b177b&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/6771000c858db2358a7ef49378fcfd92ea2b177b&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3268842" author="xgen-internal-githook" created="Thu, 2 Jul 2020 17:37:10 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Louis Williams&apos;, &apos;email&apos;: &apos;louis.williams@mongodb.com&apos;, &apos;username&apos;: &apos;louiswilliams&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-47883&quot; title=&quot;Newly-elected primaries do not wait for single-phase background index builds to complete before accepting writes&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-47883&quot;&gt;&lt;del&gt;SERVER-47883&lt;/del&gt;&lt;/a&gt; Override stepdown suites to ensure background index builds are complete after stepdown&lt;br/&gt;
Branch: v4.2&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/045cbbe721087ab7d36c5b0c99096103eb7a7d45&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/045cbbe721087ab7d36c5b0c99096103eb7a7d45&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3218102" author="louis.williams" created="Mon, 22 Jun 2020 18:22:01 +0000"  >&lt;p&gt;This behavior has always existed for background index builds. It would be extremely risky to backport a change that blocks replication to older versions. Instead, we have decided to accept this bug and will only address the test failures.&lt;/p&gt;

&lt;p&gt;I propose including the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/v4.4/jstests/libs/override_methods/causally_consistent_index_builds.js&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;causally_consistent_index_builds.js override&lt;/a&gt; in step-down suites. This follows every &quot;createIndexes&quot; command with a &quot;collMod&quot;. This creates a barrier so any subsequent commands will always see an index after the command completes.&lt;/p&gt;</comment>
                            <comment id="3212763" author="louis.williams" created="Wed, 17 Jun 2020 18:31:35 +0000"  >&lt;p&gt;I also believe this is more than a test issue. Since background index builds on secondaries relax index constraints, this may allow us to complete an index build on a primary in an inconsistent state.&lt;/p&gt;</comment>
                            <comment id="3212737" author="louis.williams" created="Wed, 17 Jun 2020 18:19:06 +0000"  >&lt;p&gt;I believe this bug was exposed by&#160;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-39112&quot; title=&quot;Primary drain mode can be unnecessarily slow&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-39112&quot;&gt;&lt;del&gt;SERVER-39112&lt;/del&gt;&lt;/a&gt;, which removed a 1-second pause between primary drain mode and accepting writes. In our tests, index builds were always able to complete in the 1-second window before new writes were accepted. Removing that wait allowed our tests to start index builds on secondaries, transition immediately to primary, and observe an unfinished index build.&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="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="1514533">SERVER-51608</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>5.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_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="15640"><![CDATA[v4.0]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10011"><![CDATA[Minor Change]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 2 Jul 2020 17:37:10 +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_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>
                            3 years, 21 weeks, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>17.0</customfieldvalue>

                        </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>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>louis.williams@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hxiu9j:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hxafjj:</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="3938">Execution Team 2020-06-29</customfieldvalue>
    <customfieldvalue id="3939">Execution Team 2020-07-13</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|hxigiv:</customfieldvalue>

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