<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:46:06 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-17951] db.currentOp() fails with read preference set</title>
                <link>https://jira.mongodb.org/browse/SERVER-17951</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;div class=&quot;panel&quot; style=&quot;background-color: #EEEEEE;border-color: #ccc;border-width: 1px;&quot;&gt;&lt;div class=&quot;panelHeader&quot; style=&quot;border-bottom-width: 1px;border-bottom-color: #ccc;background-color: #6CB33F;&quot;&gt;&lt;b&gt;Issue Status as of Apr 29, 2015&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;panelContent&quot; style=&quot;background-color: #EEEEEE;&quot;&gt;
&lt;p&gt;&lt;b&gt;ISSUE SUMMARY&lt;/b&gt;&lt;br/&gt;
In the &lt;tt&gt;mongo&lt;/tt&gt; shell, the &lt;tt&gt;killOp&lt;/tt&gt;, &lt;tt&gt;currentOp&lt;/tt&gt;, and &lt;tt&gt;fsyncUnlock&lt;/tt&gt; operations produce errors with non-primary read preferences.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;USER IMPACT&lt;/b&gt;&lt;br/&gt;
In the &lt;tt&gt;mongo&lt;/tt&gt; the &lt;tt&gt;killOp&lt;/tt&gt;, &lt;tt&gt;currentOp&lt;/tt&gt;, and &lt;tt&gt;fsyncUnlock&lt;/tt&gt; operations fail when sent with non-primary read preferences and the client disconnects. Drivers are not affected by this issue as they currently remove read preference before sending these commands.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;WORKAROUNDS&lt;/b&gt;&lt;br/&gt;
Set &lt;tt&gt;primary&lt;/tt&gt; read preference while running the &lt;tt&gt;killOp&lt;/tt&gt;, &lt;tt&gt;currentOp&lt;/tt&gt;, and &lt;tt&gt;fsyncUnlock&lt;/tt&gt; operations in the shell.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;AFFECTED VERSIONS&lt;/b&gt;&lt;br/&gt;
MongoDB 2.4.0 to 3.0.2&lt;/p&gt;

&lt;p&gt;&lt;b&gt;FIX VERSION&lt;/b&gt;&lt;br/&gt;
The fix is included in the 3.0.3 production release.&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;h6&gt;&lt;a name=&quot;Originaldescription&quot;&gt;&lt;/a&gt;Original description&lt;/h6&gt;

&lt;p&gt;When I set a read preference, e.g. &lt;tt&gt;db.getMongo().setReadPref(&quot;primary&quot;)&lt;/tt&gt; or &lt;tt&gt;db.getMongo().setReadPref(&quot;secondary&quot;)&lt;/tt&gt;, &lt;tt&gt;db.currentOp()&lt;/tt&gt; fails both on mongod and mongos.&lt;/p&gt;</description>
                <environment></environment>
        <key id="195010">SERVER-17951</key>
            <summary>db.currentOp() fails with read preference set</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="9">Done</resolution>
                                        <assignee username="sam.kleinman">Sam Kleinman</assignee>
                                    <reporter username="ole">Ole Langbehn</reporter>
                        <labels>
                    </labels>
                <created>Thu, 9 Apr 2015 09:37:55 +0000</created>
                <updated>Wed, 19 Dec 2018 11:19:08 +0000</updated>
                            <resolved>Fri, 10 Apr 2015 18:59:28 +0000</resolved>
                                    <version>2.6.8</version>
                                    <fixVersion>2.6.10</fixVersion>
                    <fixVersion>3.0.3</fixVersion>
                    <fixVersion>3.1.2</fixVersion>
                                    <component>Diagnostics</component>
                    <component>Shell</component>
                                        <votes>0</votes>
                                    <watches>8</watches>
                                                                                                                <comments>
                            <comment id="878767" author="xgen-internal-githook" created="Fri, 10 Apr 2015 21:48:33 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;tychoish&apos;, u&apos;name&apos;: u&apos;Sam Kleinman&apos;, u&apos;email&apos;: u&apos;samk@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-17951&quot; title=&quot;db.currentOp() fails with read preference set&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-17951&quot;&gt;&lt;del&gt;SERVER-17951&lt;/del&gt;&lt;/a&gt;: handle read preferences correctly for psudocommands&lt;br/&gt;
