<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:55: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-40620] Return or log error if an index key is present but the document is not</title>
                <link>https://jira.mongodb.org/browse/SERVER-40620</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;If a FETCH follows an IXSCAN, it should be guaranteed that if the index key exists, so does the record. &lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/b99be34f9db7416259e49dcf741719bc7f20908d/src/mongo/db/exec/working_set_common.cpp#L69-L72&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;We simply return as if no records exists&lt;/a&gt;. No error, no warning.&lt;/p&gt;</description>
                <environment></environment>
        <key id="737560">SERVER-40620</key>
            <summary>Return or log error if an index key is present but the document is not</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="justin.seyster@mongodb.com">Justin Seyster</assignee>
                                    <reporter username="louis.williams@mongodb.com">Louis Williams</reporter>
                        <labels>
                    </labels>
                <created>Fri, 12 Apr 2019 17:22:10 +0000</created>
                <updated>Sun, 29 Oct 2023 22:22:02 +0000</updated>
                            <resolved>Tue, 21 Jan 2020 18:46:07 +0000</resolved>
                                                    <fixVersion>4.3.3</fixVersion>
                                    <component>Index Maintenance</component>
                    <component>Querying</component>
                                        <votes>3</votes>
                                    <watches>13</watches>
                                                                                                                <comments>
                            <comment id="2740222" author="xgen-internal-githook" created="Fri, 17 Jan 2020 22:06:48 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;username&apos;: &apos;jseyster&apos;, &apos;name&apos;: &apos;Justin Seyster&apos;, &apos;email&apos;: &apos;justin.seyster@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-40620&quot; title=&quot;Return or log error if an index key is present but the document is not&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-40620&quot;&gt;&lt;del&gt;SERVER-40620&lt;/del&gt;&lt;/a&gt; uassert and log when fetching dangling index entry&lt;/p&gt;

&lt;p&gt;If a FETCH_STAGE encounters a record id that does not reference any&lt;br/&gt;
existing documents, that means either the document was deleted since&lt;br/&gt;
query execution encountered the index entry or their is corruption&lt;br/&gt;
somewhere. If the snapshot id indicates that the query has not yielded&lt;br/&gt;
since the time that the index entry was loaded, that leaves corruption&lt;br/&gt;
as the only possibility. We return and error and write to the log with&lt;br/&gt;
instructions on how to address potentially inconsistent data.&lt;/p&gt;

&lt;p&gt; create mode 100644 jstests/noPassthrough/query_yields_catch_index_corruption.js&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/8e810c9ff48db40e63b3201f8bd4d0bf4fdea8ce&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/8e810c9ff48db40e63b3201f8bd4d0bf4fdea8ce&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2536904" author="craig.homa" created="Tue, 12 Nov 2019 16:50:29 +0000"  >&lt;p&gt;Moving back to open as the dependent tickets have been completed. &lt;/p&gt;</comment>
                            <comment id="2381554" author="justin.seyster" created="Wed, 21 Aug 2019 19:22:06 +0000"  >&lt;p&gt;If the solution to &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-42956&quot; title=&quot;ReadyIndexesIterator::_advance() does not perform isReady() check&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-42956&quot;&gt;&lt;del&gt;SERVER-42956&lt;/del&gt;&lt;/a&gt; involves just restoring the isReady() check, we should be able to just un-revert the original change.&lt;/p&gt;</comment>
                            <comment id="2321738" author="xgen-internal-githook" created="Thu, 11 Jul 2019 19:32:40 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Misha Ivkov&apos;, &apos;email&apos;: &apos;misha.ivkov@10gen.com&apos;}
&lt;p&gt;Message: Revert &quot;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-40620&quot; title=&quot;Return or log error if an index key is present but the document is not&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-40620&quot;&gt;&lt;del&gt;SERVER-40620&lt;/del&gt;&lt;/a&gt; fassert during document fetch when there is evidence of index corruption&quot;&lt;/p&gt;

&lt;p&gt;This reverts commit cf6ffa0d0b72574bf6fee66a46e1b264c0cc6d63.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/95d6412f4d1d150e3027048b27eca07c5dec27be&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/95d6412f4d1d150e3027048b27eca07c5dec27be&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2321501" author="xgen-internal-githook" created="Thu, 11 Jul 2019 17:37:49 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Misha Ivkov&apos;, &apos;email&apos;: &apos;misha.ivkov@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-40620&quot; title=&quot;Return or log error if an index key is present but the document is not&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-40620&quot;&gt;&lt;del&gt;SERVER-40620&lt;/del&gt;&lt;/a&gt; fassert during document fetch when there is evidence of index corruption&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/cf6ffa0d0b72574bf6fee66a46e1b264c0cc6d63&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/cf6ffa0d0b72574bf6fee66a46e1b264c0cc6d63&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2265588" author="louis.williams" created="Thu, 30 May 2019 17:38:49 +0000"  >&lt;p&gt;Sending back to Query because this involves a little bit more work than initially expected.&lt;/p&gt;</comment>
                            <comment id="2259688" author="david.storch" created="Fri, 24 May 2019 19:34:25 +0000"  >&lt;p&gt;Due to query yielding, it is possible under normal operation for the FETCH stage to fail to find a document. Some query execution stages (e.g. TEXT_OR for &lt;tt&gt;$text&lt;/tt&gt; execution) buffer index keys in the RID_AND_IDX state. These buffered keys may survive a yield, thereby becoming inconsistent with the storage engine snapshot which the read attaches to after recovering from yield. When this happens, the FETCH may find nothing associated with the RecordId. This is perfectly normal, and it would be incorrect to produce an error or a warning in all such cases.&lt;/p&gt;

&lt;p&gt;Luckily, the &lt;tt&gt;WorkingSet&lt;/tt&gt; tracks which index keys have survived a yield. Before yielding, the &lt;tt&gt;PlanExecutor&lt;/tt&gt; calls &lt;a href=&quot;https://github.com/mongodb/mongo/blob/8205eb6955fb0e21f98e280d5e9e8dc2b91b73d5/src/mongo/db/exec/working_set_common.h#L54&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;WorkingSetCommon::prepareForSnapshotChange()&lt;/a&gt;, which flags all index keys in the &lt;tt&gt;WorkingSet&lt;/tt&gt; as &quot;suspicious&quot;. If the FETCH stage fails to find a document associated with a &quot;suspicious&quot; key, that&apos;s perfectly normal. However, there should be no way for FETCHing a key that is &lt;em&gt;not&lt;/em&gt; flagged as suspicious to fail to find a document. &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; is going to test this hypothesis by adding a assertion &lt;a href=&quot;https://github.com/mongodb/mongo/blob/b99be34f9db7416259e49dcf741719bc7f20908d/src/mongo/db/exec/working_set_common.cpp#L71&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt; that the index key is not suspicious.&lt;/p&gt;

&lt;p&gt;Please send me the code review for any eventual change spawned by this ticket, and add the query team to CC.&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="903026">SERVER-42956</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="905164">SERVER-43018</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10520">
                    <name>Problem/Incident</name>
                                            <outwardlinks description="causes">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                                        </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>7.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>12.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16775"><![CDATA[v4.2]]></customfieldvalue>
    <customfieldvalue key="15640"><![CDATA[v4.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, 19 Apr 2019 17:36:30 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        4 years, 3 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-42956'>SERVER-42956</a></s>, <s><a href='https://jira.mongodb.org/browse/SERVER-43018'>SERVER-43018</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_17050" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Downstream Team Attention</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16941"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>luke.bonanomi@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            4 years, 3 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_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>craig.homa@mongodb.com</customfieldvalue>
            <customfieldvalue>david.storch@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>justin.seyster@mongodb.com</customfieldvalue>
            <customfieldvalue>louis.williams@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|huucrr:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr6r4f:</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="2844">Query 2019-06-17</customfieldvalue>
    <customfieldvalue id="2845">Query 2019-07-01</customfieldvalue>
    <customfieldvalue id="2880">Query 2019-07-15</customfieldvalue>
    <customfieldvalue id="2881">Query 2019-07-29</customfieldvalue>
    <customfieldvalue id="2882">Query 2019-08-12</customfieldvalue>
    <customfieldvalue id="2883">Query 2019-08-26</customfieldvalue>
    <customfieldvalue id="2884">Query 2019-09-09</customfieldvalue>
    <customfieldvalue id="2885">Query 2019-09-23</customfieldvalue>
    <customfieldvalue id="2886">Query 2019-10-07</customfieldvalue>
    <customfieldvalue id="3288">Query 2019-12-30</customfieldvalue>
    <customfieldvalue id="3289">Query 2020-01-13</customfieldvalue>
    <customfieldvalue id="3290">Query 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|hutz13:</customfieldvalue>

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