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

Manual configuration of geo 2dsphere index levels may crash on query

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.1.6
    • Affects Version/s: None
    • Component/s: Geo
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Hide
      db.coll.insert({loc: {type: "Point", coordinates: [106.6331,10.7395]}})
      db.coll.createIndex({loc: "2dsphere"}, {coarsestIndexedLevel: 30, finestIndexedLevel: 30})
      db.coll.find({loc: {$near: {$geometry: {type:"Point", coordinates:[106.6331,10.7395]}}}})
      
      Show
      db.coll.insert({loc: {type: "Point" , coordinates: [106.6331,10.7395]}}) db.coll.createIndex({loc: "2dsphere" }, {coarsestIndexedLevel: 30, finestIndexedLevel: 30}) db.coll.find({loc: {$near: {$geometry: {type: "Point" , coordinates:[106.6331,10.7395]}}}})

      If the coarsest level of the geo 2dsphere index is set >= 27, it will result in an assertion error in S2 on certain points. This is caused by https://github.com/mongodb/mongo/blob/master/src/mongo/db/query/expression_index.cpp#L113 which does not enforce that 4 + coarsestLevel <= 30.

            Assignee:
            kevin.albertson@mongodb.com Kevin Albertson
            Reporter:
            kevin.albertson@mongodb.com Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: