amoro icon indicating copy to clipboard operation
amoro copied to clipboard

Add a registration function for table allocation in master-slave mode.

Open wardlican opened this issue 1 month ago • 3 comments

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:

  1. 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.
  1. Node deregistration:
  • Nodes actively deregister from their ZK registration information when shutting down.
  1. 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)

wardlican avatar Nov 10 '25 07:11 wardlican

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.

Files with missing lines Patch % Lines
...apache/amoro/server/HighAvailabilityContainer.java 67.24% 15 Missing and 4 partials :warning:
...org/apache/amoro/server/AmoroServiceContainer.java 14.28% 12 Missing :warning:
...a/org/apache/amoro/properties/AmsHAProperties.java 0.00% 1 Missing :warning:
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.

codecov-commenter avatar Nov 10 '25 10:11 codecov-commenter

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.

github-actions[bot] avatar Dec 11 '25 00:12 github-actions[bot]

Please check the changes here.

wardlican avatar Dec 11 '25 06:12 wardlican