[SERVER-2234] Sometimes geospatial requests do not return expected results Created: 16/Dec/10  Updated: 23/Aug/19  Resolved: 28/Feb/11

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 1.6.4
Fix Version/s: None

Type: Bug Priority: Critical - P2
Reporter: Sylvain Rousseau Assignee: Mathias Stearn
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Debian/Mac OS


Attachments: File join_charonne.bson    
Issue Links:
Duplicate
duplicates SERVER-2342 $within: {$center} vs. $near and $max... Closed
Operating System: Linux
Participants:

 Description   

From a collection with geospatial index, some requests are not bijective.

Search from A = [48.8547930548148, 2.37725013667164]
db.my_collection.find({loc:{$near:A,$maxDistance:0.000449660802959365}}) returns some results, including this one : B :[48.8547531964291, 2.37711571072754]

Nevertheless, the reciprocity does not return A, worse, it returns nothing :
db.my_collection.find({loc:{$near:B,$maxDistance:0.000449660802959365}})

This last request starts to return some result when increasing the maxDistance, which is not acceptable as a workaround for us.

This issue is relatively frequent : 1 document for 20 does not work correctly.

Reproduced with always some erroneous documents on Debian, Mac OS, and even after re-indexing, dropping database, removing db files.



 Comments   
Comment by Sylvain Rousseau [ 17/Dec/10 ]

Dataset reproducing the issue

Comment by Sylvain Rousseau [ 17/Dec/10 ]

Issue reproduced in 1.7.3.
Dataset attached to this issue.

Can be reproduced with A = [48.8547930548148, 2.37725013667164] , which see B :[48.8547531964291, 2.37711571072754]
But querying near B, returns 0 result
On collection : mydb.join_charonne, indexes with :
[
{
"name" : "id",
"ns" : "mydb.join_charonne",
"key" :

{ "_id" : 1 }

},
{
"key" :

{ "loc" : "2d" }

,
"name" : "loc_2d",
"ns" : "mydb.join_charonne"
},
{
"key" :

{ "path_id" : 1, "order" : 1 }

,
"name" : "path_id_1_order_1",
"ns" : "mydb.join_charonne"
}
]

There at least 27 others documents in this dataset which has the same issue. If needed, I can give you this exhaustive list

Comment by Mathias Stearn [ 16/Dec/10 ]

Could you provide a sample dataset?

Comment by Eliot Horowitz (Inactive) [ 16/Dec/10 ]

Can you try 1.7.3?
There were a number of cases fixed in 1.7.x

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