Skip to content

Fix DuckDB scans over Vortex being merged or stalling - #9803

Merged
joseph-isaacs merged 2 commits into
developfrom
claude/duckdb-vortex-scan-fixes
Sep 10, 2026
Merged

Fix DuckDB scans over Vortex being merged or stalling#9803
joseph-isaacs merged 2 commits into
developfrom
claude/duckdb-vortex-scan-fixes

Conversation

@joseph-isaacs

@joseph-isaacs joseph-isaacs commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

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.

@joseph-isaacs
joseph-isaacs requested a review from myrrc September 8, 2026 16:05
@codspeed-hq

codspeed-hq Bot commented Sep 8, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

✅ 2197 untouched benchmarks
⏩ 218 skipped benchmarks1


Comparing claude/duckdb-vortex-scan-fixes (9a22cae) with develop (d6037bc)

Open in CodSpeed

Footnotes

  1. 218 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@joseph-isaacs joseph-isaacs added changelog/fix A bug fix ext/duckdb Relates to the DuckDB integration labels Sep 8, 2026 — with Claude
@codecov

codecov Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.34%. Comparing base (5c8c397) to head (385e8ec).

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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
@joseph-isaacs
joseph-isaacs force-pushed the claude/duckdb-vortex-scan-fixes branch from 385e8ec to 3675253 Compare September 10, 2026 16:03
Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
@joseph-isaacs
joseph-isaacs merged commit 35cd01f into develop Sep 10, 2026
85 checks passed
@joseph-isaacs
joseph-isaacs deleted the claude/duckdb-vortex-scan-fixes branch September 10, 2026 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/fix A bug fix ext/duckdb Relates to the DuckDB integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants