Delete task (DeleteAndMerge) on a large split causes unbounded memory (RSS) growth → OOM crashloop

Abierto
#6,534 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
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
google-cloud, postgresql, rust

Línea de trabajo

Reproduce un delete-by-query en un split grande con el janitor delete-task service y sigue DeleteAndMerge después del registro merge-operation-success a través del empaquetado post-merge y finalize. Comprueba por qué nunca se alcanza publish-new-splits y por qué se acumulan los splits Staged; se considera terminado cuando la memoria permanece acotada y los splits afectados se publican sin splits Staged huérfanos.

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

Descripción

area:indexing area:metastore area:performance

Version: 0.8.0 (x86_64-unknown-linux-gnu)
Backend: GCS object storage, PostgreSQL metastore, janitor running only the delete-task service.

Summary

A single delete-by-query that matches only a handful of documents triggers a DeleteAndMerge on every split containing a match. For large splits (~11M docs / ~17 GB on disk, ~29 fast fields), the merge completes successfully, but memory then grows unbounded after merge-operation-success until the process is OOM-killed. It reproduces at every memory limit we tried (1 GiB, 14 GiB, and 40 GiB), so it is not a sizing problem — the working set grows past whatever ceiling is set.

Smaller splits in the same delete task (≤~4.6M docs) finalize fine; only the large ones (≥~6.7M docs) blow up.

Repro

  1. Index with many fast fields (~29) and large merged splits (split_num_docs_target = 10_000_000; observed splits up to ~11.3M docs / ~17 GB).
  2. Submit a delete-by-query matching a few docs spread across several splits.
  3. Janitor delete-task service plans one DeleteAndMerge per affected split.
  4. On the large splits: merge logs merge-operation-success, then RSS climbs steadily to the cgroup limit and the pod is OOM-killed. On restart it re-plans the same splits → crashloop. Each cycle also leaves orphaned Staged splits behind (uploaded/staged but never published).

Observed (instrumented)

  • RSS (anonymous heap), not page cache, is what grows — confirmed via cgroup/cAdvisor (container_memory_rss climbs from ~4 GB to ~38 GB under a 40 GB limit, then OOM). ~2 CPU cores pegged throughout (compute-bound, not I/O).
  • The growth happens after merge-operation-success is logged, i.e. in the post-merge packaging/finalize phase, and no publish-new-splits is ever logged for the large splits.
  • We ruled out the obvious bounded allocations by reading the 0.8.0 source: split upload streams from disk in bounded chunks; hotcache is sparse; tag extraction bails above MAX_VALUES_PER_TAG_FIELD. None scales with split size unboundedly — so the RSS growth appears to be an accumulation/leak in the delete-merge finalize path.

Impact

  • A trivial delete (a few docs) can wedge the janitor indefinitely on any index that has large splits, and orphans Staged splits in object storage on every crash cycle.
  • Workaround: disable the delete-task service and keep split_num_docs_target small so delete-merges only ever operate on small splits — but this does not resolve already-large splits, which only clear via retention/reindex.

Questions for maintainers

  • Is this a known issue / is there a fix in a later release?
  • Is the post-merge memory for a delete-merge expected to scale with split size (and if so, roughly how)? A bound proportional to split size would at least make sizing predictable; the unbounded growth we see suggests a leak.
Lenguaje dominante
Rust
Estrellas
11.8k
Forks
628
Merge medio
2 d 22 h
PR fusionados (30 d)
50

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 quickwit-oss/quickwit

Todos los issues de quickwit-oss/quickwit

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.