Retention policy only prunes the current `serverName`; archives of earlier lineages are never cleaned up

Aperta
#1,253 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go, postgresql
Ambito
databases

Direzione di ricerca

Start by reading retention.md and tracing how ObjectStore.status reports lineages and how retention runs select a serverName. The issue’s documentation requirement is directly actionable; the proposed opt-in also needs rules for identifying referenced lineages and deciding when their newest WAL or backup is outside the window. Done when the per-lineage behavior and safety condition are documented, or the opt-in is implemented with tests confirming active lineages are retained and inactive expired ones are pruned.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Problem
The recommended recovery pattern restores from the old serverName and archives to a new one, because the plugin refuses to archive into a non-empty folder. After each recovery, the ObjectStore therefore holds several lineages:

s3://bucket/cluster-a/      (original)
s3://bucket/cluster-a-dr1/  (after recovery 1)
s3://bucket/cluster-a-dr2/  (after recovery 2, current)

The retention run (barman-cloud-backup-delete --retention-policy "RECOVERY WINDOW OF 7 DAYS" s3://bucket/ <serverName>) only covers the cluster's current serverName. The earlier lineages are never pruned and grow without bound unless someone deletes them by hand. ObjectStore.status lists all lineages with their recovery windows, so the plugin already knows about them.

Versions: plugin-barman-cloud v0.16.0, CloudNativePG 1.30.2.

Expected
At least, retention.md should state that the policy is applied per serverName and covers only the lineage a cluster currently archives to, so that operators plan cleanup of old lineages.

Better, an opt-in on the ObjectStore, for example:

spec:
  retentionPolicy: "7d"
  pruneInactiveServerNames: true   # apply the window to lineages no cluster archives to anymore

A lineage would be deleted once its newest WAL/backup is older than the window, and never while a cluster still references it.

Related: #827 (docs on serverName separation), #1163, #405.

Lingua principale
Go
Stelle
214
Fork
91
Merge medio
2g 11h
PR unite (30g)
38

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cloudnative-pg/plugin-barman-cloud

Tutte le issue di cloudnative-pg/plugin-barman-cloud

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.