<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:56:51 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-1376] Yield in QueryPlanSet</title>
                <link>https://jira.mongodb.org/browse/SERVER-1376</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;if finding the first object is slow, update doesn&apos;t yield.&lt;/p&gt;

&lt;p&gt;Constructors should be instantanous&lt;/p&gt;

&lt;p&gt;only next() should iterate,&lt;/p&gt;

&lt;p&gt;(gdb) &lt;br/&gt;
#0  std::vector&amp;lt;boost::shared_ptr&amp;lt;mongo::QueryOp&amp;gt;, std::allocator&amp;lt;boost::shared_ptr&amp;lt;mongo::QueryOp&amp;gt; &amp;gt; &amp;gt;::size (this=0x0) at stl_vector.h:399&lt;br/&gt;
#1  0x000000010009f9f2 in mongo::QueryPlanSet::Runner::run (this=0x101708e30) at db/queryoptimizer.cpp:551&lt;br/&gt;
#2  0x00000001000a1e65 in mongo::QueryPlanSet::runOp (this=0x101011f40, op=@0x101011710) at db/queryoptimizer.cpp:460&lt;br/&gt;
#3  0x00000001000a2175 in mongo::MultiPlanScanner::runOpOnce (this=0x101010b70, op=@0x101011710) at db/queryoptimizer.cpp:642&lt;br/&gt;
#4  0x000000010006fdd6 in mongo::MultiPlanScanner::runOpOnce&amp;lt;mongo::MultiCursor::CursorOp&amp;gt; (this=0x101010b70, op=@0x101011710) at queryoptimizer.h:266&lt;br/&gt;
#5  0x000000010006ccc5 in mongo::MultiCursor::nextClause (this=0x1010117b0) at queryoptimizer.h:366&lt;br/&gt;
#6  0x000000010006db75 in mongo::MultiCursor::MultiCursor (this=0x1010117b0, ns=0x101814a14 &quot;mongo-test.perf&quot;, pattern=@0x1017097f0, order=@0x101709580, op=@0x101709620) at queryoptimizer.h:308&lt;br/&gt;
#7  0x0000000100148e8a in mongo::_updateObjects (god=false, ns=0x101814a14 &quot;mongo-test.perf&quot;, updateobj=@0x101709930, patternOrig=@0x1017097f0, upsert=false, multi=false, logop=true, debug=@0x108000a70) at db/update.cpp:896&lt;br/&gt;
#8  0x000000010014a61b in mongo::updateObjects (ns=0x101814a14 &quot;mongo-test.perf&quot;, updateobj=@0x101709930, patternOrig=@0x101709910, upsert=false, multi=false, logop=true, debug=@0x108000a70) at db/update.cpp:1109&lt;br/&gt;
#9  0x00000001001b2f01 in mongo::receivedUpdate (m=@0x101709df0, op=@0x108000820) at db/instance.cpp:455&lt;br/&gt;
#10 0x00000001001b4bd2 in mongo::assembleResponse (m=@0x101709df0, dbresponse=@0x101709d40, client=@0x108000318) at db/instance.cpp:323&lt;br/&gt;
#11 0x000000010023ded3 in mongo::connThread () at db/db.cpp:247&lt;br/&gt;
#12 0x00000001000de25d in boost::detail::thread_data&amp;lt;void &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/star_yellow.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;()&amp;gt;::run (this=0x108000420) at thread.hpp:56&lt;br/&gt;
#13 0x0000000100def404 in thread_proxy ()&lt;br/&gt;
#14 0x00007fff8280d456 in _pthread_start ()&lt;/p&gt;</description>
                <environment></environment>
        <key id="12375">SERVER-1376</key>
            <summary>Yield in QueryPlanSet</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="2" iconUrl="https://jira.mongodb.org/images/icons/priorities/critical.svg">Critical - P2</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="aaron">Aaron Staple</assignee>
                                    <reporter username="eliot">Eliot Horowitz</reporter>
                        <labels>
                    </labels>
                <created>Wed, 7 Jul 2010 17:35:34 +0000</created>
                <updated>Tue, 12 Jul 2016 00:28:01 +0000</updated>
                            <resolved>Thu, 8 Jul 2010 02:43:49 +0000</resolved>
                                                    <fixVersion>1.5.5</fixVersion>
                                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="15549" author="eliot" created="Wed, 7 Jul 2010 18:35:40 +0000"  >&lt;p&gt;Ok that&apos;s a bug&lt;/p&gt;

&lt;p&gt;Let&apos;s bite the bullet and move to that part to UserQueryOp&lt;/p&gt;</comment>
                            <comment id="15548" author="aaron" created="Wed, 7 Jul 2010 18:20:00 +0000"  >&lt;p&gt;I might be missing something, but it looks like there may be an issue with UserQueryOp - multiple UserQueryOps are going to be alive at the same time, each with their own cursors.  But not all of them are necessarily going to have client cursors when one of the UserQueryOps yields.&lt;/p&gt;

&lt;p&gt;If we fix this by making QueryPlanSet in charge of administering yielding, the same solution will work for Update and Delete.  Will take more than an hour to do it.&lt;/p&gt;</comment>
                            <comment id="15547" author="eliot" created="Wed, 7 Jul 2010 18:08:23 +0000"  >&lt;p&gt;Do queries work the same way or are those different?&lt;/p&gt;

&lt;p&gt;I added yielding in UserQueryOp itself, so perhaps different.&lt;/p&gt;</comment>
                            <comment id="15546" author="eliot" created="Wed, 7 Jul 2010 18:07:40 +0000"  >&lt;p&gt;How hard is it to make QueryPLanSet yield?&lt;/p&gt;

&lt;p&gt;If its more than an hour, lets have remove and update use &quot;best guess&quot;&lt;/p&gt;</comment>
                            <comment id="15545" author="eliot" created="Wed, 7 Jul 2010 18:07:07 +0000"  >&lt;p&gt;Ok - lets make an option to QueryPlanSet to yield.&lt;/p&gt;

&lt;p&gt;Want an option, because some things could have cached items so need be aware of it.&lt;br/&gt;
and a way to find out if it did in fact yield.&lt;/p&gt;
</comment>
                            <comment id="15544" author="aaron" created="Wed, 7 Jul 2010 18:04:19 +0000"  >&lt;p&gt;An alternative quick and dirty fix is to have update use a &quot;best guess&quot; plan.&lt;/p&gt;

&lt;p&gt;Let me know what you want me to do.&lt;/p&gt;</comment>
                            <comment id="15542" author="aaron" created="Wed, 7 Jul 2010 18:01:33 +0000"  >&lt;p&gt;So, both before and after MultiCursor on an update we did the following:&lt;/p&gt;

&lt;p&gt;1) find first match using all plans in parallel&lt;br/&gt;
2) continue finding subsequent matches using the best plan&lt;/p&gt;

&lt;p&gt;By the time the update implementation has a cursor, 1 has already happened.  Making QueryPlanSet, etc yield is a relatively general solution.&lt;/p&gt;</comment>
                            <comment id="15541" author="eliot" created="Wed, 7 Jul 2010 17:58:52 +0000"  >&lt;p&gt;Oh - is the issue that&apos;s its trying different plans?&lt;/p&gt;</comment>
                            <comment id="15539" author="aaron" created="Wed, 7 Jul 2010 17:55:37 +0000"  >&lt;p&gt;Yielding in UpdateOp is tricky because we&apos;ll need to have all the different UpdateOps keep a temp client cursor.  I can add an option to QueryPlanSet, etc, to allow yielding while the different plans are running.  Will be a bit of work.&lt;/p&gt;</comment>
                            <comment id="15537" author="eliot" created="Wed, 7 Jul 2010 17:54:10 +0000"  >&lt;p&gt;Why does the scan have to happen there?&lt;/p&gt;

&lt;p&gt;Shouldn&apos;t next be instaneous?&lt;br/&gt;
I must be missing something...&lt;/p&gt;

&lt;p&gt;Don&apos;t want to fix in UpdateOp as this similar logic in many places.&lt;/p&gt;
</comment>
                            <comment id="15536" author="aaron" created="Wed, 7 Jul 2010 17:50:19 +0000"  >&lt;p&gt;This behavior is the same as we had without the multi cursor.  Before MultiCursor we did:&lt;/p&gt;

&lt;p&gt;QueryPlanSet qps( ns, patternOrig, BSONObj() );&lt;br/&gt;
        UpdateOp original;&lt;br/&gt;
        shared_ptr&amp;lt; UpdateOp &amp;gt; u = qps.runOp( original );&lt;/p&gt;


&lt;p&gt;That runOp found the first match, so it could take a while and there was no yielding happening.  I could make the constructor for MultiCursor instantaneous, but then when you did init() or next() you would still do a long scan without yielding.  I think we can fix this by adding a yield to UpdateOp.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>11.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 7 Jul 2010 17:50:19 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        13 years, 33 weeks 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>ramon.fernandez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            13 years, 33 weeks 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>aaron</customfieldvalue>
            <customfieldvalue>eliot</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrpjzz:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>22058</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_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|ht0ig7:</customfieldvalue>

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