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

Query using 2d index throws exception when using explain()

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.6.4
    • Affects Version/s: 2.6.0
    • Component/s: Geo
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Hide

      Pending

      Show
      Pending

      Issue Status as of Jul 18, 2014

      ISSUE SUMMARY
      Queries using a 2d index throw an exception and log a stack trace when they are explained via explain().

      USER IMPACT
      The query will fail with a user assertion and not output the expected explain information, but the server remains running and available.

      WORKAROUNDS
      Avoid using explain for 2d queries.

      AFFECTED VERSIONS
      Production release versions from 2.6.0 to 2.6.3 are affected by this issue.

      FIX VERSION
      The fix is included in the 2.6.4 production release.

      RESOLUTION DETAILS
      The data required for the explain() code path was not initialized for 2d index queries. This has been fixed.

      Original description

      The following assertion occurs regularly on an active 2.6.0 replica set. I will work on a reproduction case for this but am posting now in case the stack trace provides clues.

      2014-04-22T08:09:10.327-0500 [conn163792] BtSearchCache_56.Board_56 Assertion failure bits <= 32 src/mongo/db/geo/hash.cpp 151
      2014-04-22T08:09:10.329-0500 [conn163790] query BtSearchCache_56.Board_56 query: { CityID: "27099", Bedrooms: { $gte: 3 }, Bathrooms: { $gte: 3 }, ListPrice: { $gte: 50000, $lte: 100000 }, PriceChangeDate: { $gte: new Date(1396869021000) }, PropertyTypeID: "SF" } planSummary: IXSCAN { PriceChangeDate: -1, PropertyTypeID: -1 } ntoreturn:100 ntoskip:0 nscanned:528 nscannedObjects:444 keyUpdates:0 numYields:0 locks(micros) r:6077 nreturned:0 reslen:20 6ms
      2014-04-22T08:09:10.331-0500 [conn163770] query BtSearchCache_86.Board_86 query: { CityID: { $in: [ "38290", "38297", "38271", "38276", "38288" ] }, Bedrooms: { $gte: 4 }, Bathrooms: { $gte: 4 }, ListPrice: { $gte: 3500000 }, PriceChangeDate: { $gte: new Date(1397337328000) }, BooleanAttributes: { $all: [ "HasGarage" ] }, PropertyTypeID: "SF" } planSummary: IXSCAN { BooleanAttributes: 1, PropertyTypeID: 1 } ntoreturn:100 ntoskip:0 nscanned:2012 nscannedObjects:2012 keyUpdates:0 numYields:0 locks(micros) r:12184 nreturned:0 reslen:20 12ms
      2014-04-22T08:09:10.333-0500 [conn163790] query BtSearchCache_56.Board_56 query: { PriceChangeDate: { $gte: new Date(1313072368000) }, PropertyTypeID: "SF", FullTextIndex: { $all: [ "1217432" ] } } planSummary: IXSCAN { FullTextIndex: -1, PropertyTypeID: -1, ListPrice: -1 } ntoreturn:100 ntoskip:0 nscanned:0 nscannedObjects:0 keyUpdates:0 numYields:0 locks(micros) r:220 nreturned:0 reslen:20 0ms
      2014-04-22T08:09:10.337-0500 [conn163792] BtSearchCache_56.Board_56 0x11bd301 0x115f819 0x114395e 0xb482a4 0xb4846c 0xd15c22 0xd16c42 0xd16d8d 0xd15421 0xd16c42 0xd1794b 0xd45ede 0xd4b6dc 0xb96382 0xb98962 0x76b76f 0x117367b 0x3c76a07851 0x3c762e811d 
       mongod(_ZN5mongo15printStackTraceERSo+0x21) [0x11bd301]
       mongod(_ZN5mongo10logContextEPKc+0x159) [0x115f819]
       mongod(_ZN5mongo12verifyFailedEPKcS1_j+0x17e) [0x114395e]
       mongod() [0xb482a4]
       mongod(_ZN5mongo16GeoHashConverterC1ERKNS0_10ParametersE+0x4c) [0xb4846c]
       mongod() [0xd15c22]
       mongod(_ZN5mongo11explainPlanERKNS_14PlanStageStatsEPPNS_11TypeExplainEb+0x12) [0xd16c42]
       mongod(_ZN5mongo20explainIntersectPlanERKNS_14PlanStageStatsEPPNS_11TypeExplainEb+0x13d) [0xd16d8d]
       mongod() [0xd15421]
       mongod(_ZN5mongo11explainPlanERKNS_14PlanStageStatsEPPNS_11TypeExplainEb+0x12) [0xd16c42]
       mongod(_ZN5mongo16explainMultiPlanERKNS_14PlanStageStatsERKSt6vectorIPS0_SaIS4_EEPNS_13QuerySolutionEPPNS_11TypeExplainE+0x19b) [0xd1794b]
       mongod(_ZNK5mongo15MultiPlanRunner7getInfoEPPNS_11TypeExplainEPPNS_8PlanInfoE+0x4e) [0xd45ede]
       mongod(_ZN5mongo11newRunQueryERNS_7MessageERNS_12QueryMessageERNS_5CurOpES1_+0x133c) [0xd4b6dc]
       mongod() [0xb96382]
       mongod(_ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_11HostAndPortE+0x442) [0xb98962]
       mongod(_ZN5mongo16MyMessageHandler7processERNS_7MessageEPNS_21AbstractMessagingPortEPNS_9LastErrorE+0x9f) [0x76b76f]
       mongod(_ZN5mongo17PortMessageServer17handleIncomingMsgEPv+0x4fb) [0x117367b]
       /lib64/libpthread.so.0() [0x3c76a07851]
       /lib64/libc.so.6(clone+0x6d) [0x3c762e811d]
      2014-04-22T08:09:10.337-0500 [conn163792] assertion 0 assertion src/mongo/db/geo/hash.cpp:151 ns:BtSearchCache_56.Board_56 query:{ StatusID: "A", ImportDate: { $gte: new Date(1398168538000) }, Location: { $within: { $polygon: [ [ -82.40067958831787, 34.85519286378287 ], [ -82.40415573120117, 34.86258795252457 ], [ -82.40411281585693, 34.86765848625818 ], [ -82.39269733428955, 34.8650528343606 ], [ -82.38823413848877, 34.85959478240881 ], [ -82.39321231842041, 34.85593240257412 ], [ -82.39806175231934, 34.8574466755463 ] ] } }, PropertyTypeID: { $in: [ "B", "BU", "C", "CM", "CO", "FM", "HRC", "LL", "LRC", "M", "MF", "PH", "PS", "RA", "SD", "SF", "SI", "VC", "VT" ] }, HideAddress: { $ne: true } }
      

            Assignee:
            siyuan.zhou@mongodb.com Siyuan Zhou
            Reporter:
            james.wahlin@mongodb.com James Wahlin
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: