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

createIndexes should validate the 'expireAfterSeconds' option value

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.6.8, 4.0.4, 4.1.4
    • Component/s: Index Maintenance
    • None
    • Query
    • ALL
    • Hide

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

      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.

            Assignee:
            backlog-server-query Backlog - Query Team (Inactive)
            Reporter:
            james.wahlin@mongodb.com James Wahlin
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: