Mongorestore collMod convert an index to TTL index fails

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Tools and Replicator
    • 0

      Problem Statement/Rationale

      When restoring a collMod oplog that converts a normal index to TTL index, mongorestore first looks up the index from the cluster and then attempts to find the expireAfterSeconds field from it. This results in a failure because the field doesn't exist in the index spec.

      Steps to Reproduce

      1. Create a normal index on the cluster without the TTL field
      2. Run mongodump and dump with oplog
      3. Immediately convert the index to TTL using collMod
      4. Use mongorestore to restore the oplogs containing the collMod oplog

      Expected Results

      Mongorestore should succeed with the normal index being converted to TTL

      Actual Results

      Mongorestore fails with error:

      Failed: restore error: error applying oplog: could not handle collMod on test.collmod_convert_to_ttl: missing "expireAfterSeconds" in matching index: &{map[name:a_1 v:2] [{a 1}] []}
      

      Additional Notes

      The bug was found in a passthrough test (link)

            Assignee:
            Jian Guan
            Reporter:
            Jian Guan
            Nick Weinberger
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: