<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:19: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-9062] mongod crashes when creating a &quot;2dsphere&quot; index on a large (~10 million docs) collection.</title>
                <link>https://jira.mongodb.org/browse/SERVER-9062</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;mongod crashes when creating a &quot;2dsphere&quot; index on a large (~10 million docs) collection.  It also crashes during inserts if I create the index before beginning inserts (crashes somewhere north of 800,000 docs).&lt;/p&gt;

&lt;p&gt;ERROR output is below:&lt;/p&gt;

&lt;p&gt;Thu Mar 21 14:27:55.446 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn4&amp;#93;&lt;/span&gt; build index drn2.events &lt;/p&gt;
{ loc: &quot;2dsphere&quot; }
&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;14:28:00&amp;#93;&lt;/span&gt; src\third_party\s2\s2latlng.cc:15: Check failed: is_valid()&lt;/p&gt;</description>
                <environment>Windows 8 64bit.  Mongo 2.4 (2008+) 64bit.</environment>
        <key id="69313">SERVER-9062</key>
            <summary>mongod crashes when creating a &quot;2dsphere&quot; index on a large (~10 million docs) collection.</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="hari.khalsa@10gen.com">hari.khalsa@10gen.com</assignee>
                                    <reporter username="brondoman">Greg Brondo</reporter>
                        <labels>
                    </labels>
                <created>Thu, 21 Mar 2013 19:39:45 +0000</created>
                <updated>Mon, 11 Jul 2016 17:56:48 +0000</updated>
                            <resolved>Fri, 29 Mar 2013 15:46:46 +0000</resolved>
                                    <version>2.4.0</version>
                                    <fixVersion>2.4.2</fixVersion>
                    <fixVersion>2.5.0</fixVersion>
                                    <component>Index Maintenance</component>
                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="301201" author="auto" created="Thu, 28 Mar 2013 23:16:57 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2013-03-25T15:01:40Z&apos;, u&apos;name&apos;: u&apos;Hari Khalsa&apos;, u&apos;email&apos;: u&apos;hkhalsa@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-9062&quot; title=&quot;mongod crashes when creating a &amp;quot;2dsphere&amp;quot; index on a large (~10 million docs) collection.&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-9062&quot;&gt;&lt;del&gt;SERVER-9062&lt;/del&gt;&lt;/a&gt; don&apos;t rely on drem to normalize longitude &amp;#8211; explicitly reject OOB values&lt;br/&gt;
Branch: v2.4&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/033f58e7d51c6d3740a22e92c311420ff776e312&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/033f58e7d51c6d3740a22e92c311420ff776e312&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="299785" author="auto" created="Wed, 27 Mar 2013 13:42:57 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2013-03-25T15:01:40Z&apos;, u&apos;name&apos;: u&apos;Hari Khalsa&apos;, u&apos;email&apos;: u&apos;hkhalsa@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-9062&quot; title=&quot;mongod crashes when creating a &amp;quot;2dsphere&amp;quot; index on a large (~10 million docs) collection.&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-9062&quot;&gt;&lt;del&gt;SERVER-9062&lt;/del&gt;&lt;/a&gt; don&apos;t rely on drem to normalize longitude &amp;#8211; explicitly reject OOB values&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/2ef273f283c7d45b9dfa55f5adf14f2b63069dc7&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/2ef273f283c7d45b9dfa55f5adf14f2b63069dc7&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="296086" author="hari.khalsa@10gen.com" created="Fri, 22 Mar 2013 18:58:57 +0000"  >&lt;p&gt;We do bounds check/normalize the values...though clearly not perfectly &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/sad.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;I suspect the issue lies with how we normalize the longitude values.&lt;/p&gt;

&lt;p&gt;Latitude values are clamped to -90,90, and we error if we see a value that is out of range.&lt;/p&gt;

&lt;p&gt;Longitude values are converted to radians and then normalized (a floating point modulus, basically) to &lt;span class=&quot;error&quot;&gt;&amp;#91;-pi, pi&amp;#93;&lt;/span&gt;.  I think this last normalization step is flawed on Windows for very large longitude values, like the one you provided.  This can be avoided by just erroring out like is done with latitude.  I&apos;ll write a patch and update when it&apos;s in.  My apologies.&lt;/p&gt;</comment>
                            <comment id="296073" author="brondoman" created="Fri, 22 Mar 2013 18:45:26 +0000"  >&lt;p&gt;longitude = -1.95932812755e+23.&lt;/p&gt;

&lt;p&gt;Shouldn&apos;t correct behavior be to bounds check the lon, lat values? (-180..180, -90..90) ?&lt;/p&gt;</comment>
                            <comment id="296069" author="hari.khalsa@10gen.com" created="Fri, 22 Mar 2013 18:39:00 +0000"  >&lt;p&gt;I agree it is a bug.  What is the value that caused it to crash?  I will fix the behavior.&lt;/p&gt;</comment>
                            <comment id="296065" author="brondoman" created="Fri, 22 Mar 2013 18:34:25 +0000"  >&lt;p&gt;I figured it out.  One of my rows had an invalid value for latitude (it was in scientific notation).  The error message was the clue:&lt;/p&gt;

&lt;p&gt;src\third_party\s2\s2latlng.cc:15: Check failed: is_valid()&lt;/p&gt;

&lt;p&gt;I believe this to still be a bug as I would think s2latlng.cc would give a Warning ignoring the bad value instead of crashing the mongod process.&lt;/p&gt;</comment>
                            <comment id="295928" author="hari.khalsa@10gen.com" created="Fri, 22 Mar 2013 16:29:33 +0000"  >&lt;p&gt;Given the error, I suspect there could be a particular long/lat value that is causing a problem.  If there is any way you could find the specific insert from your database that crashes it, that would be very helpful.&lt;/p&gt;</comment>
                            <comment id="295925" author="brondoman" created="Fri, 22 Mar 2013 16:26:27 +0000"  >&lt;p&gt;Also, I&apos;m inserting the data with the PyMongo driver.  Here&apos;s the code:&lt;/p&gt;

&lt;p&gt;from pymongo import MongoClient&lt;/p&gt;

&lt;p&gt;mongoConn = MongoClient()&lt;br/&gt;
mongoDB = mongoConn.drn2&lt;br/&gt;
mongoColl = mongoDB.events&lt;/p&gt;

&lt;p&gt;c = 0&lt;br/&gt;
for line in open(&quot;Events_10000000.txt&quot;):&lt;br/&gt;
	f = line.split(&apos;,&apos;)&lt;br/&gt;
	c += 1&lt;br/&gt;
	if c % 20000 == 0: print c&lt;br/&gt;
	event = { &quot;loc&quot;: &lt;/p&gt;
{ &quot;type&quot;: &quot;Point&quot;, &quot;coordinates&quot;: [ float(f[6]), float(f[7]) ] }
&lt;p&gt; }&lt;br/&gt;
	mongoColl.insert(event)&lt;/p&gt;

&lt;p&gt;mongoConn.disconnect()&lt;/p&gt;</comment>
                            <comment id="295922" author="brondoman" created="Fri, 22 Mar 2013 16:23:58 +0000"  >&lt;p&gt;I&apos;ll try the test now.  I actually used real long/lat values obtained from our database so it wasn&apos;t just &lt;span class=&quot;error&quot;&gt;&amp;#91;1,1&amp;#93;&lt;/span&gt;.  I&apos;ll reply shortly.&lt;/p&gt;</comment>
                            <comment id="295256" author="hari.khalsa@10gen.com" created="Thu, 21 Mar 2013 20:47:00 +0000"  >&lt;p&gt;OK, so I ran the following tests on both Linux and Win2k8R2:&lt;/p&gt;

&lt;p&gt;1. Insert 10M docs of the provided format, build 2dsphere.&lt;br/&gt;
2. Ensure 2dsphere, insert 800k documents of the provided format.&lt;/p&gt;

&lt;p&gt;...and I didn&apos;t have any problems.  I haven&apos;t run it on a copy of Windows 8 yet, but will do so ASAP.&lt;/p&gt;

&lt;p&gt;If you try to reproduce yourself, do you reliably get the error, or did you have it just once?&lt;/p&gt;</comment>
                            <comment id="295214" author="hari.khalsa@10gen.com" created="Thu, 21 Mar 2013 19:55:00 +0000"  >&lt;p&gt;Hi!  I&apos;m going to try to reproduce this locally.  Just to verify, if I do something like this, I should expect to reproduce the crash?:&lt;/p&gt;

&lt;p&gt;t = db.crash&lt;br/&gt;
t.drop()&lt;br/&gt;
t.ensureIndex(&lt;/p&gt;
{loc: &quot;2dsphere&quot;}
&lt;p&gt;)&lt;br/&gt;
for (var i = 0; i &amp;lt; 800000; ++i) { t.insert({loc: {type: &quot;Point&quot;, coordinates: &lt;span class=&quot;error&quot;&gt;&amp;#91;1,1&amp;#93;&lt;/span&gt;}}); }&lt;/p&gt;

&lt;p&gt;Are there any points in the collection besides &lt;span class=&quot;error&quot;&gt;&amp;#91;1,1&amp;#93;&lt;/span&gt;?&lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;</comment>
                    </comments>
                    <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>Thu, 21 Mar 2013 19:55:00 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        10 years, 46 weeks, 6 days 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>
                            10 years, 46 weeks, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10022"><![CDATA[Windows]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>auto</customfieldvalue>
            <customfieldvalue>brondoman</customfieldvalue>
            <customfieldvalue>hari.khalsa@10gen.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrn0k7:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>47101</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_10750" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Steps To Reproduce</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;1) Create new collection&lt;br/&gt;
2) insert 10 million docs with {loc:{type: &quot;Point&quot;, coordinates: &lt;span class=&quot;error&quot;&gt;&amp;#91;1,1&amp;#93;&lt;/span&gt;}}&lt;br/&gt;
3) db.collection.ensureIndex(loc, &quot;2dsphere&quot;)&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_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hsgdd3:</customfieldvalue>

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