-
Type: Task
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Component/s: Performance
-
None
Downstream Change Summary
null
Description of Linked Ticket
Epic Summary
Problems
- Capped collections do not replicate properly. They do not replicate record deletes, which can result in data corruption between replica set nodes (documents present on some nodes and not others). Due to the design of mmapV1 capped collections, it is not possible to replicate capped collection deletes for mmapV1.
- Capped collection performance is not good, despite one of the purported use cases being "to get good performance from an append-only workload".
Goal
- Deprecate capped collections and replace them with something that doesn't corrupt replicated data
Nongoal
- The special Oplog capped collection does not suffer from the data corruption issue, and already has custom code to make it unlike all other capped collections. It does not need to be converted to a TTL collection.
Possible Implementation Details
- Allow TTL index by specifying number of documents or data size as expiration criteria
- Create logOp for TTL expiration specifying a field and expiration point combo
- Allow TTL index on _id
- Make TTL collections with TTL on _id use clustered index
- Efficiently truncate TTL collections with TTL on _id