<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:54:23 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-62178] Resharding can fail with NamespaceNotSharded if recipient primary fails over before creating temporary resharding collection</title>
                <link>https://jira.mongodb.org/browse/SERVER-62178</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/06001974ff4e922120943348b1052251fd14b306/src/mongo/db/s/shard_server_op_observer.cpp#L572-L577&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;ShardServerOpObserver::onCreateCollection() sets the filter metadata for the collection as unsharded if the collection isn&apos;t already known to be sharded&lt;/a&gt;. This behavior isn&apos;t something which can be changed without significant work from Sharding EMEA, although it would probably be better to leave the filtering metadata as unknown.&lt;/p&gt;

&lt;p&gt;The following scenario can therefore lead the recipient shard primary to wrongly believe the temporary resharding collection is unsharded and for it to &lt;a href=&quot;https://github.com/mongodb/mongo/blob/06001974ff4e922120943348b1052251fd14b306/src/mongo/db/s/resharding/resharding_op_observer.cpp#L76-L79&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;throw a NamespaceNotSharded exception from assertCanExtractShardKeyFromDocs()&lt;/a&gt;.&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;Recipient shard primary in term=1 is told by coordinator to refresh on the temporary resharding collection. At this point the recipient shard primary knows the temporary resharding collection is sharded.&lt;/li&gt;
	&lt;li&gt;Recipient shard primary in term=1 constructs a RecipientStateMachine and waits for all donor shards to be prepared to donate.&lt;/li&gt;
	&lt;li&gt;Recipient shard primary in term=1 is told by coordinator all donor shards are prepared to donate.&lt;/li&gt;
	&lt;li&gt;Recipient shard primary in term=1 is transitions from RecipientStateEnum::kAwaitingFetchTimestamp to RecipientStateEnum::kCreatingCollection.&lt;/li&gt;
	&lt;li&gt;An election occurs and there&apos;s a new recipient shard primary in term=2.&lt;/li&gt;
	&lt;li&gt;Recipient shard primary in term=2 clears the filtering metadata for the temporary resharding collection on step&amp;#45;up.&lt;/li&gt;
	&lt;li&gt;Recipient shard primary in term=2 creates the temporary resharding collection. ShardServerOpObserver::onCreateCollection() causes the recipient shard primary to set the filtering metadata for the temporary resharding collection as unsharded.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;This happens because the recipient shard primary in term=2 resumes without being guaranteed it has itself refreshed from the config server and set the filter metadata for the temporary resharding collection as sharded. One solution is to have the recipient shard primary clear the filtering metadata for the temporary resharding collection &lt;a href=&quot;https://github.com/mongodb/mongo/blob/06001974ff4e922120943348b1052251fd14b306/src/mongo/db/s/resharding/resharding_recipient_service_external_state.cpp#L78-L87&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;after creating it&lt;/a&gt; so that resharding&apos;s collection cloning and resharding&apos;s oplog application can simply refresh to set it as sharded.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1953920">SERVER-62178</key>
            <summary>Resharding can fail with NamespaceNotSharded if recipient primary fails over before creating temporary resharding collection</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="matt.boros@mongodb.com">Matt Boros</assignee>
                                    <reporter username="max.hirschhorn@mongodb.com">Max Hirschhorn</reporter>
                        <labels>
                            <label>sharding-nyc-subteam1</label>
                    </labels>
                <created>Fri, 17 Dec 2021 23:32:53 +0000</created>
                <updated>Sun, 29 Oct 2023 21:44:52 +0000</updated>
                            <resolved>Thu, 13 Jan 2022 17:06:41 +0000</resolved>
                                    <version>5.0.0</version>
                    <version>5.1.0</version>
                    <version>5.2.0-rc1</version>
                                    <fixVersion>5.3.0</fixVersion>
                    <fixVersion>5.0.6</fixVersion>
                    <fixVersion>5.2.1</fixVersion>
                                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="4303915" author="xgen-internal-githook" created="Thu, 20 Jan 2022 20:27:12 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Matt Boros&apos;, &apos;email&apos;: &apos;matt.boros@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-62178&quot; title=&quot;Resharding can fail with NamespaceNotSharded if recipient primary fails over before creating temporary resharding collection&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-62178&quot;&gt;&lt;del&gt;SERVER-62178&lt;/del&gt;&lt;/a&gt; Clear filtering metadata on recipient shard primary for temporary resharding collection after creation&lt;/p&gt;

&lt;p&gt;(cherry picked from commit e9d49578b3e11044e0e41bdcbb72f41cd17e571c)&lt;br/&gt;
Branch: v5.2&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/acef8a36dfb37a1ed2d3db9760724557d2caa794&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/acef8a36dfb37a1ed2d3db9760724557d2caa794&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4297790" author="xgen-internal-githook" created="Tue, 18 Jan 2022 16:06:50 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Matt Boros&apos;, &apos;email&apos;: &apos;matt.boros@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-62178&quot; title=&quot;Resharding can fail with NamespaceNotSharded if recipient primary fails over before creating temporary resharding collection&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-62178&quot;&gt;&lt;del&gt;SERVER-62178&lt;/del&gt;&lt;/a&gt; Clear filtering metadata on recipient shard primary for temporary resharding collection after creation&lt;/p&gt;

&lt;p&gt;(cherry picked from commit e9d49578b3e11044e0e41bdcbb72f41cd17e571c)&lt;br/&gt;
Branch: v5.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/a495a8881f30e97775668e5e49b404cf0623fa54&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/a495a8881f30e97775668e5e49b404cf0623fa54&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4291168" author="xgen-internal-githook" created="Thu, 13 Jan 2022 16:43:58 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Matt Boros&apos;, &apos;email&apos;: &apos;matt.boros@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-62178&quot; title=&quot;Resharding can fail with NamespaceNotSharded if recipient primary fails over before creating temporary resharding collection&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-62178&quot;&gt;&lt;del&gt;SERVER-62178&lt;/del&gt;&lt;/a&gt; Clear filtering metadata on recipient shard primary for temporary resharding collection after creation&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/e9d49578b3e11044e0e41bdcbb72f41cd17e571c&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/e9d49578b3e11044e0e41bdcbb72f41cd17e571c&lt;/a&gt;&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="1838804">SERVER-59023</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>3.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="22676"><![CDATA[v5.2]]></customfieldvalue>
    <customfieldvalue key="22495"><![CDATA[v5.1]]></customfieldvalue>
    <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>Thu, 6 Jan 2022 22:27:02 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        2 years, 2 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>
                            2 years, 2 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>30.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>matt.boros@mongodb.com</customfieldvalue>
            <customfieldvalue>max.hirschhorn@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i0f5kf:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hraf4v:</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="5726">Sharding 2022-01-10</customfieldvalue>
    <customfieldvalue id="5727">Sharding 2022-01-24</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10555" key="com.atlassian.jira.plugin.system.customfieldtypes:float">
                        <customfieldname>Story Points</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</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|i0erpr:</customfieldvalue>

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