<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:44:20 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-17410] listCommands returns unordered list</title>
                <link>https://jira.mongodb.org/browse/SERVER-17410</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;The command &lt;tt&gt;db.adminCommand({listCommands:1})&lt;/tt&gt; returns a JSON result with a list of commands supported by the server. In 2.6 this was ordered by command name (sorted). In 3.0 it has no order.&lt;/p&gt;</description>
                <environment></environment>
        <key id="186618">SERVER-17410</key>
            <summary>listCommands returns unordered list</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="5" iconUrl="https://jira.mongodb.org/images/icons/priorities/trivial.svg">Trivial - P5</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="rassi">J Rassi</assignee>
                                    <reporter username="jonathan.abrahams">Jonathan Abrahams</reporter>
                        <labels>
                            <label>28qa</label>
                            <label>neweng</label>
                    </labels>
                <created>Fri, 27 Feb 2015 17:16:29 +0000</created>
                <updated>Fri, 5 Feb 2016 14:30:05 +0000</updated>
                            <resolved>Tue, 7 Jul 2015 15:32:28 +0000</resolved>
                                                    <fixVersion>3.1.6</fixVersion>
                                    <component>Usability</component>
                                        <votes>0</votes>
                                    <watches>8</watches>
                                                                                                                <comments>
                            <comment id="959538" author="xgen-internal-githook" created="Tue, 7 Jul 2015 15:30:08 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;upendrag&apos;, u&apos;name&apos;: u&apos;Upendra Gowda&apos;, u&apos;email&apos;: u&apos;upendrag.gowda@gmail.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-17410&quot; title=&quot;listCommands returns unordered list&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-17410&quot;&gt;&lt;del&gt;SERVER-17410&lt;/del&gt;&lt;/a&gt;: listCommands returns unordered list&lt;/p&gt;

&lt;p&gt;Closes #990&lt;/p&gt;

&lt;p&gt;Signed-off-by: Jason Rassi &amp;lt;rassi@10gen.com&amp;gt;&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/de11b1cae53290aa8100185e90f7894d0adc80f8&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/de11b1cae53290aa8100185e90f7894d0adc80f8&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="957262" author="ramon.fernandez" created="Thu, 2 Jul 2015 20:10:00 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=upendrag&quot; class=&quot;user-hover&quot; rel=&quot;upendrag&quot;&gt;upendrag&lt;/a&gt;, &lt;a href=&quot;https://github.com/mongodb/mongo/pull/990&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;#990&lt;/a&gt; is being tested as we speak; if all testing passes then we&apos;ll merge your code. So far it&apos;s looking good, so feel free to start other tasks, we&apos;ll let you know if any further tweaking is needed.&lt;/p&gt;

&lt;p&gt;Regards,&lt;br/&gt;
Ram&#243;n.&lt;/p&gt;</comment>
                            <comment id="957261" author="upendrag" created="Thu, 2 Jul 2015 20:07:35 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=ramon.fernandez&quot; class=&quot;user-hover&quot; rel=&quot;ramon.fernandez&quot;&gt;ramon.fernandez&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;Just a quick question. Now that my patch has been &apos;LGTM&apos;ed, can I assume that the work is done and start looking into new tasks?&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Upendra&lt;/p&gt;</comment>
                            <comment id="954375" author="ramon.fernandez" created="Tue, 30 Jun 2015 12:28:56 +0000"  >&lt;p&gt;Thanks &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=upendrag&quot; class=&quot;user-hover&quot; rel=&quot;upendrag&quot;&gt;upendrag&lt;/a&gt;, sending your new PR for review.&lt;/p&gt;</comment>
                            <comment id="954172" author="upendrag" created="Tue, 30 Jun 2015 04:04:56 +0000"  >&lt;p&gt;Please find the new pull request at &lt;a href=&quot;https://github.com/mongodb/mongo/pull/990&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/pull/990&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="954092" author="upendrag" created="Tue, 30 Jun 2015 01:26:07 +0000"  >&lt;p&gt;Yes  &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=ramon.fernandez&quot; class=&quot;user-hover&quot; rel=&quot;ramon.fernandez&quot;&gt;ramon.fernandez&lt;/a&gt;. I think you are right. This happened due to recent &apos;clang&apos; formatting. I&apos;ll close the existing pull request and open a new one based on the most recent commit.&lt;/p&gt;</comment>
                            <comment id="954033" author="ramon.fernandez" created="Tue, 30 Jun 2015 00:11:34 +0000"  >&lt;p&gt;Thanks for updating the pull request &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=upendrag&quot; class=&quot;user-hover&quot; rel=&quot;upendrag&quot;&gt;upendrag&lt;/a&gt;. Unfortunately something went wrong during this process, as your pull request now contains over 250 commits and changes to over 2400 files! I can no longer see all the changes you propose without using the github API, which makes it very hard for anyone to review your work.&lt;/p&gt;

&lt;p&gt;I&apos;ll see if I can extract your proposed changes from this pull request, but it may be simpler (and clearer) to close it and open a new one containing only your changes for this ticket. What do you think?&lt;/p&gt;</comment>
                            <comment id="953976" author="upendrag" created="Mon, 29 Jun 2015 23:15:18 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=rassi%4010gen.com&quot; class=&quot;user-hover&quot; rel=&quot;rassi@10gen.com&quot;&gt;rassi@10gen.com&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;I have updated the pull request. Please review it and let me know if there are any comments.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Upendra&lt;/p&gt;</comment>
                            <comment id="946120" author="ramon.fernandez" created="Fri, 19 Jun 2015 21:59:13 +0000"  >&lt;p&gt;Thanks for the pull request &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=upendrag&quot; class=&quot;user-hover&quot; rel=&quot;upendrag&quot;&gt;upendrag&lt;/a&gt;! Will find a reviewer to take a look at your code and get back to you soon.&lt;/p&gt;</comment>
                            <comment id="944717" author="upendrag" created="Thu, 18 Jun 2015 19:48:14 +0000"  >&lt;p&gt;I have attached a link to the pull request in this ticket. Please review and let me know your comments.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Upendra&lt;/p&gt;</comment>
                            <comment id="935826" author="rassi@10gen.com" created="Tue, 9 Jun 2015 23:56:35 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=upendrag&quot; class=&quot;user-hover&quot; rel=&quot;upendrag&quot;&gt;upendrag&lt;/a&gt;: I&apos;d go with whichever of #1 or #2 produces more readable code.  &quot;listCommands&quot; is an infrequently-used administrative command that returns &amp;lt;50k of data and has no strict latency requirements, so the difference in speed or memory usage between those two doesn&apos;t seem particularly significant in this case.&lt;/p&gt;

&lt;p&gt;That said, a C++ suggestion for #2: you should generally prefer std::vector&amp;lt;&amp;gt; to std::list&amp;lt;&amp;gt; when you don&apos;t need fast insertion or removal at an arbitrary point in the list.&lt;/p&gt;

&lt;p&gt;Looking forward to your pull request!&lt;/p&gt;

&lt;p&gt;~ Jason Rassi&lt;/p&gt;</comment>
                            <comment id="935541" author="upendrag" created="Tue, 9 Jun 2015 19:24:59 +0000"  >&lt;p&gt;Thanks for the feedback &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=ramon.fernandez&quot; class=&quot;user-hover&quot; rel=&quot;ramon.fernandez&quot;&gt;ramon.fernandez&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Since the commands are stored as UnorderedFastKeyTable (a Hashtable with linear probing), I am not sure if it is possible to sort them directly. The 2 other approaches that I could think of are&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Approach 1&lt;/b&gt;:  Construct a map&amp;lt;commandName, CommandObj&amp;gt; from commands table and iterate through this map to build the result BSON obj. This is fast but there is a memory overhead.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Approach 2&lt;/b&gt;: Construct a list&amp;lt;commandName&amp;gt; from commands table and iterate through this list while retrieving Command Objects from commands table using the commandName to build the result BSON obj. This approach is not as fast as &quot;approach 1&quot; but uses less memory.&lt;/p&gt;</comment>
                            <comment id="934621" author="ramon.fernandez" created="Mon, 8 Jun 2015 23:12:55 +0000"  >&lt;p&gt;Thanks for following up in the ticket &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=upendrag&quot; class=&quot;user-hover&quot; rel=&quot;upendrag&quot;&gt;upendrag&lt;/a&gt;. Before we move forward I&apos;d strongly recommend you take a look at our &lt;a href=&quot;https://www.mongodb.org/about/contributors/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;contributors page&lt;/a&gt;, specially the &lt;a href=&quot;https://www.mongodb.org/about/contributors/getting-started/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;getting started&lt;/a&gt; section which talks about the &lt;a href=&quot;https://www.mongodb.org/about/contributors/tutorial/submit-a-github-pull-request/#go-to-your-repository&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;contributor&apos;s agreement&lt;/a&gt;, setting up a fork, etc.&lt;/p&gt;

&lt;p&gt;The ticket can&apos;t be assigned to you, so all the work happens via pull requests in github. Note that the preferred approach here would be to sort the commands before returning them, so I think you should consider that option as well &amp;#8211; but if you think other options are better you&apos;re welcome to argue your case here.&lt;/p&gt;

&lt;p&gt;Please check out the links above and let us know if you have any further questions.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Ram&#243;n.&lt;/p&gt;</comment>
                            <comment id="934614" author="upendrag" created="Mon, 8 Jun 2015 23:03:56 +0000"  >&lt;p&gt;Hi Ramon/Jonathan,&lt;/p&gt;

&lt;p&gt;I believe the issue was caused by the commit &lt;a href=&quot;https://github.com/mongodb/mongo/commit/edb2a9a1a5d13c3d11381a4f4370584d00bad883&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/edb2a9a1a5d13c3d11381a4f4370584d00bad883&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;The data structure holding the &quot;Command::_commands&quot; object in &quot;src/mongo/db/dbcommands_generic.cpp&quot; was changed from map&amp;lt;string,Command*&amp;gt; to CommandMap which is of type UnorderedFastKeyTable&amp;lt;...&amp;gt;. Before this change, the result bson object was sorted by command names because it is constructed by iterating through &quot;_commands&quot; in &quot;ListCommandsCmd::run()&quot; and &quot;_commands&quot; was naturally ordered by map&apos;s key (command name).&lt;/p&gt;

&lt;p&gt;A straightforward fix would be to have a temporary sorted container for commands and iterating through this temporary container to construct the result bson object. There is a trade off with performance though.&lt;/p&gt;

&lt;p&gt;I think this an ideal task for beginner. Shall I go ahead and assign the ticket to myself and start working on alternative solutions?&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Upendra&lt;/p&gt;
</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="215266">SERVER-19308</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>14.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, 27 Feb 2015 19:07:14 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        8 years, 32 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_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>
                            8 years, 32 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>jonathan.abrahams</customfieldvalue>
            <customfieldvalue>rassi</customfieldvalue>
            <customfieldvalue>ramon.fernandez@mongodb.com</customfieldvalue>
            <customfieldvalue>upendrag</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrlbov:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>164353</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="572">Quint Iteration 6</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|hsg87r:</customfieldvalue>

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