<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:48:16 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-59842] Setting wildcard index as multikey can cause prepare conflicts</title>
                <link>https://jira.mongodb.org/browse/SERVER-59842</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;We can cause a prepare conflict if we set a wildcard index as multikey as part of a prepared transaction and then try to set it as multikey through a write separate from the transaction.&lt;/p&gt;

&lt;p&gt;The conflict comes from when we &lt;a href=&quot;https://github.com/mongodb/mongo/blob/810acb9723a4e74897ac446ed755221faa56e650/src/mongo/db/catalog/index_catalog_entry_impl.cpp#L240-L246&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;insert keys into the index itself&lt;/a&gt; for wildcard indexes (&lt;tt&gt;multiMetadataKeys&lt;/tt&gt; is populated by the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/810acb9723a4e74897ac446ed755221faa56e650/src/mongo/db/index/wildcard_access_method.cpp#L73&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;wildcard_key_generator&lt;/a&gt;). I think that is done in the same wuow as the transaction, which means that it will generate a prepare conflict if we try to write on top of it. &lt;/p&gt;

&lt;p&gt;I suspect this would be resolved if we did these writes in a side transaction block, like when we &lt;a href=&quot;https://github.com/mongodb/mongo/blob/810acb9723a4e74897ac446ed755221faa56e650/src/mongo/db/catalog/index_catalog_entry_impl.cpp#L282-L290&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;set the index as multikey&lt;/a&gt;. &lt;/p&gt;</description>
                <environment></environment>
        <key id="1870049">SERVER-59842</key>
            <summary>Setting wildcard index as multikey can cause prepare conflicts</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="2">Won&apos;t Fix</resolution>
                                        <assignee username="judah.schvimer@mongodb.com">Judah Schvimer</assignee>
                                    <reporter username="samy.lanka@mongodb.com">Samyukta Lanka</reporter>
                        <labels>
                    </labels>
                <created>Wed, 8 Sep 2021 21:39:52 +0000</created>
                <updated>Thu, 11 Nov 2021 18:21:11 +0000</updated>
                            <resolved>Thu, 11 Nov 2021 18:20:35 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="4183740" author="judah.schvimer" created="Thu, 11 Nov 2021 18:20:21 +0000"  >&lt;p&gt;Closing per &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=samy.lanka&quot; class=&quot;user-hover&quot; rel=&quot;samy.lanka&quot;&gt;samy.lanka&lt;/a&gt;&apos;s suggestion.&lt;/p&gt;</comment>
                            <comment id="4048900" author="samy.lanka" created="Thu, 9 Sep 2021 23:24:51 +0000"  >&lt;p&gt;I&apos;m starting to question whether this is worth fixing. The prepare conflict should resolve once we abort or commit the prepared transaction. If the prepared transaction exists indefinitely, then I think we&apos;ll have other issues to deal with. &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-41977&quot; title=&quot;Index lookups may conflict with prepared transactions&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-41977&quot;&gt;&lt;del&gt;SERVER-41977&lt;/del&gt;&lt;/a&gt; and &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-40167&quot; title=&quot;Index key removal should not encounter prepare conflicts on unrelated keys&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-40167&quot;&gt;&lt;del&gt;SERVER-40167&lt;/del&gt;&lt;/a&gt; are two other similar situations where we&apos;ve decided not to fix prepare conflicts in the past, although I think this issue is not as rare as both the linked issues. Marking this ticket as needing triage to discuss further. &lt;/p&gt;</comment>
                            <comment id="4048889" author="samy.lanka" created="Thu, 9 Sep 2021 23:15:04 +0000"  >&lt;p&gt;It looks like doing the writes in a side transaction block will cause other issues with transactions. Let&apos;s say we try to use the multikey path from the wildcard index to find some documents in the same transaction that set the index as multikey. The side transaction block writes at a timestamp not included in the readTimestamp for the transaction, which means that if we need to access the keys written to the index within the same transaction (like when serving a read), we&apos;ll hit an issue due to snapshot isolation. &lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                                        </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="717511">SERVER-40167</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="803621">SERVER-41766</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="334020" name="repro.js" size="1566" author="samy.lanka@mongodb.com" created="Wed, 8 Sep 2021 21:44:51 +0000"/>
                    </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_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 11 Nov 2021 18:20:21 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        2 years, 12 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_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>judah.schvimer@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            2 years, 12 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>15.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>judah.schvimer@mongodb.com</customfieldvalue>
            <customfieldvalue>samy.lanka@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i00wuf:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hzkuqv:</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_10750" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Steps To Reproduce</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;1. Create a wildcard index&lt;br/&gt;
2. Make the index multikey as part of a transaction&lt;br/&gt;
3. Prepare the transaction&lt;br/&gt;
4. Insert a doc into the same collection that would make the index multikey&lt;/p&gt;</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|i00izr:</customfieldvalue>

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