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

Misleading error message on time-series index creation

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.0.0-rc0
    • Component/s: Storage
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      Execution Team 2021-05-03

      Description

      When attempting to create an index on non-metadata field the server reports:

      > load ('jstests/core/timeseries/timeseries_simple.js')
      ...
       
      > db.timeseries_simple.createIndex({"time":1, "usage_system":1})
      {
      	"ok" : 0,
      	"errmsg" : "BadValue: Invalid index spec for time-series collection: { time: 1.0, usage_system: 1.0 }. Index must be on the 'time' field: usage_system: 1.0 Command request: { createIndexes: \"timeseries_simple\", v: 2, indexes: [ { key: { time: 1.0, usage_system: 1.0 }, name: \"time_1_usage_system_1\" } ], ignoreUnknownIndexOptions: false }",
      	"code" : 67,
      	"codeName" : "CannotCreateIndex"
      }
      

        Attachments

          Activity

            People

            Assignee:
            dianna.hohensee Dianna Hohensee
            Reporter:
            ruslan.abdulkhalikov Ruslan Abdulkhalikov
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: