Skip to content

enhance: introduce retention policy to support truncated segment TTL #59

@tinswzy

Description

@tinswzy

Background
Currently, truncated segments are immediately cleaned up once there are no active readers.
However, in some deployments, the writer and reader components are decoupled — the writer may truncate data promptly while the reader could lag slightly behind.
This can lead to scenarios where the reader fails to access recent data that has already been truncated.

Motivation
To improve data safety and avoid premature deletion, truncated segments should be retained for a configurable period before being permanently removed.
This retention mechanism ensures:

  • Safe coexistence of independent writer and reader components.
  • Prevention of data loss caused by aggressive truncation.
  • Better operational control during transient read delays or restarts.

Proposal
Introduce a retention policy with segment TTL support, allowing truncated segments to remain accessible for a defined duration before cleanup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions