<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:08:32 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-45347] 2-phase index build on empty collection(implicit collection creation) can skip rebuilding the index on rollback/startup recovery.</title>
                <link>https://jira.mongodb.org/browse/SERVER-45347</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Currently 2-phase index build for &lt;a href=&quot;https://github.com/mongodb/mongo/blob/4c0244f3d42b62d143383f4be17aace206fb86b9/src/mongo/db/index_builds_coordinator.cpp#L812&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;empty collection&lt;/a&gt; does the following steps.&lt;/p&gt;

&lt;p&gt;1) We reserve an oplog slot with timestamp say TS(10), and &lt;a href=&quot;https://github.com/mongodb/mongo/blob/4c0244f3d42b62d143383f4be17aace206fb86b9/src/mongo/db/index_builds_coordinator.cpp#L834&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;write&lt;/a&gt; the &quot;startIndexBuild&quot; oplog entry with that timestamp. &lt;br/&gt;
 2) We reserve another oplog slot with timestamp say TS(11) and use that to &lt;a href=&quot;https://github.com/mongodb/mongo/blob/4c0244f3d42b62d143383f4be17aace206fb86b9/src/mongo/db/index_builds_coordinator.cpp#L844&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;write&lt;/a&gt; commitIndexBuild oplog entry. To be noted, As a result of this step, all future writes done to that WT recovery unit will use timestamp TS(11).&lt;br/&gt;
 3) Now, we start the index build which would update the catalog table to write the index entry with &quot;ready&quot; field as &lt;a href=&quot;https://github.com/mongodb/mongo/blob/4c0244f3d42b62d143383f4be17aace206fb86b9/src/mongo/db/catalog/index_catalog_impl.cpp#L414&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;false&lt;/a&gt; using commitIndexBuild oplog entry&apos;s timestamp (TS(11)).&lt;br/&gt;
 4) On Index completion/success, we would again update the catalog table to write the index entry with &quot;ready&quot; field as &lt;a href=&quot;https://github.com/mongodb/mongo/blob/4c0244f3d42b62d143383f4be17aace206fb86b9/src/mongo/db/catalog/index_catalog_impl.cpp#L428&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;true&lt;/a&gt; using commitIndexBuild oplog entry&apos;s timestamp (TS(11)).&lt;/p&gt;

&lt;p&gt;&#160;Now, suppose if my stable timestamp/ checkpoint timestamp is TS(10) (i.e, startIndexBuild oplog entry), then it would miss rebuilding the index while replaying the commitIndex oplog entry during rollback and startup recovery. Because, when the node tries to replay the &quot;commitIndexBuild&quot; oplog entry during rollback/startup recovery, commitIndexBuild Oplog entry will fail with&#160;&lt;b&gt;ErrorCodes::NoSuchKey&lt;/b&gt;&#160;since it&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/4c0244f3d42b62d143383f4be17aace206fb86b9/src/mongo/db/index_builds_coordinator.cpp#L500&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;won&apos;t be able to find&lt;/a&gt;&#160;any corresponding running/in-progress index. Also, when commitIndexBuild oplog entry fails with ErrorCodes::NoSuchKey, we don&apos;t escalate it to the caller (oplog applier), instead we suppress it as &quot;ErrorCodes:NoSuchKey&quot; is an&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/4c0244f3d42b62d143383f4be17aace206fb86b9/src/mongo/db/repl/oplog.cpp#L871-L873&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;acceptable error code&lt;/a&gt;&#160;during oplog application.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1074714">SERVER-45347</key>
            <summary>2-phase index build on empty collection(implicit collection creation) can skip rebuilding the index on rollback/startup recovery.</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="suganthi.mani@mongodb.com">Suganthi Mani</assignee>
                                    <reporter username="suganthi.mani@mongodb.com">Suganthi Mani</reporter>
                        <labels>
                    </labels>
                <created>Fri, 3 Jan 2020 16:06:44 +0000</created>
                <updated>Sun, 29 Oct 2023 22:13:42 +0000</updated>
                            <resolved>Wed, 22 Jan 2020 14:54:24 +0000</resolved>
                                                    <fixVersion>4.3.3</fixVersion>
                                    <component>Storage</component>
                                        <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="2748898" author="xgen-internal-githook" created="Wed, 22 Jan 2020 02:08:43 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;username&apos;: &apos;smani87&apos;, &apos;name&apos;: &apos;Suganthi Mani&apos;, &apos;email&apos;: &apos;suganthi.mani@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-45347&quot; title=&quot;2-phase index build on empty collection(implicit collection creation) can skip rebuilding the index on rollback/startup recovery.&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-45347&quot;&gt;&lt;del&gt;SERVER-45347&lt;/del&gt;&lt;/a&gt; Primaries should generate createIndexes oplog entry (single phase index build) for empty&lt;br/&gt;
collections.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/3d7cb72c831478e995ec6c521f428b66f8081d34&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/3d7cb72c831478e995ec6c521f428b66f8081d34&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2722177" author="benety.goh" created="Mon, 13 Jan 2020 16:39:15 +0000"  >&lt;p&gt;The empty collection optimization to be introduced in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-45201&quot; title=&quot;Implicit collection creation from createIndexes can stall replication on secondaries by circumventing thread pool on primary&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-45201&quot;&gt;&lt;del&gt;SERVER-45201&lt;/del&gt;&lt;/a&gt; should be updated to use IndexBuildsCoordinator::createIndexesOnEmptyCollection().&lt;/p&gt;</comment>
                            <comment id="2719296" author="benety.goh" created="Fri, 10 Jan 2020 19:30:08 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=suganthi.mani&quot; class=&quot;user-hover&quot; rel=&quot;suganthi.mani&quot;&gt;suganthi.mani&lt;/a&gt; proposed one possible solution that would eliminate any ambiguity with start/commit timestamps with index builds on empty collections - IndexBuildsCoordinator::createIndexesOnEmptyCollection() would replicate index builds as single phased.&lt;/p&gt;</comment>
                            <comment id="2715725" author="benety.goh" created="Fri, 10 Jan 2020 00:16:43 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=louis.williams&quot; class=&quot;user-hover&quot; rel=&quot;louis.williams&quot;&gt;louis.williams&lt;/a&gt; observed while reviewing &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-45201&quot; title=&quot;Implicit collection creation from createIndexes can stall replication on secondaries by circumventing thread pool on primary&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-45201&quot;&gt;&lt;del&gt;SERVER-45201&lt;/del&gt;&lt;/a&gt; that &lt;a href=&quot;https://github.com/mongodb/mongo/blob/f68734daa5e03a737bfea6703be9870769b0dbaf/src/mongo/db/catalog/index_catalog_impl.cpp#L413&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;IndexCatalogImpl::createIndexOnEmptyCollection() does not provide a buildUUID&lt;/a&gt; when it updates the catalog.&lt;/p&gt;

&lt;p&gt;We should ensure that a buildUUID is provided as we work on this ticket to improve the startIndexBuild/commitIndexBuild semantics on empty collections.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="659884">SERVER-38736</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1037074">SERVER-44953</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1048200">SERVER-45064</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="1058257">SERVER-45201</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>4.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_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>Fri, 10 Jan 2020 00:16:43 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        4 years, 3 weeks, 1 day 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-253</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>
                            4 years, 3 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>31.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>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|hwemkn:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr657j:</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="3518">Execution Team 2020-01-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_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hwe8tz:</customfieldvalue>

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