Skip to content

Configure TTL on trogon-claims object store bucket #101

@yordis

Description

@yordis
  • Store-then-publish in ClaimCheckPublisher can leave orphaned objects if publish fails after a successful put
  • The trogon-claims bucket currently uses ..Default::default() with no max_age, so orphans accumulate forever

Design considerations

Two cleanup paths are needed:

Happy path: consumer deletes after resolve

resolve_claim reads the object from the store. After successful resolution, the consumer should delete the object — that's the normal claim check lifecycle (put → publish claim → resolve → delete). This requires adding an ObjectStoreDelete trait and wiring it into resolve_claim or letting the caller handle deletion after consuming the payload.

Failure path: orphaned objects

When publish fails after a successful put, no claim message exists to reference the object. Options:

  1. TTL (recommended first step): Set max_age on the bucket (e.g. match stream's 7-day retention). Simple, predictable. Orphans expire automatically. Trade-off: storage cost for the TTL window.
  2. Reaper process (if storage pressure warrants): Background job lists objects in the bucket, cross-references against JetStream messages by checking Trogon-Claim-Key headers, deletes objects with no matching claim. More complex but reclaims storage faster.

Recommended approach

  1. Set max_age on the trogon-claims bucket config — this is the immediate fix
  2. Add ObjectStoreDelete trait and have consumers delete after resolve — this handles the happy path
  3. Defer the reaper unless storage pressure becomes a real concern

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions