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

Abierto
#4,650 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
25/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
rust

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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
Lenguaje dominante
Rust
Estrellas
5.2k
Forks
502
Merge medio
3 d 4 h
PR fusionados (30 d)
157

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de apache/iggy

Todos los issues de apache/iggy

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.