Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial support for per-message TTLs (#6272)
This is an incomplete but somewhat-working implementations of per-message TTLs. Notes: - Adds `AllowMsgTTL` to stream config; - Parses the `Nats-TTL` message header as a parsable duration, or if not, second precision; - Bumps the `index.db` magic version so that we can add a new field for tracking how many TTL'd messages are in each message block (means that `index.db` needs to be rebuilt if downgrading); - Adds a new `thw.db` to store the timed hash wheel state, and tries to rebuild it from a linear scan if it is missing or out-of-date. Future work: - Memory store support; - Expires "never" including not aging out with MaxAge; - Ability to update a TTL for a message; - Decide what we want to do for enabling/disabling TTL support; - Decide how mirroring/sourcing streams will handle TTL headers. Signed-off-by: Neil Twigg <neil@nats.io>
- Loading branch information