<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:31:35 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-53685] Need to handle case of indexes being created on an empty collection when cloning starts.</title>
                <link>https://jira.mongodb.org/browse/SERVER-53685</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;We are blocking user creations of indexes on empty collections during migration.  But the scenario below can still happen in certain cases when collections are created implicitly, only when migrating from a donor secondary.  To avoid it, we will add a stage to cloning: we will read the _id of one document from the donor collection before listIndexes.  If the collection is empty, we will do the listIndexes, create the indexes, and skip normal cloning (if any documents are added while we&apos;re doing the listIndexes, they will be inserted during oplog application).  If the collection is not empty, we will proceed normally.  Thus we know the collection has become non-empty before we check the indexes.&lt;/p&gt;

&lt;p&gt;There could still be a problem if the collection is made empty through deletes, then an index created, then documents inserted.  However, that can only happen with explicit user-created indexes (which are blocked), not implicit indexes.&lt;/p&gt;

&lt;p&gt;&amp;#8212; old description follows---&lt;br/&gt;
In the current implementation, &quot;CreateIndexes&quot; oplog entry gets generated only when the indexes are created on empty collections. And, the secondary oplog applier applier on processing CreateIndexes oplog entry performs &lt;a href=&quot;https://github.com/mongodb/mongo/blob/54e87285f802a49456c02c80cb0ddb0fbb54c88a/src/mongo/db/repl/oplog.cpp#L801&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;single phase index build&lt;/a&gt; assuming that the collection is empty. Doing single phase index builds on non-empty collections would be performance problem as it can make cause replication lag. To avoid it, we moved to 2-phase index build. But with the multi-tenant migration project, there are chances that the primary can generate &quot;CreateIndexes&quot; oplog entry on non-empty collections and bringing the perf problem back. Consider the below sequence.&lt;/p&gt;

&lt;p&gt;Donor: At TS:11, created a collection &apos;foo&apos;.&lt;br/&gt;
Recipient:  At TS:12, starts the &quot;foo&quot; collection cloner and performs &quot;listIndexes&quot; cmd  on donor and gets the result as empty.&lt;br/&gt;
Donor: At TS:13, creates an index &apos;a_1&apos; on empty collection and createIndexBuild oplog gets generated.&lt;br/&gt;
Donor : At TS:15 - TS:20, documents gets inserted into &apos;foo&apos; collection.&lt;br/&gt;
Recipient: At TS:30 , finishes cloning the collection &apos;foo&apos;  and  has cloned all the &apos;foo&apos; collection docs from TS:15 thru TS:20.&lt;br/&gt;
Recipient: At TS:31, moves to tenant oplog applier phase and starts applying &quot;createIndexes&quot; oplog entry at donor timestamp TS(12) on a non-empty collection &quot;foo&quot;.  The recipient primary now generates &quot;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/54e87285f802a49456c02c80cb0ddb0fbb54c88a/src/mongo/db/index_builds_coordinator.cpp#L1574&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;createIndexes&lt;/a&gt;&quot; oplog entry on non-empty collection  &quot;foo&quot;.&lt;/p&gt;

&lt;p&gt;P.S: Apart from &quot;createIndexes&quot; cmd, &quot;renameCollection&quot; cross-db also generates &quot;createIndexes&quot; oplog entry on the intermediate temp collection.&lt;/p&gt;
</description>
                <environment></environment>
        <key id="1585781">SERVER-53685</key>
            <summary>Need to handle case of indexes being created on an empty collection when cloning starts.</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="matthew.russotto@mongodb.com">Matthew Russotto</assignee>
                                    <reporter username="suganthi.mani@mongodb.com">Suganthi Mani</reporter>
                        <labels>
                            <label>pm-1791_milestone-B</label>
                    </labels>
                <created>Mon, 11 Jan 2021 16:30:47 +0000</created>
                <updated>Sun, 29 Oct 2023 21:58:58 +0000</updated>
                            <resolved>Thu, 25 Feb 2021 18:55:22 +0000</resolved>
                                                    <fixVersion>4.9.0</fixVersion>
                                    <component>Replication</component>
                                        <votes>0</votes>
                                    <watches>6</watches>
                                                                                                                <comments>
                            <comment id="3634079" author="xgen-internal-githook" created="Wed, 24 Feb 2021 23:55:22 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Matthew Russotto&apos;, &apos;email&apos;: &apos;matthew.russotto@mongodb.com&apos;, &apos;username&apos;: &apos;mtrussotto&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-53685&quot; title=&quot;Need to handle case of indexes being created on an empty collection when cloning starts.&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-53685&quot;&gt;&lt;del&gt;SERVER-53685&lt;/del&gt;&lt;/a&gt; Need to handle case of indexes being created on an empty collection when cloning starts.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/50cffc6e386b6669f11e8a6b112a58add69e5361&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/50cffc6e386b6669f11e8a6b112a58add69e5361&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="1450542">SERVER-50495</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1619773">SERVER-54449</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="1380742">SERVER-48862</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>1.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_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>Mon, 22 Feb 2021 21:40:50 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        2 years, 50 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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-1791</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, 50 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>matthew.russotto@mongodb.com</customfieldvalue>
            <customfieldvalue>suganthi.mani@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hyoscn:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hyaiy7:</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_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="4655">Repl 2021-02-22</customfieldvalue>
    <customfieldvalue id="4756">Repl 2021-03-08</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|hyoelz:</customfieldvalue>

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