-
Notifications
You must be signed in to change notification settings - Fork 1.4k
notify servers that need to move segments to new tiers via SegmentReloadMessage #9624
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
notify servers that need to move segments to new tiers via SegmentReloadMessage #9624
Conversation
577dc49 to
3172632
Compare
Codecov Report
@@ Coverage Diff @@
## master #9624 +/- ##
============================================
- Coverage 28.09% 25.89% -2.20%
+ Complexity 53 44 -9
============================================
Files 1935 1934 -1
Lines 103815 103917 +102
Branches 15758 15770 +12
============================================
- Hits 29162 26913 -2249
- Misses 71780 74297 +2517
+ Partials 2873 2707 -166
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Jackie-Jiang
left a comment
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.
High level question: why is the logic implemented in the table rebalancer? IMO it should be part of the tier assigner
pinot-common/src/main/java/org/apache/pinot/common/messages/SegmentReloadMessage.java
Outdated
Show resolved
Hide resolved
pinot-common/src/main/java/org/apache/pinot/common/messages/SegmentReloadMessage.java
Outdated
Show resolved
Hide resolved
pinot-common/src/main/java/org/apache/pinot/common/messages/SegmentReloadMessage.java
Outdated
Show resolved
Hide resolved
pinot-common/src/main/java/org/apache/pinot/common/messages/SegmentReloadMessage.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.
Why do we need a separate config for this? Isn't this the same as tier assigner?
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.
SegmentTierAssigner just calculates target tiers for segments, but not trigger the real migration.
The SegmentRelocator is extended to kick off the tier migration automatically. But it can be turned off via this knob, if someone wants to trigger this manually to fully control when the migration starts.
The design decision was made to extend SegmentRelocator (not Assigner either to separate responsibilities). I extended TableRebalancer (used by SegmentRelocator) to check on a condition i.e. But looks like I can check on |
|
But why do we want to use a separate periodic task to trigger the reload? We should just trigger the reload in |
|
A new target tier can lead to two reactions:
Action 1 is handled by TableRebalancer; Action 2 is handled by SegmentReloadMessage. Extending SegmentRelocator, it's easy to control the sequence of those two actions, to do Action 2 after Action 1 is completed. So that, we don't send SegmentReloadMessage to a server that's not the ideal server for the segment yet, and it reloads the segment unnecessarily. |
|
It is okay to do it within the |
I think there may be use cases to separate the two: 1) keep SegmentTierAssigner running to calculate target tier continuously; 2) but not run SegmentRelocator task, instead do table rebalance and tier migration manually as planned maintenance based on prod env, like when cluster does not get queries. |
a9e5e58 to
6b8771c
Compare
Jackie-Jiang
left a comment
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 otherwise
pinot-common/src/main/java/org/apache/pinot/common/messages/SegmentReloadMessage.java
Outdated
Show resolved
Hide resolved
6b8771c to
23feef3
Compare
23feef3 to
64a292c
Compare
64a292c to
7609a9c
Compare
This PR is part of the work to support multi-datadir for Pinot server as tracked by #8843.
Following up #9598 and #9306, this one has extended TableRebalancer to find out which segments need to change their target tier, and reuse SegmentReloadMessage to notify servers to move segment to target tier locally. Segments that need to relocate to new servers are still handled by the existing logic of table rebalancer (i.e. by updating the segment placement in Helix ideal state). The new logic here only kicks in when all segments are already placed on their ideal servers.
Release Note
controller.segmentRelocator.enableLocalTierMigration - to turn this on/off; disabled by default.