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

Invariant failure after issuing $text index find containing nested non-text fields as the index prefix

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical - P2
    • Resolution: Fixed
    • Affects Version/s: 2.6.12, 3.0.15, 3.2.16, 3.4.9, 3.5.13
    • Fix Version/s: 3.4.10, 3.6.0-rc0
    • Component/s: Text Search
    • Labels:
      None
    • Environment:
      Linux CentOS 6.x
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v3.4, v3.2, v3.0
    • Sprint:
      Query 2017-10-02

      Description

      When creating a compound text index with a non-text prefix (containing nested keys), the index creates successfully. However, when issuing a find against the index using all fields, the mongod process terminates with the error message:

      [conn5704] Invariant failure amExpr->numChildren() >= prefixEnd src/mongo/db/query/planner_access.cpp 466
      

      Example Document:

      {
      	"_id" : ObjectId("59bc4bdd77c83ac81ca5b784"),
      	"senderOildexId" : {
      		"companyId" : 22375,
      		"businessUnit" : 0
      	},
      	"receiverOildexId" : {
      		"companyId" : 0025,
      		"businessUnit" : 0
      	},
      	"propertyNumber" : "123456789",
      	"propertyName" : "J L BOND 12345",
      	"checksum" : "74c65685e49ffd7ef479961b237f73e1"
      }
      

      Index Created:

      db.SenderProperties.createIndex( {
      	"senderOildexId.companyId": 1,
      	"senderOildexId.businessUnit": 1,
      	"receiverOildexId.companyId": 1,
      	"receiverOildexId.businessUnit" : 1,
      	propertyNumber: "text",
      	properyName: "text"
      }, {
      	default_language: "none",
        	name: "test"
      } )
      

      Find query attempted:

      db.SenderProperties.find({"senderOildexId.companyId": 22375, "senderOildexId.businessUnit" : 0, "receiverOildexId.companyId": 0025, "receiverOildexId.businessUnit" : 0, "$text" : {"$search": "J L BOND"}})
      

      Full index build and error log: (see attachment)

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: