Log root search requests and partial resource stats on cancellation - #6780
Log root search requests and partial resource stats on cancellation#6780PSeitz-dd wants to merge 1 commit into
Conversation
633a43a to
23d8fed
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 633a43ad50
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| let response = task.await?; | ||
| if let Some(log) = resource_log { | ||
| log.record_response(&response); |
There was a problem hiding this comment.
Capture resource stats before entering a retry
When ClusterClient::leaf_search receives a partial response, it performs its retry before this task.await completes. If the root request is cancelled during that retry, resource stats from the already-completed initial attempt are dropped and never reach the guard; similarly, an initial RPC error followed by a successful retry can be logged as complete even though the failed attempt's usage is unavailable. Record per-attempt responses inside the retry path so cancellation and completeness accounting include every finished attempt.
Useful? React with 👍 / 👎.
| let mut log_guard = RootSearchLogGuard { | ||
| start_instant, | ||
| search_request: &search_request, | ||
| num_docs, | ||
| num_splits, | ||
| status: "cancelled", |
There was a problem hiding this comment.
Create the root-search log guard before planning
When split planning returns an error or the request is cancelled while awaiting the metastore, execution leaves this function before RootSearchLogGuard is constructed. Those requests therefore emit no root_search completion event at all, contrary to this guard's stated cancellation behavior; construct the guard before starting the planning future and make the planning-dependent fields optional or update them afterward.
Useful? React with 👍 / 👎.
Summary
Validation