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

Aberta
#11,918 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
5/5
Tempo estimado
Mais de uma semana
Facilidade para iniciantes
15/100
Tipo de issue
Refatoração
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
rust
Domínio
backend

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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

Linguagem predominante
Rust
Estrelas
3.2k
Forks
239
Merge médio
1d 4h
PRs com merge (30d)
684

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de vortex-data/vortex

Todas as issues de vortex-data/vortex

Issues semelhantes

Mais issues de Rust

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.