[SERVER-37983] createIndexes should validate the 'expireAfterSeconds' option value Created: 07/Nov/18  Updated: 06/Dec/22  Resolved: 08/Nov/18

Status: Closed
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: 3.6.8, 4.0.4, 4.1.4
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: James Wahlin Assignee: Backlog - Query Team (Inactive)
Resolution: Duplicate Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-10075 Should forbid illegal form of TTL ind... Closed
Related
Assigned Teams:
Query
Operating System: ALL
Steps To Reproduce:

The following index creation succeeds:

db.test.createIndex({x: 1}, {expireAfterSeconds: "invalid_type"}); 

Leading to the following logged error message when TTL expiration runs:

2018-11-07T10:45:59.573-0500 E INDEX    [TTLMonitor] ttl indexes require the expireAfterSeconds field to be numeric but received a type of string, skipping ttl job for: { v: 2, key: { x: 1.0 }, name: "x_1", ns: "test.test", expireAfterSeconds: "invalid_type" } 

Participants:
Case:

 Description   

The createIndexes command does not validate the type for a 'expireAfterSeconds' option when specified. Instead validation is performed at TTL job run time, resulting in the given index being skipped for consideration.

Instead we should fail the createIndexes command when the value provided for 'expireAfterSeconds' is not valid.



 Comments   
Comment by James Wahlin [ 08/Nov/18 ]

Closing as a duplicate of SERVER-10075.

Comment by Asya Kamsky [ 08/Nov/18 ]

Dup of SERVER-10075

Generated at Thu Feb 08 04:47:37 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.