An idle partition's active segment never seals, so its data never expires

Aperta
#4,650 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust

Direzione di ricerca

Read Segment::is_expired in core/partitions/src/segment.rs, remove_sealed_segments_up_to in core/partitions/src/iggy_partition.rs, and the tiered storage RFC section linked in the issue. The issue leaves the solution open and describes why independent replica timers break segment placement, so first work out how a replicated RollSegment operation fits the existing control path. Done means idle active segments can seal without new batches and then participate in retention, compression, and offloading.

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

Descrizione

bug server
Description

A partition that stops receiving messages keeps its active segment open forever, and retention only ever acts on sealed segments. Segment::is_expired returns false for anything unsealed (there is a test for it unsealed_segment_is_never_expired), and remove_sealed_segments_up_to skips the active segment. So an idle partition holds that segment's data indefinitely, no matter what message_expiry or max_topic_size say. Segments it sealed before going idle still expire normally; it is the final partly filled one that never becomes eligible.

This came out of the discussion in #4402, which proposes a time ceiling on a segment's span but evaluates it on append and scopes idle partitions out. That split is the reason for a separate issue: a partition that still receives messages will eventually evaluate a trigger, whether that trigger is the current size check or a time check. A partition receiving nothing never evaluates one at all.

Where it shows up:

  • a decommissioned topic leaves every partition sitting on a partly filled segment that never seals and never expires
  • the same happens inside a live topic when traffic skews, since a partition that stops receiving keys is idle whether or not the topic is
  • an unsealed segment also cannot be compressed or offloaded, so this blocks tiering for those partitions
Affected area / component

Iggy server

Proposed solution

Left open.

Whatever closes this has to fire without an arriving batch, so it cannot be evaluated in the append path. The candidate raised in the tiered storage RFC is a replicated time roll: the primary appends a RollSegment control operation and every replica seals at that operation.

Alternatives considered
  1. Each replica rolling on its own timer. This does not work: segment boundaries have to be a function of the batches, and SegmentState::reserve runs on every replica, so a local now() would place the same batch differently on different replicas and fail the placement check in validate_segment_prefix.
Contribution
  • I'm willing to submit a pull request to implement this feature
Good first issue
  • I think this could be a good first issue for a new contributor
Lingua principale
Rust
Stelle
5.2k
Fork
502
Merge medio
3g 8h
PR unite (30g)
146

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

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 apache/iggy

Tutte le issue di apache/iggy

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.