-
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
Add query option to use more replica groups #8550
Conversation
Please Review @sajjad-moradi @snleee |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a unit test for invalid value for numReplicas in the option?
...main/java/org/apache/pinot/broker/routing/instanceselector/ReplicaGroupInstanceSelector.java
Outdated
Show resolved
Hide resolved
...ker/src/test/java/org/apache/pinot/broker/routing/instanceselector/InstanceSelectorTest.java
Outdated
Show resolved
Hide resolved
...ker/src/test/java/org/apache/pinot/broker/routing/instanceselector/InstanceSelectorTest.java
Outdated
Show resolved
Hide resolved
...ker/src/test/java/org/apache/pinot/broker/routing/instanceselector/InstanceSelectorTest.java
Outdated
Show resolved
Hide resolved
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseBrokerRequestHandler.java
Outdated
Show resolved
Hide resolved
pinot-core/src/main/java/org/apache/pinot/core/util/QueryOptionsUtils.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Partial Review
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseBrokerRequestHandler.java
Outdated
Show resolved
Hide resolved
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseBrokerRequestHandler.java
Outdated
Show resolved
Hide resolved
...main/java/org/apache/pinot/broker/routing/instanceselector/ReplicaGroupInstanceSelector.java
Outdated
Show resolved
Hide resolved
...main/java/org/apache/pinot/broker/routing/instanceselector/ReplicaGroupInstanceSelector.java
Outdated
Show resolved
Hide resolved
...main/java/org/apache/pinot/broker/routing/instanceselector/ReplicaGroupInstanceSelector.java
Outdated
Show resolved
Hide resolved
...ker/src/test/java/org/apache/pinot/broker/routing/instanceselector/InstanceSelectorTest.java
Outdated
Show resolved
Hide resolved
Please add a brief |
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseBrokerRequestHandler.java
Outdated
Show resolved
Hide resolved
...ker/src/main/java/org/apache/pinot/broker/routing/instanceselector/BaseInstanceSelector.java
Outdated
Show resolved
Hide resolved
...main/java/org/apache/pinot/broker/routing/instanceselector/ReplicaGroupInstanceSelector.java
Outdated
Show resolved
Hide resolved
pinot-spi/src/main/java/org/apache/pinot/spi/utils/CommonConstants.java
Outdated
Show resolved
Hide resolved
...main/java/org/apache/pinot/broker/routing/instanceselector/ReplicaGroupInstanceSelector.java
Outdated
Show resolved
Hide resolved
pinot-core/src/main/java/org/apache/pinot/core/util/QueryOptionsUtils.java
Outdated
Show resolved
Hide resolved
can we add sample docs to the description? is this specific to replica group based assignment or a generic solution where users can override routing strategy on a per query basis |
cf61e33
to
fcde57e
Compare
Codecov Report
@@ Coverage Diff @@
## master #8550 +/- ##
=============================================
- Coverage 70.83% 29.46% -41.38%
=============================================
Files 1688 1676 -12
Lines 88295 87964 -331
Branches 13358 13327 -31
=============================================
- Hits 62542 25916 -36626
- Misses 21388 59666 +38278
+ Partials 4365 2382 -1983
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
This is specific to replica group based assignment in which user can specify in each query string to use more than one replica group for query execution. @PrachiKhobragade correct me if I'm wrong. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Please update the description with a sample query and add maybe add a small release note section with summary to make life easier for the next person cutting the release.
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseBrokerRequestHandler.java
Outdated
Show resolved
Hide resolved
...ker/src/test/java/org/apache/pinot/broker/routing/instanceselector/InstanceSelectorTest.java
Outdated
Show resolved
Hide resolved
...ker/src/main/java/org/apache/pinot/broker/routing/instanceselector/BaseInstanceSelector.java
Outdated
Show resolved
Hide resolved
@kishoreg This is for overriding # of replica groups to route per-query basis for tables with replica group feature enabled. We can use a similar approach to allow users to use different instance selecting algorithms (e.g. balanced vs replica group-based). |
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseBrokerRequestHandler.java
Show resolved
Hide resolved
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseBrokerRequestHandler.java
Outdated
Show resolved
Hide resolved
...main/java/org/apache/pinot/broker/routing/instanceselector/ReplicaGroupInstanceSelector.java
Outdated
Show resolved
Hide resolved
added an invalid option test in QueryValidationTest |
fcde57e
to
c94c988
Compare
In case when the routingConfig is replicaGroup, user can provide an option to fan out a query to x replicaGroups where 1 <= x <= replicaGroups so that more resources could be used for an expensice query
c94c988
to
bde6102
Compare
@kishoreg This will be specific to Replica Group based based routing |
@sajjad-moradi added |
bde6102
to
7f00eac
Compare
7f00eac
to
d8012e7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you for adding this feature!
In case when the routingConfig is replicaGroup, user can provide an option to
fan out a query to x replicaGroups where 1 <= x <= replicaGroups so that more
resources could be used for an expensive query
Fixes #8217
Release Notes
When the instance selection criteria for segments is based on replica groups
REPLICA_GROUP_INSTANCE_SELECTOR_TYPE
, the query goes to just one of the many replica groups, this helps in limiting the number of servers used to serve this query. This may sometimes have a negative effect on time consuming queries, which would get served slower. If we can somehow give an option to the user to fan their query to more replica groups, the query can be served faster.This PR will add an option to the Sql query
numReplicaGroupsToQuery
which will take a positive integer, specifying the number of replica groups the query should be fanned out to.Eg: When the replica group is set to 3, and with 3 servers
S1, S2, S3.
All the segments will be available on all the servers and we would choose any ofS1 | S2 | S3
to serve the segments, with numReplicaGroupsToQuery set to 2 option passed with the query, we will chose two servers to serve the query with the number of segments coming equally from both the servers.An example query should look like :