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

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Critical - P2 Critical - P2
    • 3.4.10, 3.6.0-rc0
    • Affects Version/s: 2.6.12, 3.0.15, 3.2.16, 3.4.9, 3.5.13
    • Component/s: Text Search
    • None
    • Environment:
      Linux CentOS 6.x
    • Fully Compatible
    • ALL
    • v3.4, v3.2, v3.0
    • Query 2017-10-02

      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)

            Assignee:
            david.storch@mongodb.com David Storch
            Reporter:
            mcoleman@oildex.com Michael Coleman
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: