[SERVER-50074] geoNear returns different stats in sharded cluster vs other topologies Created: 03/Aug/20 Updated: 06/Dec/22 Resolved: 18/Aug/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Geo |
| Affects Version/s: | 4.0.19 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Oleg Pudeyev (Inactive) | Assignee: | Backlog - Query Team (Inactive) |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Assigned Teams: |
Query
|
||||||||
| Operating System: | ALL | ||||||||
| Participants: | |||||||||
| Description |
|
This seems to only affect 4.0. 3.6 does not appear to be affected, I did not test earlier versions, in 4.2 there is no geoNear command. I use the following code to send a geoNear query that returns no results:
On a 4.0 replica set I get:
Note avgDistance field is missing from stats. On a 4.0 sharded cluster I get:
Note avgDistance is present in stats, along with a few other fields not present in the RS response. In 3.6 sharded cluster these fields aren't present either:
Mongoid provides helpers that extract e.g. avgDistance from this response, and these helpers return different data based on the topology in 4.0. Other drivers may have similar helpers. Test code: https://github.com/p-mongo/tests/blob/master/server-geo-near/test.js The above tests were made on 4.0.16 but I tested 4.0.19 also:
|
| Comments |
| Comment by Craig Homa [ 18/Aug/20 ] |
|
Closing as wont fix because the geoNear command has been removed and is not in the last 2 stable release branches. |
| Comment by Githook User [ 03/Aug/20 ] |
|
Author: {'name': 'Oleg Pudeyev', 'email': '39304720+p-mongo@users.noreply.github.com', 'username': 'p-mongo'}Message:
Co-authored-by: Oleg Pudeyev <oleg@bsdpower.com> |
| Comment by Githook User [ 03/Aug/20 ] |
|
Author: {'name': 'Oleg Pudeyev', 'email': '39304720+p-mongo@users.noreply.github.com', 'username': 'p-mongo'}Message:
Co-authored-by: Oleg Pudeyev <oleg@bsdpower.com> |