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

createIndexes should validate the 'expireAfterSeconds' option value

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • 3.6.8, 4.0.4, 4.1.4
    • 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" }

    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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: