Reader: concurrent scan with a confined arena per worker thread
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
- 12/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- java
- Área
- data, performance
Línea de trabajo
This is a design proposal, so the first step is deciding the open questions, not editing code. Read ScanIterator, Chunk and the existing confined-versus-shared arena handling, plus ADR 0003 for the exception contract on worker threads. Done means a recorded decision on shared versus per-worker mapping and ordered versus unordered delivery, then an A/B run with RealFileScanBenchmark.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Parked design for a concurrent reader scan. Follow-up to #474 (writer side, shipped).
Reference behavior
- Rust (
vortex-layout/src/scan/scan_builder.rs): the scan is split into row-range tasks (SplitBy), each spawned onto the session runtime, up toconcurrency * num_workersin flight (default 4 per worker).ordered(default) uses.buffered(n), otherwise.buffer_unordered(n). A per-splitmapfunction runs on the spawned task. - .NET (Vorticity):
MaxDegreeOfParallelismper session or per scan,MaxConcurrentReadsfor I/O, sharedSegmentCache, concurrent scans over one open file. - vortex-java today:
ScanIteratoris single-threaded, every arena isofConfined.
Proposed shape
A confined Arena per worker thread, so the callback runs on the worker and the caller never touches decoded memory from another thread:
scan.parallel(executor) // executor + bounded in-flight window on ScanOptions
.map(chunk -> r) // runs on the worker; chunk and its arena close on return
Rmust not reference chunk memory (aggregates, copied-out values); Javadoc states the contract.- Results delivered ordered (Rust
buffered, default) or unordered (buffer_unordered). - The file mapping becomes
ofShared(one close at the end), since workers must read it. Alternative: each worker maps its own view. scan()/ScanIterator/Chunklifetime rules stay unchanged.
Pros
- Rust-shaped (map on the spawned task, ordered/unordered, bounded window), so parity with the reference.
- Confined arenas keep the cheap alloc/close path;
Arena.ofShared().close()needs a cross-thread handshake per chunk. - No change to the existing single-threaded API or its safety checks.
- Same bounded-window idea as the writer's
pendingqueue /MAX_IN_FLIGHT_SEGMENTS. - Overlaps decode with consumption; wide files and slow consumers benefit most.
Cons
- No ordered, parallel, zero-copy
Iterator<Chunk>for a consumer thread: a chunk decoded on a worker cannot be read elsewhere. That case would need a shared per-chunk arena (slower close, and relaxes the "secondnext()while aChunkis open is rejected" rule). - Callback API is less ergonomic than an iterator; callers who must keep data have to copy out.
- Mapping arena goes shared; any cross-thread use after
close()becomes a hazard to test (ADR 0003 security contract still applies on worker threads: onlyVortexExceptionmay escape). - Worker exceptions must be propagated and in-flight work cancelled/drained on failure (the writer's
discardPendingequivalent). - Needs A/B on all 7 real files (
RealFileScanBenchmark, interleaved): memory-bandwidth-bound scans may not scale, and oversubscribing the pool gains nothing.
Out of scope / not planned
- Per-column parallel decode within a chunk: not a Rust pattern, so it would be a deliberate divergence needing an explicit decision.
- Parallel I/O for
VortexHttpReader(concurrent range requests): independent of this, worth its own ticket if pursued. - Writer follow-ups (parallel scheme trials in
CascadingCompressor.chooseBest): comment on #474.
- Lenguaje dominante
- Java
- Estrellas
- 3
- Forks
- 2
- Merge medio
- 9 h 47 min
- PR fusionados (30 d)
- 128
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la 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 dfa1/vortex-java
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
dfa1/vortex-java#636 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 70/100
dfa1/vortex-java#655 ·
Los mantenedores suelen responder en 1 día
-
perf
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
dfa1/vortex-java#651 ·
Los mantenedores suelen responder en 1 día
-
Writer: string columns written as per-chunk dicts where Rust uses its dict layout (up to 2x larger)Abiertoperf
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
dfa1/vortex-java#650 ·
Los mantenedores suelen responder en 1 día
-
perf
Dificultad 4/5 3-5 días Aptitud para principiantes 28/100
dfa1/vortex-java#649 ·
Los mantenedores suelen responder en 1 día
Todos los issues de dfa1/vortex-java
Issues similares
-
5.0.x backport enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 63/100
spring-cloud/spring-cloud-function#1507 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
open-learning-exchange/myplanet#18484 ·
Los mantenedores suelen responder en 1 día
-
ai-driven-fuzzing bug claude Minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
linagora/twake-calendar-side-service#1417 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
line/armeria#7109 · 3 reacciones ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
open-feature/java-sdk-contrib#1966 ·
Los mantenedores suelen responder en 1 día