[SERVER-9986] Refactor $geoNear searches into new query framework Created: 21/Jun/13  Updated: 24/Oct/19  Resolved: 14/Jul/14

Status: Closed
Project: Core Server
Component/s: Geo
Affects Version/s: 2.4.4
Fix Version/s: 2.7.4

Type: Bug Priority: Major - P3
Reporter: Thomas Rueckstiess Assignee: Greg Studer
Resolution: Done Votes: 0
Labels: todo_in_code
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Duplicate
is duplicated by SERVER-9200 Cannot Connect During Long Query Closed
is duplicated by SERVER-5236 $near query should return results pro... Closed
is duplicated by SERVER-3933 Allowing a greater number of results ... Closed
Related
related to SERVER-10047 2dsphere $near does not yield Closed
related to DOCS-1673 Document impact of long-running geoNe... Closed
related to SERVER-44223 Complete TODO listed in SERVER-9986 Closed
related to SERVER-5800 Refactor 2D $geoWithin into new query... Closed
is related to SERVER-9983 Authenticating as internal user shoul... Closed
is related to SERVER-84819 geo performance issue in 2.7.7 Closed
Operating System: ALL
Steps To Reproduce:
  1. Insert 10 Million documents with location data (old-style coordinate pairs) into a collection
  2. build 2d index on the location field
  3. run long query with complex regexes and $near operator on the location field
  4. watch the secondaries throw socket exceptions after a short time, and finally cause an election and fail over the primary
Participants:

 Description   

Refactor geospatial $geoNear/$nearSphere/geoNear command code to use the standard query framework and geometry covering changes from SERVER-5800.

This refactor affects $geoNear in both 2D and 2DSphere indexes - no behavior change is intended.

A side effect of this change is that progressive $geoNear sort is supported, and the full search does not have to be performed at once.

Original Description:

It appears that a long-running 2d-indexed geo query on a replica set with authentication will only yield when it finds matching documents. If the gap during which it does not find documents is long enough, it will become unresponsive, miss its heartbeats, and the secondaries assume it is down. Eventually they will cause an election and fail over the primary.

During this time, the primary is fully aware of this and prints

Fri Jun 21 17:17:13.307 [rsHealthPoll] replset info capslock.local:27018 thinks that we are down



 Comments   
Comment by Githook User [ 09/Jul/14 ]

Author:

{u'username': u'gregstuder', u'name': u'Greg Studer', u'email': u'greg@10gen.com'}

Message: SERVER-9986 refactor near search for 2D and S2

Adds progressive search functionality for $geoNear operations,
allowing better integration with other cursors.
Branch: master
https://github.com/mongodb/mongo/commit/3c5246b1fb2ec2f9c34ba1cb5083b2745d7bdf89

Comment by Daniel Pasette (Inactive) [ 03/Jul/13 ]

To fix this in 2d indexes requires major surgery.

Comment by Daniel Pasette (Inactive) [ 21/Jun/13 ]

The replset auth failures will be fixed by SERVER-9983, but still need to fix the yielding.

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