[AMORO-3921] Add AmsAssignService and ZkBucketAssignStore to implement balanced bucket allocation in master-slave mode#3922
[AMORO-3921] Add AmsAssignService and ZkBucketAssignStore to implement balanced bucket allocation in master-slave mode#3922wardlican wants to merge 13 commits intoapache:masterfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3922 +/- ##
=========================================
Coverage 22.44% 22.45%
- Complexity 2552 2555 +3
=========================================
Files 458 458
Lines 42022 42045 +23
Branches 5915 5917 +2
=========================================
+ Hits 9433 9440 +7
- Misses 31777 31793 +16
Partials 812 812
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@amoro.apache.org list. Thank you for your contributions. |
|
Please conduct a code review of the implementation here. |
|
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@amoro.apache.org list. Thank you for your contributions. |
|
This pull request has been closed due to lack of activity. This is not a judgement on the merit of the PR in any way. It is just a way of keeping the PR queue manageable. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time. |
…on in master-slave mode. apache#3921
…on in master-slave mode. apache#3921
…on in master-slave mode. apache#3921
…on in master-slave mode. apache#3921
…on in master-slave mode. apache#3921
amoro-ams/src/main/java/org/apache/amoro/server/AmoroManagementConf.java
Outdated
Show resolved
Hide resolved
amoro-ams/src/main/java/org/apache/amoro/server/AmsAssignService.java
Outdated
Show resolved
Hide resolved
amoro-ams/src/main/java/org/apache/amoro/server/AmoroServiceContainer.java
Show resolved
Hide resolved
amoro-ams/src/main/java/org/apache/amoro/server/ZkBucketAssignStore.java
Show resolved
Hide resolved
amoro-ams/src/main/java/org/apache/amoro/server/AmsAssignService.java
Outdated
Show resolved
Hide resolved
amoro-ams/src/main/java/org/apache/amoro/server/AmsAssignService.java
Outdated
Show resolved
Hide resolved
amoro-ams/src/main/java/org/apache/amoro/server/BucketAssignStore.java
Outdated
Show resolved
Hide resolved
amoro-ams/src/main/java/org/apache/amoro/server/BucketAssignStoreFactory.java
Outdated
Show resolved
Hide resolved
amoro-ams/src/main/java/org/apache/amoro/server/ZkBucketAssignStore.java
Show resolved
Hide resolved
xxubai
left a comment
There was a problem hiding this comment.
Thanks for keeping pushing this feature
amoro-ams/src/main/java/org/apache/amoro/server/AmoroManagementConf.java
Outdated
Show resolved
Hide resolved
amoro-ams/src/main/java/org/apache/amoro/server/AmoroServiceContainer.java
Outdated
Show resolved
Hide resolved
amoro-common/src/main/java/org/apache/amoro/exception/AmoroRuntimeException.java
Outdated
Show resolved
Hide resolved
amoro-ams/src/main/java/org/apache/amoro/server/AmsAssignService.java
Outdated
Show resolved
Hide resolved
| * ZkBucketAssignStore.getNodeKey(). | ||
| */ | ||
| private String getNodeKey(AmsServerInfo nodeInfo) { | ||
| return nodeInfo.getHost() + ":" + nodeInfo.getThriftBindPort(); |
There was a problem hiding this comment.
AmsServerInfo.equals() compares host, thriftBindPort, and restBindPort. But ZkBucketAssignStore.parseNodeKey() (line 225-233) and AmsAssignService.getNodeKey() only store host:thriftBindPort, losing restBindPort.
Will the AmsServerInfo collections return the incorrect result? like removeAll(nodes), containsKey(nodeKey)
There was a problem hiding this comment.
There won't be this problem. This is mainly used to distinguish different AMS nodes. The IP address and Thriftport are already sufficient to uniquely identify different nodes, so there's no need to add a restport.
Why are the changes needed?
This implements the logic for dynamically and evenly distributing buckets based on the number of AMS nodes.
Close #3921 .
Brief change log
AmsAssignService Functionality
ZkBucketAssignStore Features
/{cluster}/amoro/ams/bucket-assignments/{nodeKey}/assignmentsand/{cluster}/amoro/ams/bucket-assignments/{nodeKey}/last-update-timetwo classes that work together to implement dynamic bucket ID allocation and storage in master-slave mode.
How was this patch tested?
Add some test cases that check the changes thoroughly including negative and positive cases if possible
Add screenshots for manual tests if appropriate
Run test locally before making a pull request
Documentation