<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:16:22 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-27834] Index builds during initial sync should not implicitly create collections</title>
                <link>https://jira.mongodb.org/browse/SERVER-27834</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Implicit collection creation is never correct during initial sync. In index builds we call &lt;a href=&quot;https://github.com/mongodb/mongo/blob/43e9c303c08f73b56490b662b3d11988cafafdf4/src/mongo/db/index_builder.cpp#L134&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;getOrCreateCollection&lt;/a&gt; which creates the collection to index if we don&apos;t have one.&lt;/p&gt;

&lt;p&gt;Additionally, we do not call &lt;tt&gt;txn-&amp;gt;setReplicatedWrites(false)&lt;/tt&gt; on the operation context created for background index builds, so when those create a new collection, they also attempt to write to the oplog. This behavior should probably be changed, but the real problem is the implicit collection creation.&lt;/p&gt;</description>
                <environment></environment>
        <key id="349726">SERVER-27834</key>
            <summary>Index builds during initial sync should not implicitly create collections</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="9">Done</resolution>
                                        <assignee username="benety.goh@mongodb.com">Benety Goh</assignee>
                                    <reporter username="judah.schvimer@mongodb.com">Judah Schvimer</reporter>
                        <labels>
                    </labels>
                <created>Fri, 27 Jan 2017 15:13:58 +0000</created>
                <updated>Wed, 5 Apr 2017 11:34:21 +0000</updated>
                            <resolved>Fri, 24 Mar 2017 19:46:20 +0000</resolved>
                                                    <fixVersion>3.4.4</fixVersion>
                    <fixVersion>3.5.5</fixVersion>
                                    <component>Replication</component>
                                        <votes>0</votes>
                                    <watches>7</watches>
                                                                                                                <comments>
                            <comment id="1538390" author="xgen-internal-githook" created="Fri, 31 Mar 2017 20:18:17 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;benety&apos;, u&apos;name&apos;: u&apos;Benety Goh&apos;, u&apos;email&apos;: u&apos;benety@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-27834&quot; title=&quot;Index builds during initial sync should not implicitly create collections&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-27834&quot;&gt;&lt;del&gt;SERVER-27834&lt;/del&gt;&lt;/a&gt; disable implicit collection creation in IndexBuilder&lt;/p&gt;

&lt;p&gt;(cherry picked from commit fd46b39bd957df28fa2273bf5e4dcbb1765e4026)&lt;br/&gt;
Branch: v3.4&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/cf1d5cf8a9db86729371a3d1b69ee1b79642ce52&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/cf1d5cf8a9db86729371a3d1b69ee1b79642ce52&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1538385" author="xgen-internal-githook" created="Fri, 31 Mar 2017 20:14:37 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;benety&apos;, u&apos;name&apos;: u&apos;Benety Goh&apos;, u&apos;email&apos;: u&apos;benety@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-27834&quot; title=&quot;Index builds during initial sync should not implicitly create collections&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-27834&quot;&gt;&lt;del&gt;SERVER-27834&lt;/del&gt;&lt;/a&gt; FeatureCompatibilityVersion creates the admin.system.version collection if missing.&lt;/p&gt;

&lt;p&gt;This avoids relying on the implicit collection behavior in IndexBuilder.&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 9bc30836f60a888c44de09c55a45c278b215a02b)&lt;br/&gt;
Branch: v3.4&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/5eed47fa931d4093c6c3b5e60ef3d01ab25cf3cb&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/5eed47fa931d4093c6c3b5e60ef3d01ab25cf3cb&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1538367" author="xgen-internal-githook" created="Fri, 31 Mar 2017 20:07:45 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;benety&apos;, u&apos;name&apos;: u&apos;Benety Goh&apos;, u&apos;email&apos;: u&apos;benety@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-27834&quot; title=&quot;Index builds during initial sync should not implicitly create collections&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-27834&quot;&gt;&lt;del&gt;SERVER-27834&lt;/del&gt;&lt;/a&gt; applyOperation_inlock() fails index creation if collection is missing&lt;/p&gt;

&lt;p&gt;(cherry picked from commit f54e89fa124ef679e25ca37b3bcf8e02572f38fd)&lt;br/&gt;
Branch: v3.4&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/5d8395f20499b39ee3889f6e7dac87d6e7ae6db0&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/5d8395f20499b39ee3889f6e7dac87d6e7ae6db0&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1532455" author="xgen-internal-githook" created="Fri, 24 Mar 2017 19:45:32 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;benety&apos;, u&apos;name&apos;: u&apos;Benety Goh&apos;, u&apos;email&apos;: u&apos;benety@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-27834&quot; title=&quot;Index builds during initial sync should not implicitly create collections&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-27834&quot;&gt;&lt;del&gt;SERVER-27834&lt;/del&gt;&lt;/a&gt; disable implicit collection creation in IndexBuilder&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/fd46b39bd957df28fa2273bf5e4dcbb1765e4026&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/fd46b39bd957df28fa2273bf5e4dcbb1765e4026&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1532399" author="xgen-internal-githook" created="Fri, 24 Mar 2017 18:42:36 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;benety&apos;, u&apos;name&apos;: u&apos;Benety Goh&apos;, u&apos;email&apos;: u&apos;benety@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-27834&quot; title=&quot;Index builds during initial sync should not implicitly create collections&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-27834&quot;&gt;&lt;del&gt;SERVER-27834&lt;/del&gt;&lt;/a&gt; FeatureCompatibilityVersion creates the admin.system.version collection if missing.&lt;/p&gt;

&lt;p&gt;This avoids relying on the implicit collection behavior in IndexBuilder.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/9bc30836f60a888c44de09c55a45c278b215a02b&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/9bc30836f60a888c44de09c55a45c278b215a02b&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1532362" author="xgen-internal-githook" created="Fri, 24 Mar 2017 18:18:19 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;benety&apos;, u&apos;name&apos;: u&apos;Benety Goh&apos;, u&apos;email&apos;: u&apos;benety@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-27834&quot; title=&quot;Index builds during initial sync should not implicitly create collections&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-27834&quot;&gt;&lt;del&gt;SERVER-27834&lt;/del&gt;&lt;/a&gt; applyOperation_inlock() fails index creation if collection is missing&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/f54e89fa124ef679e25ca37b3bcf8e02572f38fd&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/f54e89fa124ef679e25ca37b3bcf8e02572f38fd&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1489916" author="judah.schvimer" created="Wed, 1 Feb 2017 15:21:49 +0000"  >&lt;p&gt;Node 2 fails to see the drop because the drop entry is after the createIndex entry in the oplog. Since we apply oplog entries in order of the oplog, Node 2 will create the index and then drop it when it hits the drop oplog entry. There certainly may be room for improvement here with respect to skipping unnecessary operations.&lt;/p&gt;</comment>
                            <comment id="1488418" author="nathan.myers" created="Mon, 30 Jan 2017 20:14:17 +0000"  >&lt;p&gt;I assumed that any attempts to create an index during initial sync would have to come from mistaken user input. &lt;/p&gt;

&lt;p&gt;In the scenario, I don&apos;t see how node 2 fails to see the drop before it starts indexing.  Is the indexing job queued separately, so it is not synchronous with oplog events?  Maybe queued jobs operating on dropped tables should also be cleared from the queue synchronously with the drop.  That wouldn&apos;t help with tasks already running, but there is probably a good chance that the job hasn&apos;t started yet.  If it has, then the index already exists, and can be dropped too.  We do drop the index when we drop the table, right?&lt;/p&gt;</comment>
                            <comment id="1488041" author="judah.schvimer" created="Mon, 30 Jan 2017 14:59:11 +0000"  >&lt;p&gt;I agree that the index creation should fail if the collection does not exist. That is how we handle other idempotency issues in initial sync. &lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=nathan.myers&quot; class=&quot;user-hover&quot; rel=&quot;nathan.myers&quot;&gt;nathan.myers&lt;/a&gt;, can you elaborate more on how the collection name can be misspelled during initial sync? In initial sync we just call listCollections on the upstream node and use that name. I believe this occurs due to the following sequence of events. Node 2 is initial syncing from Node 1. Node 1 creates collection A. Node 2 then starts initial sync and starts buffering ops from Node 1. Node 1 creates an index on the collection and Node 2 buffers that op. Node 1 then drops the collection. Node 2 never clones the collection. Node 2 goes to apply its ops and has to apply a createIndex op on a collection that it never cloned.&lt;/p&gt;

&lt;p&gt;By turning off the oplog, I assume you mean setReplicatedWrites(false). We can either create another ticket for it, or do them together. It&apos;s not that we need to turn off replicated writes while it creates the collection since it shouldn&apos;t be creating the collection in the first place. Rather we have to turn them off on the new thread that does the background index build since it has a new OperationContext.&lt;/p&gt;</comment>
                            <comment id="1487425" author="nathan.myers" created="Sat, 28 Jan 2017 02:36:33 +0000"  >&lt;p&gt;Maybe we should fail index creation during initial sync.&lt;/p&gt;

&lt;p&gt;And, maybe we need another ticket about turning off the oplog while it creates the collection.  I suggest it would be better for the index creation to fail any time there is no collection for it to index.  It&apos;s overwhelmingly more likely that the collection name was misspelled; and then the misnamed collection and the index on it have to be cleaned up manually, if anybody notices they are there.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10420">
                    <name>Backports</name>
                                            <outwardlinks description="backported by">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                        <issuelink>
            <issuekey id="299009">SERVER-24927</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="240400">SERVER-21583</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="170724">SERVER-16274</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="151962">SERVER-14860</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="179649">SERVER-16943</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="334883">SERVER-27205</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="190188">SERVER-17634</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="152360" name="initial_sync_background_index.js" size="1480" author="benety.goh@mongodb.com" created="Fri, 24 Mar 2017 18:47:15 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>10.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_12451" key="com.atlassian.jira.plugin.system.customfieldtypes:multiversion">
                        <customfieldname>Backport Completed</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="18098">3.4.4</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>Sat, 28 Jan 2017 02:36:33 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        6 years, 45 weeks, 5 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[<s><a href='https://jira.mongodb.org/browse/SERVER-24927'>SERVER-24927</a></s>]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>ramon.fernandez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            6 years, 45 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0.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>benety.goh@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>judah.schvimer@mongodb.com</customfieldvalue>
            <customfieldvalue>nathan.myers</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|ht1oan:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hsvmf3:</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="1617">Repl 2017-03-27</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_11861" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>User Summary</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="11856"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hs4htb:</customfieldvalue>

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