litestream-ruby icon indicating copy to clipboard operation
litestream-ruby copied to clipboard

Feature request: Make retention configurable

Open erdostom opened this issue 1 year ago • 5 comments

Some users may want longer retention than 24h.

Suggesting two new config items:

  • retention
  • snapshot_interval

erdostom avatar Nov 07 '24 17:11 erdostom

How do those map to configuration on the underlying Litestream utility?

fractaledmind avatar Nov 07 '24 18:11 fractaledmind

I have set this config in my config/litestream.yml file for 3 days retention with full snapshot every 12 hours.

dbs:
  - path: storage/${RAILS_ENV}.sqlite3
    replicas:
      - type: s3
        region: $LITESTREAM_REPLICA_REGION
        endpoint: $LITESTREAM_REPLICA_ENDPOINT
        bucket: $LITESTREAM_REPLICA_BUCKET
        path: app/storage/${RAILS_ENV}.sqlite3
        access-key-id: $LITESTREAM_ACCESS_KEY_ID
        secret-access-key: $LITESTREAM_SECRET_ACCESS_KEY
        retention: 72h
        snapshot-interval: 12h

alxvernier avatar Nov 07 '24 20:11 alxvernier

hey @alxvernier it's possible to just set those values & they get passed to Litestream without extra work?

UPDATE: I tried adding the lines to my config/litestream.yml and it didn't work (Litestream stopped working altogether)

erdostom avatar Nov 07 '24 21:11 erdostom

How do those map to configuration on the underlying Litestream utility?

I think they're discussed here https://litestream.io/reference/config/#:~:text=The%20default%20retention%20period%20is,and%20defaults%20to%20every%201h%20.

erdostom avatar Nov 08 '24 05:11 erdostom

@erdostom I didn't do more than inserting these options to make it work.

alxvernier avatar Nov 08 '24 11:11 alxvernier