HDDS-14351. Add preStop and graceful termination for OM and SCM#48
Open
shuan1026 wants to merge 1 commit into
Open
HDDS-14351. Add preStop and graceful termination for OM and SCM#48shuan1026 wants to merge 1 commit into
shuan1026 wants to merge 1 commit into
Conversation
…and SCM in helm charts (apache#48)
Contributor
Author
|
PTAL @adoroszlai @chungen0126 Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Follow-up to PR #20 discussion: add a preStop hook / longer graceful termination so OM/SCM do not stop while still holding Ratis leadership.
lifecycle.preStopon OM/SCM StatefulSets (replicas > 1): if this pod is leader, runozone admin om|scm transfer -rbefore shutdown.terminationGracePeriodSecondsfor HA OM/SCM (default path used 150s) so a slow transfer + short sleep still finishes before SIGKILL.kill -TERM 1as in the PR #20 discussion sample. kubelet sends SIGTERM to the container automatically once preStop returns, and the image's PID 1 (dumb-init) forwards it to the OM/SCM process, so an explicitkillwould just duplicate that and adds a dependency on the entrypoint's PID 1.om-leader-transfer-job(scale-down + persistence); this covers ordinary pod delete / roll / drain.publishNotReadyAddresses: trueon the OM/SCM headless Services. During termination a terminating endpoint always hasready: false, so by default it is dropped from the headless Service DNS (Kubernetes docs). The transferee then cannot resolve the outgoing leader's address to confirm the handoff, andtransfer -rblocks untilTIMED_OUT(60s). Publishing not-ready addresses keeps the terminating pod resolvable so the transfer completes quickly (see discussion).What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-14351
How was this patch tested?
om.replicas=3): over repeated leader pod-delete cycles, preStop transfers leadership and quorum consistently recovers to a single LEADER.scm.replicas=3): same repeated leader pod-delete cycles, with the same result.main(both OM and SCM): no preStop / default 30s grace; deleting the leader does not attempt transfer (failover is only Raft election after SIGTERM).Manually Test: