<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:16:14 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-7985] $or within findAndModify with a mongos should correctly check if all expressions in one shard </title>
                <link>https://jira.mongodb.org/browse/SERVER-7985</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Currently doing an $or([&lt;/p&gt;
{key1: A1,key2: B1}
&lt;p&gt;,&lt;/p&gt;
{key1:A2,key2:B2}
&lt;p&gt;,...] fails in a sharded cluster because it does not first check if the values given are on the same shard, whereas $in does check.  They should be consistent and do the best to implement findAndModify within one shard.  The below steps to reproduce shows the differences.  &lt;/p&gt;</description>
                <environment></environment>
        <key id="59940">SERVER-7985</key>
            <summary>$or within findAndModify with a mongos should correctly check if all expressions in one shard </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="3">Duplicate</resolution>
                                        <assignee username="backlog-server-query">Backlog - Query Team</assignee>
                                    <reporter username="matt.kalan@mongodb.com">Matt Kalan</reporter>
                        <labels>
                    </labels>
                <created>Wed, 19 Dec 2012 20:23:29 +0000</created>
                <updated>Tue, 6 Dec 2022 05:26:28 +0000</updated>
                            <resolved>Thu, 19 Apr 2018 22:15:34 +0000</resolved>
                                    <version>2.2.2</version>
                                                    <component>Querying</component>
                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1869553" author="david.storch" created="Thu, 19 Apr 2018 22:15:15 +0000"  >&lt;p&gt;Agreed that this belongs with the query team. The limitation described here still exists. I&apos;m marking this as a duplicate of a more recent ticket, &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-30225&quot; title=&quot;Sharded writes should extract shard key when it is in every branch of an $or&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-30225&quot;&gt;SERVER-30225&lt;/a&gt;, since the newer ticket has additional details and more watchers.&lt;/p&gt;</comment>
                            <comment id="1869183" author="greg.mckeon" created="Thu, 19 Apr 2018 18:48:21 +0000"  >&lt;p&gt;Found this as part of sharding reviewing old tickets - we believe this is a query issue.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="405965">SERVER-30225</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25143"><![CDATA[Query]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 19 Apr 2018 18:48:21 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        5 years, 42 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>alexander.golin@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            5 years, 42 weeks, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></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>backlog-server-query</customfieldvalue>
            <customfieldvalue>david.storch@mongodb.com</customfieldvalue>
            <customfieldvalue>greg.mckeon@mongodb.com</customfieldvalue>
            <customfieldvalue>matt.kalan@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrndyf:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrfos7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>7002</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_10750" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Steps To Reproduce</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;This fails&lt;br/&gt;
db.responses.update({&lt;br/&gt;
                &quot;$or&quot;:[&lt;/p&gt;
{&quot;itemId&quot;:24, &quot;importDocumentId&quot; : &quot;90016201230095201111&quot;}
&lt;p&gt;,&lt;br/&gt;
                                   &lt;/p&gt;
{&quot;itemId&quot;:24, &quot;importDocumentId&quot; : &quot;90016201230085201111&quot;}
&lt;p&gt;]},&lt;br/&gt;
                {$set:{responseStateCode:2}});&lt;br/&gt;
can&apos;t do non-multi update with query that doesn&apos;t have a valid shard key&lt;/p&gt;

&lt;p&gt;This works&lt;br/&gt;
db.responses.update({&lt;br/&gt;
                &quot;itemId&quot;:{$in:&lt;span class=&quot;error&quot;&gt;&amp;#91;24,25&amp;#93;&lt;/span&gt;},&lt;br/&gt;
                &quot;importDocumentId&quot;:{$in:&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;90016201230095201111&amp;quot;, &amp;quot;90016201230085201111&amp;quot;&amp;#93;&lt;/span&gt;}},&lt;br/&gt;
                {$set:{responseStateCode:2}});&lt;/p&gt;


&lt;p&gt;-------------&lt;del&gt;FindAndModify&lt;/del&gt;--------------&lt;/p&gt;

&lt;p&gt;This fails&lt;br/&gt;
db.responses.findAndModify({&lt;br/&gt;
                query:{&quot;$or&quot;:[&lt;/p&gt;
{&quot;itemId&quot;:24, &quot;importDocumentId&quot; : &quot;90016201230095201111&quot;}
&lt;p&gt;,&lt;br/&gt;
                                                                  &lt;/p&gt;
{&quot;itemId&quot;:24, &quot;importDocumentId&quot; : &quot;90016201230085201111&quot;}
&lt;p&gt;]},&lt;br/&gt;
                update : {$set:&lt;/p&gt;
{responseStateCode:2}
&lt;p&gt;}});&lt;br/&gt;
Thu Dec 13 16:12:32 uncaught exception: findAndModifyFailed failed: &quot;db assertion failure&quot;&lt;/p&gt;

&lt;p&gt;This works&lt;br/&gt;
db.responses.findAndModify({&lt;br/&gt;
                query:{&lt;br/&gt;
                                &quot;itemId&quot;:{$in:&lt;span class=&quot;error&quot;&gt;&amp;#91;24,25&amp;#93;&lt;/span&gt;},&lt;br/&gt;
                                &quot;importDocumentId&quot;:{$in:&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;90016201230095201111&amp;quot;, &amp;quot;90016201230085201111&amp;quot;&amp;#93;&lt;/span&gt;}},&lt;br/&gt;
                update : {$set:&lt;/p&gt;
{responseStateCode:2}
&lt;p&gt;}});&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|ht0mnb:</customfieldvalue>

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