-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow optional segments that can be skipped by servers without failing the query #11978
Merged
Conversation
This file contains 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
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #11978 +/- ##
============================================
+ Coverage 61.52% 61.61% +0.08%
+ Complexity 1152 207 -945
============================================
Files 2386 2390 +4
Lines 129565 129823 +258
Branches 20053 20082 +29
============================================
+ Hits 79721 79990 +269
+ Misses 44026 44001 -25
- Partials 5818 5832 +14
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
289ac57
to
b7f7e7b
Compare
b7f7e7b
to
1f46ec9
Compare
a9e7bce
to
39342e2
Compare
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseBrokerRequestHandler.java
Outdated
Show resolved
Hide resolved
a9c0462
to
a716986
Compare
pinot-broker/src/main/java/org/apache/pinot/broker/api/resources/PinotBrokerDebug.java
Outdated
Show resolved
Hide resolved
...c/main/java/org/apache/pinot/broker/requesthandler/SingleConnectionBrokerRequestHandler.java
Outdated
Show resolved
Hide resolved
pinot-core/src/main/java/org/apache/pinot/core/routing/RoutingTable.java
Outdated
Show resolved
Hide resolved
pinot-broker/src/main/java/org/apache/pinot/broker/routing/BrokerRoutingManager.java
Outdated
Show resolved
Hide resolved
...ker/src/main/java/org/apache/pinot/broker/routing/instanceselector/BaseInstanceSelector.java
Outdated
Show resolved
Hide resolved
90e5feb
to
1e2d52f
Compare
jhyao
pushed a commit
to jhyao/pinot
that referenced
this pull request
Nov 21, 2023
pinot-broker/src/main/java/org/apache/pinot/broker/api/resources/PinotBrokerDebug.java
Outdated
Show resolved
Hide resolved
pinot-broker/src/main/java/org/apache/pinot/broker/api/resources/PinotBrokerDebug.java
Outdated
Show resolved
Hide resolved
pinot-core/src/main/java/org/apache/pinot/core/routing/RoutingTable.java
Outdated
Show resolved
Hide resolved
pinot-core/src/main/java/org/apache/pinot/core/transport/QueryRouter.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/apache/pinot/broker/routing/instanceselector/BalancedInstanceSelector.java
Outdated
Show resolved
Hide resolved
pinot-core/src/main/java/org/apache/pinot/core/routing/RoutingTable.java
Show resolved
Hide resolved
pinot-broker/src/main/java/org/apache/pinot/broker/routing/BrokerRoutingManager.java
Outdated
Show resolved
Hide resolved
c5cb275
to
ba961e5
Compare
Jackie-Jiang
approved these changes
Nov 28, 2023
pinot-broker/src/main/java/org/apache/pinot/broker/api/resources/PinotBrokerDebug.java
Outdated
Show resolved
Hide resolved
pinot-broker/src/main/java/org/apache/pinot/broker/routing/BrokerRoutingManager.java
Outdated
Show resolved
Hide resolved
pinot-broker/src/main/java/org/apache/pinot/broker/routing/BrokerRoutingManager.java
Outdated
Show resolved
Hide resolved
pinot-core/src/main/java/org/apache/pinot/core/transport/QueryRouter.java
Outdated
Show resolved
Hide resolved
Closed
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.
This PR tries to address issue: #11965, basically by extending the NewSegment concept added for instanceSelector early on. The NewSegment concept was added to handle the case when new consuming segments are added in IdealState but not online in ExternalView yet, as servers may take time to load new consuming segments and report the status back to Helix. Instead of reporting such new segments as unavailable segments, broker simply skips them.
But simply skipping them at broker side could cause the wrong query results as detailed in the new issue. e.g. for upsert table, the server could start to ingest new records into the new segments and invalidate the records in existing segments, even before the broker could mark those new consuming segments as online, thus queries could not see the new records in new consuming segments during a short window. This issue could cause inconsistent query results, particularly for upsert table.
So in this PR, we track those new segments that not online in ExternalView, and pass them to servers, instead of skipping them at broker side. The servers can skip them if they are not available, otherwise, process they for correct query results, particular for upsert table.
TODO: this PR only made changes for SingleConnectionBrokerRequestHandler. Add support for GrpcServerRequest (based on protobuf) and multi-stage engine in separate PRs