-
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
- Create a normal index on the cluster without the TTL field
- Run mongodump and dump with oplog
- Immediately convert the index to TTL using collMod
- 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)