-
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
assign segments for upsert table with respect to ideal state #11628
Conversation
Codecov Report
@@ Coverage Diff @@
## master #11628 +/- ##
============================================
- Coverage 63.10% 63.04% -0.06%
- Complexity 1120 1121 +1
============================================
Files 2335 2343 +8
Lines 125212 125753 +541
Branches 19209 19321 +112
============================================
+ Hits 79018 79286 +268
- Misses 40560 40818 +258
- Partials 5634 5649 +15
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 29 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
...g/apache/pinot/controller/helix/core/assignment/segment/StrictRealtimeSegmentAssignment.java
Show resolved
Hide resolved
...g/apache/pinot/controller/helix/core/assignment/segment/StrictRealtimeSegmentAssignment.java
Outdated
Show resolved
Hide resolved
...g/apache/pinot/controller/helix/core/assignment/segment/StrictRealtimeSegmentAssignment.java
Outdated
Show resolved
Hide resolved
...g/apache/pinot/controller/helix/core/assignment/segment/StrictRealtimeSegmentAssignment.java
Outdated
Show resolved
Hide resolved
pinot-controller/src/main/java/org/apache/pinot/controller/api/upload/ZKOperator.java
Outdated
Show resolved
Hide resolved
...c/main/java/org/apache/pinot/controller/helix/core/assignment/segment/SegmentAssignment.java
Outdated
Show resolved
Hide resolved
cad6f85
to
aadaa17
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
This PR adds more checks when assigning new segments for upsert table, in order to process queries correctly. The extra checks make sure that at any time the idealState has all segments from the same table partition hosted on same server. Basically, it honors the assignment in the current idealState over the one as calculated by InstancePartition.
The segment is assigned according to InstancePartition, which can be ahead of IdealState if table rebalance fails to update idealState completely according to the new InstancePartition or is in middle of updating the idealState. If the new segment assignment is simply set in IdealState as done today, it's possible new segments from the same partition start to go to new server, causing queries to return wrong results.The new checks added here avoid such issue by checking if the assignment in the current idealState for the table partition is same as the one calculated from InstancePartition and favor the idealState if mismatch.