Skip to content

[Introspection] Support for partial results for internal queries#4485

Open
AhmedSoliman wants to merge 1 commit intomainfrom
pr4485
Open

[Introspection] Support for partial results for internal queries#4485
AhmedSoliman wants to merge 1 commit intomainfrom
pr4485

Conversation

@AhmedSoliman
Copy link
Copy Markdown
Contributor

@AhmedSoliman AhmedSoliman commented Mar 12, 2026

When distributed fan-out queries (e.g. select * from loglet_workers) encounter
unreachable nodes, return results from the available nodes instead of failing the
entire query. Per-node errors are surfaced as structured warnings alongside the
partial result set.

Implementation:

  • ErrorCatchingStream wraps each per-node stream in NodeFanOutExecutionPlan,
    catching errors into a shared NodeWarnings (Arc<parking_lot::Mutex>)
    and terminating the individual stream gracefully.
  • QueryContext::execute() returns a QueryResult that bundles the record batch
    stream with collected warning handles, walking the physical plan tree to
    extract them from any NodeFanOutExecutionPlan nodes.
  • QueryWarningStream in the gRPC handler buffers the last response and attaches
    accumulated warnings to it before yielding, piggybacking on existing data
    rather than sending a trailing empty message.
  • Proto: added QueryWarning message and repeated warnings field to QueryResponse.
  • CLI: restatectl collects warnings and displays them on stderr after results.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 12, 2026

Test Results

  7 files  ±0    7 suites  ±0   2m 36s ⏱️ -7s
 47 tests ±0   47 ✅ ±0  0 💤 ±0  0 ❌ ±0 
200 runs  ±0  200 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 6f7da6c. ± Comparison against base commit a2a9acb.

♻️ This comment has been updated with latest results.

When distributed fan-out queries (e.g. `select * from loglet_workers`) encounter
unreachable nodes, return results from the available nodes instead of failing the
entire query. Per-node errors are surfaced as structured warnings alongside the
partial result set.

Implementation:
- ErrorCatchingStream wraps each per-node stream in NodeFanOutExecutionPlan,
  catching errors into a shared NodeWarnings (Arc<parking_lot::Mutex<Vec>>)
  and terminating the individual stream gracefully.
- QueryContext::execute() returns a QueryResult that bundles the record batch
  stream with collected warning handles, walking the physical plan tree to
  extract them from any NodeFanOutExecutionPlan nodes.
- QueryWarningStream in the gRPC handler buffers the last response and attaches
  accumulated warnings to it before yielding, piggybacking on existing data
  rather than sending a trailing empty message.
- Proto: added QueryWarning message and repeated warnings field to QueryResponse.
- CLI: restatectl collects warnings and displays them on stderr after results.
@AhmedSoliman
Copy link
Copy Markdown
Contributor Author

Adding @tillrohrmann as reviewer to help driving this to completion. I'd like to get this merged. It's a low-impact PR since it only impacts internal datafusion tables (via restatectl).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant