[SERVER-60643] shard time series collection using hash of timefield should return better error message Created: 13/Oct/21  Updated: 06/Dec/22  Resolved: 22/Oct/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Rushan Chen Assignee: Backlog - Query Execution
Resolution: Duplicate Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-60641 Return better error message when tryi... Closed
Assigned Teams:
Query Execution
Participants:

 Description   

currently (5.1)

db.runCommand({ create: "tscoll", timeseries:{timeField: 'time', metaField: 'id' }})

db.adminCommand({ shardCollection: "test.tscoll", key:

{ time: "hashed" }

, numInitialChunks: 6 } 

returns

"errmsg" : "Invalid index spec for time-series collection: { time: \"hashed\" }. Indexes on the time field must be ascending or descending (numbers only): time: \"hashed\""

 

it shoudl instead alert the user the sharding on timeField should only be using range ("1") partitioning.


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