Branch: v2.6&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/1ff5c722724da743c57cd96d7f4c65eda8cbb3fc&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/1ff5c722724da743c57cd96d7f4c65eda8cbb3fc&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="878766" author="xgen-internal-githook" created="Fri, 10 Apr 2015 21:48:32 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;tychoish&apos;, u&apos;name&apos;: u&apos;Sam Kleinman&apos;, u&apos;email&apos;: u&apos;samk@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-17951&quot; title=&quot;db.currentOp() fails with read preference set&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-17951&quot;&gt;&lt;del&gt;SERVER-17951&lt;/del&gt;&lt;/a&gt;: handle read preferences correctly for psudocommands&lt;br/&gt;
Branch: v3.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/78f8f1aaaa3161109a85aada28b9f1c1b225e870&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/78f8f1aaaa3161109a85aada28b9f1c1b225e870&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="878535" author="xgen-internal-githook" created="Fri, 10 Apr 2015 18:58:16 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;tychoish&apos;, u&apos;name&apos;: u&apos;Sam Kleinman&apos;, u&apos;email&apos;: u&apos;samk@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-17951&quot; title=&quot;db.currentOp() fails with read preference set&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-17951&quot;&gt;&lt;del&gt;SERVER-17951&lt;/del&gt;&lt;/a&gt;: shell currentOp should always use primary read preference&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/54b410fdceb61c7ce450c190c578f1b992b81e99&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/54b410fdceb61c7ce450c190c578f1b992b81e99&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="877266" author="ole" created="Thu, 9 Apr 2015 17:20:11 +0000"  >&lt;p&gt;see &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-17749&quot; title=&quot;collMod usePowerOf2Sizes fails on mongos&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-17749&quot;&gt;&lt;del&gt;SERVER-17749&lt;/del&gt;&lt;/a&gt; for a similar issue triggered by read preference.&lt;/p&gt;

&lt;p&gt;by the way, I made sure that:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;i used --norc&lt;/li&gt;
	&lt;li&gt;without/before setting read preference, I can call &lt;tt&gt;db.currentOp()&lt;/tt&gt;&lt;/li&gt;
	&lt;li&gt;in case of the cluster running 2.6.8, that every component is in version 2.6.8&lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="876793" author="ole" created="Thu, 9 Apr 2015 09:48:06 +0000"  >&lt;p&gt;Just verified that this also occurs on 3.0.1 on a single instance installation (no rs, no sh)&lt;/p&gt;

&lt;p&gt;{{$ mongo&lt;br/&gt;
MongoDB shell version: 3.0.1&lt;br/&gt;
connecting to: test&lt;br/&gt;
&amp;gt; db.getMongo().setReadPref(&quot;primary&quot;)&lt;br/&gt;
&amp;gt; db.currentOp()&lt;br/&gt;
2015-04-09T11:39:27.244+0200 I NETWORK  DBClientCursor::init call() failed&lt;br/&gt;
2015-04-09T11:39:27.246+0200 E QUERY    Error: error doing query: failed&lt;br/&gt;
    at DBQuery._exec (src/mongo/shell/query.js:83:36)&lt;br/&gt;
    at DBQuery.hasNext (src/mongo/shell/query.js:240:10)&lt;br/&gt;
    at DBCollection.findOne (src/mongo/shell/collection.js:187:19)&lt;br/&gt;
    at DB.currentOp (src/mongo/shell/db.js:687:33)&lt;br/&gt;
    at (shell):1:4 at src/mongo/shell/query.js:83&lt;br/&gt;
2015-04-09T11:39:27.247+0200 I NETWORK  trying reconnect to 127.0.0.1:27017 (127.0.0.1) failed&lt;br/&gt;
2015-04-09T11:39:27.247+0200 I NETWORK  reconnect 127.0.0.1:27017 (127.0.0.1) ok&lt;br/&gt;
&amp;gt;}}&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="290734">SERVER-24341</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="57665">SERVER-7775</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>5.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_12451" key="com.atlassian.jira.plugin.system.customfieldtypes:multiversion">
                        <customfieldname>Backport Completed</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="15183">2.6.10</customfieldvalue>
    <customfieldvalue id="15290">3.0.3</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>Thu, 9 Apr 2015 17:24:29 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        8 years, 44 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/WRITING-1302'>WRITING-1302</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_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>wan.bachtiar@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            8 years, 44 weeks, 5 days ago
                        </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>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>ole</customfieldvalue>
            <customfieldvalue>sam.kleinman</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrl8sn:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hs7xpj:</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="477">BUILD 2 04/24/15</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;rs_DI:PRIMARY&amp;gt; db.getMongo().setReadPref(&quot;primary&quot;)&lt;br/&gt;
rs_DI:PRIMARY&amp;gt; db.currentOp()&lt;br/&gt;
2015-04-09T09:36:51.333+0000 DBClientCursor::init call() failed&lt;br/&gt;
2015-04-09T09:36:51.334+0000 Error: error doing query: failed at src/mongo/shell/query.js:81&lt;br/&gt;
2015-04-09T09:36:51.336+0000 trying reconnect to 127.0.0.1:27017 (127.0.0.1) failed&lt;br/&gt;
2015-04-09T09:36:51.337+0000 reconnect 127.0.0.1:27017 (127.0.0.1) ok&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_11861" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>User Summary</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="11858"><![CDATA[Completed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hsg4nr:</customfieldvalue>

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