Skip to content

[improve]: Support multiple nodes to access Amoro Rest service in a high availability environment #3567

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

czy006
Copy link
Contributor

@czy006 czy006 commented May 16, 2025

Support multiple nodes to access Amoro Rest service in a high availability environment

Why are the changes needed?

  • Support multiple nodes to access Amoro Rest service in a high availability
  • Just Leader node running OptimizingService

Close #2810.

Brief change log

  • Support multiple nodes to access Amoro Rest service in a high availability environment

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)
  • If yes, how is the feature documented? (not documented)

@github-actions github-actions bot added the module:ams-server Ams server module label May 16, 2025
@czy006 czy006 force-pushed the zk-ha-rest branch 2 times, most recently from 934c69a to eba90fe Compare May 16, 2025 07:05
@czy006
Copy link
Contributor Author

czy006 commented May 22, 2025

3 amoro nodes,normal change service to leader

image

@czy006 czy006 requested a review from baiyangtx May 22, 2025 07:58
@czy006 czy006 changed the title [Draft]Support multiple nodes to access Amoro Rest service in a high availability environment [improve]: Support multiple nodes to access Amoro Rest service in a high availability environment May 22, 2025
@codecov-commenter
Copy link

codecov-commenter commented May 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 21.77%. Comparing base (58c6013) to head (b3c26c6).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #3567   +/-   ##
=========================================
  Coverage     21.76%   21.77%           
  Complexity     2391     2391           
=========================================
  Files           431      433    +2     
  Lines         40501    40481   -20     
  Branches       5745     5743    -2     
=========================================
- Hits           8816     8813    -3     
+ Misses        30938    30921   -17     
  Partials        747      747           
Flag Coverage Δ
trino 21.77% <ø> (+<0.01%) ⬆️

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.

Copy link
Contributor

@zhoujinsong zhoujinsong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the work! I left a minor comment, PTAL.

@czy006 czy006 requested review from zhoujinsong and xxubai May 26, 2025 06:56
Copy link
Contributor

@xxubai xxubai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good in total

@czy006 czy006 requested a review from xxubai May 29, 2025 06:23
Copy link
Contributor

@xxubai xxubai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. But I'm not good at HA serivces, take my +1.

service.waitFollowerShip();
// become follower, dispose optimizingService stop
service.stopOptimizingService();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why didn't you put this in service.dispose? or you may change service.dispose in finally block to service.stopOptimizingService ???

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dispose will be close all service (include rest) .if this node become follower,we just close optimizingService,and will be run waitting become Leader service.waitLeaderShip()

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the finally block will dispose all services. so you should use stopOptimizingService to repalce dsipose in finally block ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module:ams-server Ams server module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: Support multi-instance AMS REST service
5 participants