Skip to content

Conversation

@wardlican
Copy link
Contributor

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 wardlican closed this Nov 10, 2025
@wardlican wardlican reopened this Nov 10, 2025
@codecov-commenter
Copy link

codecov-commenter commented Nov 10, 2025

Codecov Report

❌ Patch coverage is 58.97436% with 32 lines in your changes missing coverage. Please review.
✅ Project coverage is 29.07%. Comparing base (4382d55) to head (b635c0d).
⚠️ 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 ⚠️
...org/apache/amoro/server/AmoroServiceContainer.java 14.28% 12 Missing ⚠️
...a/org/apache/amoro/properties/AmsHAProperties.java 0.00% 1 Missing ⚠️
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%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Subtask]: Add a registration function for table allocation in master-slave mode.

2 participants