Add getUnavailableSegments broker hook for route-level unavailable filtering#18906
Merged
9aman merged 1 commit intoJul 3, 2026
Merged
Conversation
…ltering Introduce a protected getUnavailableSegments(serverBrokerRequest, routeInfo) hook in BaseSingleStageBrokerRequestHandler. The default returns routeInfo.getUnavailableSegments() unchanged, and both read sites (the main routing path and the materialized-view-split fallback) now route through it. This lets a subclass narrow the reported unavailable segments to those a query will actually read after routing-level pruning, with no behavior change for OSS or existing tables.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #18906 +/- ##
============================================
- Coverage 64.80% 64.79% -0.01%
Complexity 1347 1347
============================================
Files 3393 3392 -1
Lines 211664 211641 -23
Branches 33305 33300 -5
============================================
- Hits 137160 137135 -25
- Misses 63431 63444 +13
+ Partials 11073 11062 -11
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
9aman
approved these changes
Jul 3, 2026
9aman
left a comment
Contributor
There was a problem hiding this comment.
LGTM. Can we add a simple test for this that ensures the filtering part.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a
protected List<String> getUnavailableSegments(BrokerRequest serverBrokerRequest, TableRouteInfo routeInfo)hook toBaseSingleStageBrokerRequestHandler.routeInfo.getUnavailableSegments()unchanged.handleRequest(the main routing path and the materialized-view-split fallback) now call the hook instead of reading the route directly.Why
The single-stage handler builds the "segments unavailable" warning from
routeInfo.getUnavailableSegments()before any subclass gets to post-process the route inprocessBrokerRequest. A subclass that prunes routing (e.g. narrowing a query to a single snapshot/version) has no way to keep that warning in sync, so it can report segments the query will never actually read.This hook is the extension point: a subclass can narrow the reported unavailable segments to the set the query will actually read after routing-level pruning.
Behavior change
None for OSS or existing tables — the default hook returns the same list the code read before.
Testing
Existing
pinot-brokertests pass. The hook has no standalone behavior to test beyond the passthrough default, which existing routing/handler tests already exercise.🤖 Generated with Claude Code