<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:01:15 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-2814] Server does not properly store a BSON object that contains NaN</title>
                <link>https://jira.mongodb.org/browse/SERVER-2814</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;BSON objects that have NaN (and probably +/- infinity) are not stored in the database.&lt;/p&gt;</description>
                <environment>&amp;nbsp;1.6.6 and 1.8.0</environment>
        <key id="15202">SERVER-2814</key>
            <summary>Server does not properly store a BSON object that contains NaN</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="4">Incomplete</resolution>
                                        <assignee username="eliot">Eliot Horowitz</assignee>
                                    <reporter username="rn@deftlabs.com">Ryan Nitz</reporter>
                        <labels>
                    </labels>
                <created>Tue, 22 Mar 2011 00:19:15 +0000</created>
                <updated>Mon, 29 Aug 2011 15:56:42 +0000</updated>
                            <resolved>Tue, 3 May 2011 04:21:13 +0000</resolved>
                                    <version>1.8.0</version>
                                                    <component>Internal Code</component>
                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="30852" author="rgnitz" created="Tue, 3 May 2011 19:18:13 +0000"  >&lt;p&gt;It&apos;s actually not a pymongo bug.&lt;/p&gt;

&lt;p&gt;Some of the documents returned have periods in their keys.&lt;/p&gt;

&lt;p&gt;Thanks for tracking this down Bernie!&lt;/p&gt;

&lt;p&gt;E.g. (period is in the hostname)&lt;/p&gt;

&lt;p&gt;    &quot;connPoolStats&quot;: {&lt;br/&gt;
        &quot;createdByType&quot;: &lt;/p&gt;
{
            &quot;master&quot;: 10276,
            &quot;sync&quot;: 9
        }
&lt;p&gt;,&lt;br/&gt;
        &quot;hosts&quot;: {&lt;br/&gt;
            &quot;mongo-configs-1.hostname.com:26080,mongo-configs-2.hostname.com:26080,mongo-configs-3.hostname.com:26080&quot;: &lt;/p&gt;
{
                &quot;available&quot;: 2,
                &quot;created&quot;: 9
            }
&lt;p&gt;,&lt;br/&gt;
        },&lt;br/&gt;
        &quot;numAScopedConnection&quot;: 6,&lt;br/&gt;
        &quot;numDBClientConnection&quot;: 6357,&lt;br/&gt;
        &quot;ok&quot;: 1,&lt;br/&gt;
        &quot;totalAvailable&quot;: 35,&lt;br/&gt;
        &quot;totalCreated&quot;: 10285&lt;br/&gt;
    },&lt;/p&gt;</comment>
                            <comment id="30847" author="rgnitz" created="Tue, 3 May 2011 18:46:19 +0000"  >&lt;p&gt;Bernie is investigating pymongo... and the various versions of Python. Until recently, Python had weird double support.&lt;/p&gt;</comment>
                            <comment id="30754" author="eliot" created="Tue, 3 May 2011 04:21:13 +0000"  >&lt;p&gt;Seems to be a python issue&lt;/p&gt;</comment>
                            <comment id="30746" author="rgnitz" created="Tue, 3 May 2011 02:41:09 +0000"  >&lt;p&gt;This seems to be working now with Java driver 2.5.3 and 1.8.1.&lt;/p&gt;

&lt;p&gt;Attached (mongo-java-double.tar.gz) is a unit test to confirm that everything works as expected between Java and Mongo.&lt;/p&gt;

&lt;p&gt;&amp;gt; db.testDouble.findOne();&lt;br/&gt;
{&lt;br/&gt;
        &quot;_id&quot; : ObjectId(&quot;4dbf6939e51ea44031320e99&quot;),&lt;br/&gt;
        &quot;nested&quot; : &lt;/p&gt;
{
                &quot;MAX_VALUE&quot; : 1.7976931348623157e+308,
                &quot;MIN_VALUE&quot; : 5e-324,
                &quot;NaN&quot; : NaN,
                &quot;NEGATIVE_INFINITY&quot; : -Infinity,
                &quot;POSITIVE_INFINITY&quot; : Infinity
        }
&lt;p&gt;}&lt;/p&gt;


