<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:52: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>[JAVA-364] MapReduceOutput sometimes returns empty results in a replica set when SLAVE_OK=true</title>
                <link>https://jira.mongodb.org/browse/JAVA-364</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;After debugging this, I found that the map-reduce output collection is written to the master, but if you connected to the replica set with SLAVE_OK=true, you may very well be reading from a slave node before the output collection has been synced there, which will indeed give you empty results.&lt;/p&gt;

&lt;p&gt;The workaround I put in my code is to ensure that the output collection never has the SLAVE_OK=true option, no matter what connection options were set. However, I suggest putting this in the MapReduceOutput code. This could be added to the constructor:&lt;/p&gt;

&lt;p&gt; _coll = db.getCollection( _collname );&lt;br/&gt;
 if (_coll != null) _coll.setOptions(_coll.getOptions() &amp;amp; ~Bytes.QUERYOPTION_SLAVEOK);&lt;/p&gt;

&lt;p&gt;I have tested similar code with my applications, and it has indeed made this bug go away!&lt;/p&gt;</description>
                <environment></environment>
        <key id="17804">JAVA-364</key>
            <summary>MapReduceOutput sometimes returns empty results in a replica set when SLAVE_OK=true</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="antoine">Antoine Girbal</assignee>
                                    <reporter username="tal.liron">Tal Liron</reporter>
                        <labels>
                    </labels>
                <created>Thu, 2 Jun 2011 15:50:32 +0000</created>
                <updated>Tue, 25 Jun 2013 16:49:46 +0000</updated>
                            <resolved>Fri, 12 Aug 2011 00:10:37 +0000</resolved>
                                    <version>2.6.1</version>
                                    <fixVersion>2.7</fixVersion>
                                    <component>Cluster Management</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="48307" author="auto" created="Fri, 12 Aug 2011 00:10:59 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;agirbal&apos;, u&apos;name&apos;: u&apos;agirbal&apos;, u&apos;email&apos;: u&apos;antoine@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-364&quot; title=&quot;MapReduceOutput sometimes returns empty results in a replica set when SLAVE_OK=true&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-364&quot;&gt;&lt;del&gt;JAVA-364&lt;/del&gt;&lt;/a&gt;: MapReduceOutput sometimes returns empty results in a replica set when SLAVE_OK=true&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/81aa6c5a34ccf088d6680f9d801ef38ef0c057e2&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/81aa6c5a34ccf088d6680f9d801ef38ef0c057e2&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="48306" author="antoine" created="Fri, 12 Aug 2011 00:10:38 +0000"  >&lt;p&gt;Hey Tal, thanks for report and fix.&lt;br/&gt;
It&apos;s in trunk now.&lt;/p&gt;</comment>
                            <comment id="47820" author="tal.liron" created="Wed, 10 Aug 2011 18:34:43 +0000"  >&lt;p&gt;Version 2.6.5 just came out, and still my incredibly simple patch has not been applied since version 2.6.1.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="20302">JAVA-404</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                        <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_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrhc1b:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>14750</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>