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.
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
colocated-without-hints #13943
colocated-without-hints #13943
Changes from 6 commits
656b0ce
860437b
dec74d3
c674900
7bf5a00
83a9e4b
c58db84
0a07920
125be2c
5a2de52
e3f2096
ff627b3
bbf3e5e
06e8c1b
bdca363
f16eecf
598b17e
75d077f
9fda5de
047500d
3743d73
14e26f1
977fa16
172f605
c64095f
24036a9
f50b3c0
1a13516
460a8e5
8512fd2
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
We want to pick the first hint that matches the name. The reason is that user might override the same hint multiple times, and the first one should be the closest one.
Suggest adding this as a util method in
PinotHintStrategyTable
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.
I checked out the code but cannot find this class in IDE. Is this auto generated by the annotation framework?
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.
This is the class that is autogenerated by immutables.
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.
(MAJOR) This is not robust, and can cause wrong behavior on real-time or hybrid table. We'll need to check both real-time and offline and apply hint when they match each other, or only one exists
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.
Do you think we should apply the same check done in
WorkerManager
that verifies that there is at least one server that is fully replicated? I would suggest:SET implicitColocateJoin=true
, then we should fail.SET implicitColocateJoin=true
then we should not apply the optimization.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.
How complicated is this check? Are we going to replicate a lot of logic within
WorkerManager
?I was thinking only apply the hint when both tables have the same
partitionColumn
,partitionFunctionName
andnumPartitions
. Then I realized another issue: we need to know if a table exists to figure out whether it is either unpartitioned, or doesn't exist.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.
What do you mean? If the table doesn't exits we would have failed at validation time, right? Do you mean to actually have segments?
My concern here is that
WorkerManager
fails if there is at least one partition that is not fully replicated (seepinot/pinot-query-planner/src/main/java/org/apache/pinot/query/routing/WorkerManager.java
Line 450 in 49126f2
partitionColumn
,partitionFunctionName
andnumPartitions
and the table is not fully replicated, we will end up failing atWorkerManager
.My suggestion is to modify
WorkerManager
to provide a method similar togetPartitionTableInfo
that we can call from the rule. This method should check whether partition info is equal and if for each partition there is at least one server with a full copy of the partition. The main differences with currentgetPartitionTableInfo
is that:PartitionTableInfo
, given it is an internal class the rule don't care about.getTablePartitionInfo
, which doesn't only get the info but also compares values on the hint with what is stored in the routing manager.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.
I've changed the code. Can you take a look to the new implementation that delegates on worker manager?