Add can_match summary to profile=true for SHARD_FRAGMENT stages - #22838
Add can_match summary to profile=true for SHARD_FRAGMENT stages#22838finnegancarroll wants to merge 4 commits into
Conversation
profile=true reported nothing about the can_match pre-filter phase, so a query that pruned or top-N-skipped most of its shards gave no visibility into why those shards never ran. Adds a per-SHARD_FRAGMENT-stage can_match block exposing: can_match_ms, total_shards, shards_pruned_by_filter, shards_skipped_by_topn, topn_gate_armed, shards_dispatched. All values are coordinator-side aggregates — can_match is a plain request/response transport action with no streaming, and all pruning/ordering/top-N decisions are made on the coordinator, so this needs no shard-side or native (Rust) changes. The block is attached to StageProfile and is null (absent from JSON) when the phase did not run. Signed-off-by: Finnegan Carroll <carrofin@amazon.com> Signed-off-by: Finn Carroll <carrofin@amazon.com>
PR Reviewer Guide 🔍(Review updated until commit 1b0b3d8)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 1b0b3d8 Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit d03a2a0
Suggestions up to commit fc209dc
Suggestions up to commit 8fa9abd
|
Address review: import CanMatchProfile rather than referencing it by its fully-qualified path in canMatchProfile(). Signed-off-by: Finnegan Carroll <carrofin@amazon.com> Signed-off-by: Finn Carroll <carrofin@amazon.com>
|
Persistent review updated to latest commit fc209dc |
Broadens can_match profile coverage from 2 to 6 scenarios, mirroring the scenarios in the coordinator-module behavioral ITs (CanMatchPruningIT, SortEarlyTerminationIT) but asserting the profile block rather than dispatch counts. Reuses their proven daily single-shard parquet index / PPL comma-list fixture so day <-> shard is 1:1 and prune counts are deterministic. Profile lives only on the REST/coordinator-local path (QueryProfile is not serialized over transport), so these assertions cannot live in the transport-driven behavioral ITs — this REST IT is their observability counterpart. The top-N skip COUNT is timing-dependent (elimination only fires on shards still queued when the gate arms, and REST can't pin the per-node dispatch window the way SortEarlyTerminationIT does), so that case asserts the deterministic facts — gate armed + consistent counts — not a specific skip count. Signed-off-by: Finnegan Carroll <carrofin@amazon.com> Signed-off-by: Finn Carroll <carrofin@amazon.com>
|
Persistent review updated to latest commit d03a2a0 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #22838 +/- ##
============================================
- Coverage 71.58% 71.57% -0.01%
+ Complexity 77353 77330 -23
============================================
Files 6170 6170
Lines 359700 359700
Branches 52459 52459
============================================
- Hits 257493 257459 -34
- Misses 81808 81827 +19
- Partials 20399 20414 +15 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The three filter tests compared @timestamp (TIMESTAMP) against a bare string literal, relying on implicit coercion that the distributed analytics path does not always apply — surfacing as a 500: GTE function ... but got [TIMESTAMP, STRING] The coercion held when the class ran in isolation but not under the full IT suite (schema/plan resolution differs), so CI failed while local isolated runs passed. Type the literals explicitly with TIMESTAMP(...), matching the accepted form used elsewhere in the REST ITs (e.g. DatetimeCoverageIT), so no coercion is relied upon. Verified all 6 tests pass on EC2 under the CI locale/timezone that originally failed (ar-KM / Europe/Saratov). Signed-off-by: Finnegan Carroll <carrofin@amazon.com> Signed-off-by: Finn Carroll <carrofin@amazon.com>
|
Persistent review updated to latest commit 1b0b3d8 |
is flaky |
Adding support for
profile=truefor the can_match stage. All metrics are already computed and surfaced on the coordinator.A
can_matchblock is attached to eachSHARD_FRAGMENTstage in the profile response, present only when the can_match phase actually ran (query had range filters or a bounded-field sort, and the fan-out cleared the pre-filter threshold).Fields
can_match_mstotal_shardsshards_pruned_by_filtershards_skipped_by_topntopn_gate_armedshards_dispatchedtotal_shards - pruned - skipped)