Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-19634

Floating point error of distance computation in geoNear

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor - P4
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Backlog
    • Component/s: Geo
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      Run mongo/jstests/noPassthroughWithMongod/geo_axis_aligned.js and log the distances of the documents returned. Some of these calculated distances will be greater than their actual distance due to floating point error.

      Show
      Run mongo/jstests/noPassthroughWithMongod/geo_axis_aligned.js and log the distances of the documents returned. Some of these calculated distances will be greater than their actual distance due to floating point error.

      Description

      Documents near or on the boundaries of a geoNear search are susceptible to being excluded because the distance calculations in geoNear can produce inaccurate results due to floating point error (i.e. 54.001 - 54 > 0.001). Currently, this is accounted for in flat queries for by slightly expanding the last search interval and filtering with the TwoDPtInAnnulusExpression, but it is unclear if this handles all cases. Also, it may not be correct to return the documents if the distance calculation returns a value over the maxDistance.

        Attachments

          Activity

            People

            Assignee:
            backlog-query-execution Backlog - Query Execution
            Reporter:
            brandon.zhang Brandon Zhang
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated: