amoro icon indicating copy to clipboard operation
amoro copied to clipboard

[Feature]: Support multi-instance AMS REST service

Open link3280 opened this issue 1 year ago • 5 comments

Description

Currently, only the leader AMS would provide REST service. When an AMS leader transition happens, the standby AMS would take 30+ seconds to initialize optimizing, after which the REST service is available. That affects the availability of the REST service.

I proposed to make the REST service independent of the leadership. That's to say, the stand-by AMS instances need to initialize and run REST service on start. Their only difference to a leader instance is no optimizing service.

Use case/motivation

No response

Describe the solution

I drew a diagram of the main modules in AMS.

amoro-follower-rest (1)

  • The green ones are the modules that should be run by both the leader and the followers when starting.
  • The yellow ones are the leader-only services that should be run when an AMS becomes the leader.
  • The remaining red one is a new module that syncs catalog changes from the leader through reloading from the database.

Subtasks

  • [ ] #3346

Related issues

No response

Are you willing to submit a PR?

  • [X] Yes I am willing to submit a PR!

Code of Conduct

link3280 avatar May 03 '24 10:05 link3280

Are you still working on this? I'm interesting in this too. @link3280

baiyangtx avatar Jun 28 '24 03:06 baiyangtx

Are you still working on this? I'm interesting in this too. @link3280

I'm reconsidering the proposal since @majin1102 plans to support multi-instance AMS. We could align the efforts to avoid duplicate work. What do you think? @baiyangtx

link3280 avatar Jun 28 '24 07:06 link3280

I started a discussion and provided a design. #2997

You are welcome to participate in the discussion. @link3280 @majin1102

baiyangtx avatar Jul 02 '24 15:07 baiyangtx

+1 We also need this part, design can be completed together will reduce duplication of work

czy006 avatar Aug 12 '24 08:08 czy006

The implementation of this issue can be divided into several steps:

  1. Refactor and implement the statelessness of the front-end interfaces. (I have created an issue #3346 and broken it down into multiple subtasks that can be advanced in parallel.)
  2. Implement the sharing of HTTP Session across AMS instances. (There is already a PR #3340 in progress for this project.)
  3. Refactor the AMS startup process to launch the Rest HTTP service before the leader election. (This step depends on the completion of the first two steps.)

baiyangtx avatar Nov 27 '24 11:11 baiyangtx