Fix DuckDB scans over Vortex being merged or stalling - #9803
Conversation
Merging this PR will not alter performance
|
Codecov Report✅ All modified and coverable lines are covered by tests. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
A Vortex runtime driven from a thread inside `tokio::runtime::Runtime::block_on` loses the wakeups that complete its I/O and parks forever. The DuckDB SLT runner drove each file from inside `rt.block_on`, so a long sequence of scans reliably wedged: tracing showed a read issuing `get_opts` and never being resumed, with every thread parked and the blocking worker already idle. The trigger is narrow and was worth isolating before fixing. It needs both an awaited Tokio task and a driving thread inside `Runtime::block_on`; neither alone reproduces. An `enter()` guard is fine, wakeups from ordinary foreign threads are fine, and a plain `tokio::spawn` stalls just as a `spawn_blocking` does, so this is not about the blocking pool or about worker counts -- a multi-threaded runtime stalls identically. See #9817. DuckDB needs no Tokio here: `AsyncDB::run` is synchronous, `vortex-duckdb` drives its own `CurrentThreadRuntime`, and only DataFusion `.slt` files use the `sleep` and `system` directives. So the DuckDB path now drives its runner with `futures::executor::block_on` and the DataFusion path keeps its Tokio runtime. Also records the real hazard in `resolve_filesystem`, whose comment previously gave only the blocking-pool cost as the reason to keep local files off `Compat`. Fixes #9817 Signed-off-by: "Joe Isaacs" <joe.isaacs@live.co.uk> Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J9w8fY73UoZKRboETTuBit
385e8ec to
3675253
Compare
Summary
Two bugs surfaced by running all 99 TPC-DS queries against Vortex through DuckDB in a single connection (the TPC-DS SLT suite is stacked on this PR). Both make DuckDB over Vortex either return wrong results or hang, so they are split out here for separate review.