&lt;p&gt;The BSON I&apos;m storing via Java is being generated by Python so I&apos;m going to see if that is the source of the problem. If that is not a problem... we can close.&lt;/p&gt;
</comment>
                            <comment id="30744" author="dwight_10gen" created="Tue, 3 May 2011 02:04:54 +0000"  >&lt;p&gt;the following works...suggesting not a problem?  i don&apos;t usually use the java driver if you can send me something with shell that does it would be helpful.&lt;/p&gt;

&lt;p&gt;C:\cygwin\home\dwight\mongo&amp;gt;mongo&lt;br/&gt;
MongoDB shell version: 1.9.0-pre-&lt;br/&gt;
connecting to: test&lt;br/&gt;
&amp;gt; y = Number.NaN&lt;br/&gt;
NaN&lt;br/&gt;
&amp;gt; db.aab.insert(&lt;/p&gt;
{z:y}
&lt;p&gt;)&lt;br/&gt;
&amp;gt; db.aab.find()&lt;/p&gt;
{ &quot;_id&quot; : ObjectId(&quot;4dbf62413b544e89b091d094&quot;), &quot;z&quot; : NaN }
&lt;p&gt;&amp;gt; isNaN(3)&lt;br/&gt;
false&lt;br/&gt;
&amp;gt; isNaN(3.3)&lt;br/&gt;
false&lt;br/&gt;
&amp;gt; isNaN(db.aab.findOne().z)&lt;br/&gt;
true&lt;/p&gt;</comment>
                            <comment id="26504" author="rgnitz" created="Tue, 22 Mar 2011 18:28:48 +0000"  >&lt;p&gt;Yes... I was able to hack my way around it (see previous comment). &lt;/p&gt;

&lt;p&gt;I&apos;ll change the bug to a server bug.&lt;/p&gt;</comment>
                            <comment id="26503" author="antoine" created="Tue, 22 Mar 2011 18:20:00 +0000"  >&lt;p&gt;basically the driver seems ok.&lt;br/&gt;
Java driver uses Double class to encode/decode the value and NaN is properly supported.&lt;br/&gt;
Also it can write it to JSON, but cannot parse it back (this I will fix).&lt;br/&gt;
Then the issue seems on server side, which doesnt like the double value when reads it.&lt;br/&gt;
Why do you need to use this value in MMS? Can you prevent against it?&lt;/p&gt;</comment>
                            <comment id="26501" author="rgnitz" created="Tue, 22 Mar 2011 17:54:49 +0000"  >
&lt;p&gt;As a hack for MMS, I now serialize the data to a byte array using BSON.encode (thus the byte[] is stored in Mongo) and then for display, I use BSON.decode. No exceptions are thrown. &lt;/p&gt;

&lt;p&gt;MMS then converts the BSON to a JSON object for display in the UI (to take advantage of the org.json.JSONObject formatting options).&lt;/p&gt;

&lt;p&gt;The NaN values display properly in the converted document (as NaN).&lt;/p&gt;

&lt;p&gt;There is a problem with NaN in the Python driver too. Perhaps this is something that needs to be addressed in the product and drivers. I&apos;m sure negative/positive infinity is also a problem.&lt;/p&gt;

&lt;p&gt;Here is the hack I put in place to work around this problem:&lt;/p&gt;

&lt;p&gt;        JSONObject pingJson = null;&lt;br/&gt;
        if (ping != null) {&lt;br/&gt;
            final byte [] data = (byte[])ping.get(&quot;d&quot;);&lt;br/&gt;
            if (data != null) &lt;/p&gt;
{
                final BSONObject bson = BSON.decode(data);
                pingJson = new JSONObject(bson.toString());
            }
&lt;p&gt; else &lt;/p&gt;
{
                pingJson = new JSONObject();
            }
&lt;p&gt;        } else &lt;/p&gt;
{ pingJson = new JSONObject(); }

&lt;p&gt;        params.put(&quot;serverResponse&quot;, pingJson.toString(4));&lt;/p&gt;</comment>
                            <comment id="26499" author="antoine" created="Tue, 22 Mar 2011 17:35:46 +0000"  >&lt;p&gt;looks like there is bad data in the record, some double values are &quot;NaN&quot;.&lt;br/&gt;
Maybe some kind of division by 0?&lt;br/&gt;
When you print json you can see &quot;avgObjSize&quot; : NaN&lt;br/&gt;
I&apos;m guessing the bson decoder on server side doesnt like it..&lt;/p&gt;</comment>
                            <comment id="26496" author="antoine" created="Tue, 22 Mar 2011 16:34:40 +0000"  >&lt;p&gt;If you set a safe writeconcern, you get this exception, so server doesnt like record.&lt;br/&gt;
1st going to check that obj looks ok on the client side&lt;/p&gt;

&lt;p&gt;$ ant run&lt;br/&gt;
Buildfile: /home/antoine/Downloads/mongo-test/build.xml&lt;/p&gt;

&lt;p&gt;compile:&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;javac&amp;#93;&lt;/span&gt; Compiling 1 source file to /home/antoine/Downloads/mongo-test/build/java/classes&lt;/p&gt;

&lt;p&gt;run:&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;junit&amp;#93;&lt;/span&gt; Testsuite: com.deftlabs.tests.mongo.RandomTest&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;junit&amp;#93;&lt;/span&gt; Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0.481 sec&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;junit&amp;#93;&lt;/span&gt; &lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;junit&amp;#93;&lt;/span&gt; Testcase: testBsonUpsert(com.deftlabs.tests.mongo.RandomTest):	Caused an ERROR&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;junit&amp;#93;&lt;/span&gt; not okForStorage&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;junit&amp;#93;&lt;/span&gt; com.mongodb.MongoException: not okForStorage&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;junit&amp;#93;&lt;/span&gt; 	at com.mongodb.DBTCPConnector._checkWriteError(DBTCPConnector.java:141)&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;junit&amp;#93;&lt;/span&gt; 	at com.mongodb.DBTCPConnector.say(DBTCPConnector.java:162)&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;junit&amp;#93;&lt;/span&gt; 	at com.mongodb.DBTCPConnector.say(DBTCPConnector.java:146)&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;junit&amp;#93;&lt;/span&gt; 	at com.mongodb.DBApiLayer$MyCollection.update(DBApiLayer.java:335)&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;junit&amp;#93;&lt;/span&gt; 	at com.mongodb.DBCollection.update(DBCollection.java:145)&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;junit&amp;#93;&lt;/span&gt; 	at com.deftlabs.tests.mongo.RandomTest.testBsonUpsert(RandomTest.java:58)&lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;junit&amp;#93;&lt;/span&gt; &lt;br/&gt;
    &lt;span class=&quot;error&quot;&gt;&amp;#91;junit&amp;#93;&lt;/span&gt;&lt;/p&gt;</comment>
                            <comment id="26493" author="antoine" created="Tue, 22 Mar 2011 16:28:35 +0000"  >&lt;p&gt;k indeed didnt see any data but I assumes the collection got deleted during test cleanup.&lt;br/&gt;
looking into it now&lt;/p&gt;</comment>
                            <comment id="26481" author="rgnitz" created="Tue, 22 Mar 2011 13:45:47 +0000"  >&lt;p&gt;You see the data in the collection (test.bsonSave)? I ran it on 2.5/1.8 and it didn&apos;t insert the data. It didn&apos;t throw an exception, but there wasn&apos;t any data in the db.&lt;/p&gt;</comment>
                            <comment id="26471" author="antoine" created="Tue, 22 Mar 2011 08:12:01 +0000"  >&lt;p&gt;does it fail always?&lt;br/&gt;
so far I ran it 10 times with 2.5 driver and mongo 1.8 and no failure.&lt;br/&gt;
What kind of failure / exception are you seeing?&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="11798" name="mongo-java-double.tar.gz" size="447104" author="rn@deftlabs.com" created="Tue, 3 May 2011 02:42:32 +0000"/>
                            <attachment id="11130" name="mongo-test.tar.gz" size="532193" author="rn@deftlabs.com" created="Tue, 22 Mar 2011 00:19:15 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>13.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 22 Mar 2011 08:12:01 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            12 years, 42 weeks, 1 day 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>antoine</customfieldvalue>
            <customfieldvalue>dwight@mongodb.com</customfieldvalue>
            <customfieldvalue>eliot</customfieldvalue>
            <customfieldvalue>rn@deftlabs.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrp2yn:</customfieldvalue>

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

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

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