RocksDB: dead-workflow backfill materializes unbounded range before batch cutoff
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
Línea de trabajo
Comienza con gasoline/src/db/kv/debug.rs, especialmente con backfill_dead_workflows y su límite MAX_BACKFILLS, y luego sigue el manejo de rangos a través de universaldb/src/range_option.rs y los archivos de transacciones de RocksDB y transaction_task.rs. Usa el escenario de prueba propuesto para filesystem/RocksDB para comprobar el tamaño de la obtención materializada, la agregación parcial de workflows, la indexación de workflows muertos y la continuación entre páginas o después de un reinicio. Hecho significa obtener datos con memoria acotada, sin clasificaciones erróneas ni progreso detenido.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
In Rivet engine 2.3.17, gasoline_dead_wf_backfill requests the entire remaining workflow-data range without a row limit. The RocksDB adapter materializes that range before yielding the first entry. Consequently, the backfill's MAX_BACKFILLS = 1000 cutoff does not bound the underlying read allocation.
This report is based on public source inspection. It does not include a completed minimal runtime reproduction or claim a measured OOM threshold.
Affected code path
- Backfill workflow declares
MAX_BACKFILLS = 1000, runs a chunk, and persists its continuation after the activity returns. backfill_dead_workflowsscans the entire remaining workflow-data subspace usingStreamingMode::WantAll, with no explicit range limit.- The default range limit is
None. - The RocksDB stream adapter awaits the complete
get_rangeresult and collects a vector before yielding entries. - The RocksDB transaction task uses
limit.unwrap_or(usize::MAX)and copies matching keys and values into a vector. - The backfill's workflow-count cutoff executes only after the underlying range has been materialized.
Lowering MAX_BACKFILLS alone therefore does not bound the initial allocation. Subsequent chunks can also re-materialize the remaining range. A sufficiently large workflow-data subspace could cause high memory consumption or OOM during this migration.
Introduction
The backfill and its startup dispatch were introduced by #5656, commit b92d85a820e00c41054c2804587d673fcde6ea1f (chore: sync engine changes from enterprise), listed in the 2.3.15 release notes. The backfill file is absent in 2.3.13 and this code path remains in 2.3.17.
Expected behavior
Memory consumption should be bounded by a page/batch budget rather than the size of the entire remaining workflow-data range. Progress should survive restart, and each workflow should only be classified after all required fields have been read.
Proposed reproduction / regression test
This is a suggested synthetic test, not a completed reproduction:
- Populate a filesystem/RocksDB-backed test store with many workflow-data records and substantial synthetic payloads.
- Leave the
gasoline_dead_wfcompletion marker unset, as on an upgrade from 2.3.13. - Run the backfill while measuring peak memory and the number/bytes of key-value pairs materialized by each range fetch.
- Check that the first fetch currently materializes the remaining range despite the 1,000-workflow processing cutoff.
- After a fix, assert bounded fetches, correct dead-workflow indexing, and continuation correctness when one workflow spans multiple pages or execution restarts between pages.
Possible fix
Either paginate this backfill explicitly or implement genuinely bounded pagination in the RocksDB range-stream adapter. Preserve partial workflow aggregation across page boundaries (or an equivalent safe continuation scheme) so a row limit does not misclassify workflows or repeatedly rescan a single oversized workflow without making progress. A broader adapter change would need transaction/snapshot-semantics coverage.
- Lenguaje dominante
- Rust
- Estrellas
- 6.5k
- Forks
- 291
- Merge medio
- 16 h 58 min
- PR fusionados (30 d)
- 33
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de rivet-dev/rivet
-
rivetkit client: ActorConn debug log prints action argumentsPosiblemente ocupada @Jbansal2 la tomó hace 2 días. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 80/100
rivet-dev/rivet#5955 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
rivetkit 3.0: HTTP 400 overloaded on node pool upsert is treated as fatal and exits the processAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
rivet-dev/rivet#5933 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
effect: action on a missing actor instance fails as internal_error instead of actor.abortedPosiblemente ocupada @kunalgoesbyken la tomó hace 11 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
rivet-dev/rivet#5891 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Rust client drops connection-level errors when actionId is null (JSON/CBOR)Posiblemente ocupada @DibbayajyotiRoy la tomó hace 33 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
rivet-dev/rivet#5819 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Queue docs say completable messages are removed on receive, but they stay stored until complete()Posiblemente ocupada @Saisharathchandranandnetha la tomó hace 44 días. Abierto
Dificultad 1/5 1-3 horas Aptitud para principiantes 91/100
rivet-dev/rivet#5762 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de rivet-dev/rivet
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 69/100
Los mantenedores suelen responder en 1 día
-
A match arm above the largest i64 is compared as 0Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 83/100
DioxusLabs/dioxus#6063 ·
Los mantenedores suelen responder en 1 día
-
`nsh-core` fails to compile when taffy's default `calc` feature is enabled elsewhere in the graphAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
longbridge/nsh#966 ·
Los mantenedores suelen responder en 1 día
-
Windows docs: pin a tested ConPTY version for Kitty graphics; 1.25.260930003 corrupts large uploadsAbierto
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
raphamorim/rio#2021 ·
Los mantenedores suelen responder en 1 día