Geo indexing fails when min/max margins around included locations < 1

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Minor - P4
    • 1.9.0
    • Affects Version/s: 1.7.4
    • Component/s: Geo, Index Maintenance
    • None
    • Environment:
      Linux 2.6.35-24-generic #42-Ubuntu SMP Thu Dec 2 02:41:37 UTC 2010 x86_64 GNU/Linux
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      When the min/max of an ensureIndex(

      { loc : "2d" }

      ,

      {min, max}

      ) call are anything less than a single unit greater than or less than any of the locations being indexed, we get the following exception (failed assertation):

      > t.ensureIndex(

      { loc : "2d" }

      ,

      { max : 1 + epsilon, min : -1 - epsilon }

      )
      Fri Jan 21 10:41:28 [conn3] building new index on

      { loc: "2d" }

      for test.borders
      Fri Jan 21 10:41:28 [conn3] test.system.indexes Assertion failure in > 0 db/geo/2d.cpp 199
      0x508113 0x513521 0x6e028a 0x6e2110 0x6e2fdb 0x584570 0x69ae80 0x69e0bc 0x69f99a 0x68019c 0x6857c2 0x7693ef 0x7f9572e03230 0x7f957351e971 0x7f9571b0092d
      /opt/mongo/bin/mongod(_ZN5mongo12sayDbContextEPKc+0xb3) [0x508113]
      /opt/mongo/bin/mongod(_ZN5mongo8assertedEPKcS1_j+0xc1) [0x513521]
      /opt/mongo/bin/mongod(_ZNK5mongo9Geo2dType4hashEdd+0x7a) [0x6e028a]
      /opt/mongo/bin/mongod(_ZNK5mongo9Geo2dType5_hashERKNS_7BSONObjE+0x1a0) [0x6e2110]
      /opt/mongo/bin/mongod(_ZNK5mongo9Geo2dType7getKeysERKNS_7BSONObjERSt3setIS1_NS_22BSONObjCmpDefaultOrderESaIS1_EE+0xeb) [0x6e2fdb]
      /opt/mongo/bin/mongod(_ZNK5mongo9IndexSpec7getKeysERKNS_7BSONObjERSt3setIS1_NS_22BSONObjCmpDefaultOrderESaIS1_EE+0x40) [0x584570]
      /opt/mongo/bin/mongod(_ZN5mongo14fastBuildIndexEPKcPNS_16NamespaceDetailsERNS_12IndexDetailsEi+0x540) [0x69ae80]
      /opt/mongo/bin/mongod(_ZN5mongo11DataFileMgr6insertEPKcPKvibRKNS_11BSONElementEb+0x122c) [0x69e0bc]
      /opt/mongo/bin/mongod(_ZN5mongo11DataFileMgr16insertWithObjModEPKcRNS_7BSONObjEb+0x4a) [0x69f99a]
      /opt/mongo/bin/mongod(_ZN5mongo14receivedInsertERNS_7MessageERNS_5CurOpE+0x27c) [0x68019c]
      /opt/mongo/bin/mongod(_ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_8SockAddrE+0x13f2) [0x6857c2]
      /opt/mongo/bin/mongod(_ZN5mongo10connThreadEPNS_13MessagingPortE+0x2cf) [0x7693ef]
      /usr/lib/libboost_thread.so.1.42.0(thread_proxy+0x60) [0x7f9572e03230]
      /lib/libpthread.so.0(+0x7971) [0x7f957351e971]
      /lib/libc.so.6(clone+0x6d) [0x7f9571b0092d]
      Fri Jan 21 10:41:28 [conn3] insert test.system.indexes exception 0 assertion db/geo/2d.cpp:199 6ms
      in > 0

      The attachment has a testcase which should reproduce the issue (creates a square with points from [-1, 1] on both axes, tries to index with a max of 1.99 and min of -0.99. Same issue tested on smaller squares of points too.)

        1. geo_borders_testcases.js
          0.5 kB
          Greg Studer

            Assignee:
            Greg Studer (Inactive)
            Reporter:
            Greg Studer (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: