zhangwl9 opened a new pull request, #3795:
URL: https://github.com/apache/amoro/pull/3795
<!--
Thanks for sending a pull request!
Here are some tips for you:
1. If this is your first time, please read our contributor guidelines:
https://amoro.apache.org/how-to-contribute/
2. If the PR is related to an issue in
https://github.com/apache/amoro/issues, add '[AMORO-XXXX]' in your PR title,
e.g., '[AMORO-XXXX] Your PR title ...'.
3. If the PR is unfinished, add '[WIP]' in your PR title, e.g.,
'[WIP][AMORO-XXXX] Your PR title ...'.
-->
## Why are the changes needed?
<!--
Please clarify why the changes are needed. For instance,
1. If you add a feature, you can talk about its use case.
2. If you fix a bug, you can clarify why it is a bug.
3. Use Fix/Resolve/Close #{ISSUE_NUMBER} to link this PR to its related
issue
-->
Close #3752.
## Brief change log
<!--
Clearly describe the changes made in modules, classes, methods, etc.
-->
When enables HA, the new primary node creates a ZooKeeper path named
`disposeCompletePath`. During a primary-standby node switchover, the old
primary node deletes this path after releasing the AMS service, thereby
notifying the new primary node that it can start the AMS service.
1、Detect previous primary node information:
- Check the current primary node information stored in ZooKeeper
- Determine if it matches the current node information
- If it is the same node (e.g., during restart), no waiting is required
- If it is a different node, wait for the previous primary node to complete
resource release
2、Wait for previous primary node release completion:
- Create a special ZooKeeper path `disposeCompletePath` for signal
notification
- Wait up to 30 seconds until the previous primary node deletes this path
- If no signal is received after the timeout, proceed with master node
operations (to prevent system blocking due to unresponsive previous nodes)
3、Send completion signal upon resource release:
- Within the `signalDisposeComplete()` method, the master node deletes the
`disposeCompletePath` path upon shutdown
- This allows the new master node to detect that the previous master node
has completed resource release
## 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
- [x] 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)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]