Tracking Issue: Remove spawn_io and spawn_blocking_io; hosts pass in every I/O provider

Abierto
#11,918 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
15/100
Tipo de issue
Refactorización
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
rust
Área
backend

Línea de trabajo

This is a multi-step tracking issue, not a single edit; start by reading the Executor trait in vortex-io/src/runtime/mod.rs and the completion-based IoService / IoSource interface in vortex-io/src/request/mod.rs, which is the target shape. The first checkbox is the smallest slice: turn the std_file reader into an IoService provider that owns its blocking pool, then confirm no read-path code calls spawn_blocking_io and that existing vortex-io tests still pass. Done means spawn_io and spawn_blocking_io are gone from both Executor and Handle with every reader supplied by the host.

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

Descripción

tracking-issue

This is a tracking issue for removing spawn_io and spawn_blocking_io from the runtime Executor trait (vortex-io/src/runtime/mod.rs), so that every byte source a scan reads is passed in by the host rather than driven by Vortex's runtime. Part of #9062.

Motivation

Executor has four methods, and two of them exist only because Vortex performs I/O itself: spawn_io for the object-store reader's async reads, and spawn_blocking_io for std::fs work in std_file, plus the JNI, Python and CUDA readers. A host with its own I/O stack has to route that work through its executor even when it would rather read through its own system. A fiber runtime such as ClickHouse's Silk, with one pinned thread per CPU and all I/O on io_uring, is the sharpest case: a blocking task on one of its threads stalls that CPU, and Vortex's own reads never reach its rings.

The V2 scan already reads through IoService / IoSource (vortex-io/src/request/mod.rs), which is completion-based and performs no I/O itself. Once every reader is a provider behind that interface, the runtime only has to run futures and CPU tasks.

Design

pub trait Executor: Send + Sync {
    fn spawn(&self, fut: BoxFuture<'static, ()>) -> AbortHandleRef;
    fn spawn_cpu(&self, task: Box<dyn FnOnce() + Send + 'static>) -> AbortHandleRef;
}

Each reader becomes an IoService implementation that owns whatever drives its I/O. The object-store provider owns its Tokio runtime, and the std::fs provider owns a blocking pool. A host supplies its own providers, or picks Vortex's. Filesystem listing and writes go the same way.

Driving the I/O is the host's job. A host that supplies a provider also runs whatever powers it, whether that's a Tokio runtime, a blocking pool or an io_uring completion loop. Vortex doesn't try to hide that, because it's specific to each engine. What Vortex owes the host is no hidden drivers: nothing on the read path spawns its own I/O tasks onto the host's executor and quietly relies on a waiting thread to poll them, the way the object-store reader's spawn_io tasks rely on DuckDB threads entering smol's executor today.

Steps

  • std_file and object-store reads as IoService providers that own their threads
  • JNI, Python and CUDA readers moved the same way
  • Filesystem listing and writes off spawn_blocking
  • V1 scan reads through IoService, or V1 is retired, so nothing on the read path calls spawn_io
  • Remove spawn_io and spawn_blocking_io from Executor and Handle

Unresolved questions

  • Whether writes belong behind the same provider interface as reads, or get their own.

Implementation history

Lenguaje dominante
Rust
Estrellas
3.2k
Forks
239
Merge medio
1 d 4 h
PR fusionados (30 d)
684

Preparar el entorno

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 vortex-data/vortex

Todos los issues de vortex-data/vortex

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.