[SERVER-56015] Misleading error message on time-series index creation Created: 10/Apr/21  Updated: 29/Oct/23  Resolved: 23/Apr/21

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 5.0.0-rc0

Type: Bug Priority: Minor - P4
Reporter: Ruslan Abdulkhalikov (Inactive) Assignee: Dianna Hohensee (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Execution Team 2021-05-03
Participants:

 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"
}



 Comments   
Comment by Githook User [ 23/Apr/21 ]

Author:

{'name': 'Dianna Hohensee', 'email': 'dianna.hohensee@mongodb.com', 'username': 'DiannaHohensee'}

Message: SERVER-56015 Misleading error message on time-series index creation
Branch: master
https://github.com/mongodb/mongo/commit/1852f29b020ac45ca6a43f6d7c9ecd2d3333be54

Generated at Thu Feb 08 05:38:05 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.