Add a registration function for table allocation in master-slave mode.
Why are the changes needed?
The HighAvailabilityContainer adds a node registration function. In master-slave mode, each AMS node, after startup, needs to elect a master through ZooKeeper and register its own node information in ZooKeeper. Registration is done using ephemeral nodes. If a node fails, its registration information needs to be automatically deleted. The system also provides the master node with the ability to view the list of currently active nodes.
Close #3919 .
Brief change log
Core functionalities implemented:
- Node registration:
- In master-slave mode, AMS nodes register their information with ZooKeeper (ZK) upon startup.
- Ephemeral sequential nodes (EPHEMERAL_SEQUENTIAL) are used, automatically cleaned up when a node exits abnormally.
- Node deregistration:
- Nodes actively deregister from their ZK registration information when shutting down.
- Live node query:
-
The master node can query a list of all currently live nodes. In non-master or non-master-slave modes, an empty list is returned.
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
- Does this pull request introduce a new feature? (yes / no)
- If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
Codecov Report
:x: Patch coverage is 58.97436% with 32 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 29.07%. Comparing base (4382d55) to head (b635c0d).
:warning: Report is 23 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #3920 +/- ##
============================================
+ Coverage 29.00% 29.07% +0.07%
- Complexity 3850 3867 +17
============================================
Files 631 634 +3
Lines 50770 50880 +110
Branches 6543 6553 +10
============================================
+ Hits 14724 14795 +71
- Misses 34989 35023 +34
- Partials 1057 1062 +5
| Flag | Coverage Δ | |
|---|---|---|
| core | 29.07% <58.97%> (+0.07%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
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 [email protected] list. Thank you for your contributions.
Please check the changes here.