[SERVER-2386] Geo indexing fails when min/max margins around included locations < 1 Created: 21/Jan/11  Updated: 12/Jul/16  Resolved: 17/Mar/11

Status: Closed
Project: Core Server
Component/s: Geo, Index Maintenance
Affects Version/s: 1.7.4
Fix Version/s: 1.9.0

Type: Bug Priority: Minor - P4
Reporter: Greg Studer Assignee: Greg Studer
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux 2.6.35-24-generic #42-Ubuntu SMP Thu Dec 2 02:41:37 UTC 2010 x86_64 GNU/Linux


Attachments: File geo_borders_testcases.js    
Operating System: ALL
Participants:

 Description   

When the min/max of an ensureIndex(

{ loc : "2d" }

,

{min, max}

) call are anything less than a single unit greater than or less than any of the locations being indexed, we get the following exception (failed assertation):

> t.ensureIndex(

{ loc : "2d" }

,

{ max : 1 + epsilon, min : -1 - epsilon }

)
Fri Jan 21 10:41:28 [conn3] building new index on

{ loc: "2d" }

for test.borders
Fri Jan 21 10:41:28 [conn3] test.system.indexes Assertion failure in > 0 db/geo/2d.cpp 199
0x508113 0x513521 0x6e028a 0x6e2110 0x6e2fdb 0x584570 0x69ae80 0x69e0bc 0x69f99a 0x68019c 0x6857c2 0x7693ef 0x7f9572e03230 0x7f957351e971 0x7f9571b0092d
/opt/mongo/bin/mongod(_ZN5mongo12sayDbContextEPKc+0xb3) [0x508113]
/opt/mongo/bin/mongod(_ZN5mongo8assertedEPKcS1_j+0xc1) [0x513521]
/opt/mongo/bin/mongod(_ZNK5mongo9Geo2dType4hashEdd+0x7a) [0x6e028a]
/opt/mongo/bin/mongod(_ZNK5mongo9Geo2dType5_hashERKNS_7BSONObjE+0x1a0) [0x6e2110]
/opt/mongo/bin/mongod(_ZNK5mongo9Geo2dType7getKeysERKNS_7BSONObjERSt3setIS1_NS_22BSONObjCmpDefaultOrderESaIS1_EE+0xeb) [0x6e2fdb]
/opt/mongo/bin/mongod(_ZNK5mongo9IndexSpec7getKeysERKNS_7BSONObjERSt3setIS1_NS_22BSONObjCmpDefaultOrderESaIS1_EE+0x40) [0x584570]
/opt/mongo/bin/mongod(_ZN5mongo14fastBuildIndexEPKcPNS_16NamespaceDetailsERNS_12IndexDetailsEi+0x540) [0x69ae80]
/opt/mongo/bin/mongod(_ZN5mongo11DataFileMgr6insertEPKcPKvibRKNS_11BSONElementEb+0x122c) [0x69e0bc]
/opt/mongo/bin/mongod(_ZN5mongo11DataFileMgr16insertWithObjModEPKcRNS_7BSONObjEb+0x4a) [0x69f99a]
/opt/mongo/bin/mongod(_ZN5mongo14receivedInsertERNS_7MessageERNS_5CurOpE+0x27c) [0x68019c]
/opt/mongo/bin/mongod(_ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_8SockAddrE+0x13f2) [0x6857c2]
/opt/mongo/bin/mongod(_ZN5mongo10connThreadEPNS_13MessagingPortE+0x2cf) [0x7693ef]
/usr/lib/libboost_thread.so.1.42.0(thread_proxy+0x60) [0x7f9572e03230]
/lib/libpthread.so.0(+0x7971) [0x7f957351e971]
/lib/libc.so.6(clone+0x6d) [0x7f9571b0092d]
Fri Jan 21 10:41:28 [conn3] insert test.system.indexes exception 0 assertion db/geo/2d.cpp:199 6ms
in > 0

The attachment has a testcase which should reproduce the issue (creates a square with points from [-1, 1] on both axes, tries to index with a max of 1.99 and min of -0.99. Same issue tested on smaller squares of points too.)



 Comments   
Comment by auto [ 15/Mar/11 ]

Author:

{u'login': u'gregstuder', u'name': u'gregs', u'email': u'greg@10gen.com'}

Message: double bounds for geo query scaling and addn'l error msgs SERVER-2386 SERVER-2388
https://github.com/mongodb/mongo/commit/729f9caf51e2c82aa9a1b2493829b827610748ab

Comment by Greg Studer [ 21/Jan/11 ]

Forgot to add, could be an issue if indexing sets of locations with very small magnitudes, the margin required around locations is much larger than the location range and may eat up accuracy.

Generated at Thu Feb 08 02:59:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.