-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Allow cluster to start after power off when ETCD_DISABLE_PRESTOP is set #38514
Conversation
We are going to review this logic internally as we want to further investigate the behaviour of the field that you propose to modify with a variable. We will notify you in this PR when there is any news. |
This Pull Request has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thank you for your contribution. |
@mdhont any updates here? |
@@ -664,6 +664,13 @@ etcd_initialize() { | |||
if is_boolean_yes "$ETCD_DISABLE_PRESTOP"; then | |||
info "The member will try to join the cluster by it's own" | |||
export ETCD_INITIAL_CLUSTER_STATE=existing | |||
# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you change the comment:
# If ETCD_DISABLE_PRESTOP is set, we won't dynamically adjust membership. In this case
# we'll return and allow etcd to start and join the statically configured cluster.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you bet -- changing..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mdhont any additional changes we need here?
Signed-off-by: Brad Klein <bklein@cray.com>
This Pull Request has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thank you for your contribution. |
bitnami/etcd/3.5/debian-11/rootfs/opt/bitnami/scripts/libetcd.sh
Outdated
Show resolved
Hide resolved
Signed-off-by: Brad Klein <bklein@cray.com>
@@ -664,6 +664,8 @@ etcd_initialize() { | |||
if is_boolean_yes "$ETCD_DISABLE_PRESTOP"; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is a misunderstanding on where the code needs to be placed. I meant this:
if is_boolean_yes "$ETCD_DISABLE_PRESTOP"; then | |
if is_boolean_yes "$ETCD_DISABLE_PRESTOP"; then | |
info "The member will try to join the cluster by it's own" | |
export ETCD_INITIAL_CLUSTER_STATE=existing | |
elif ! is_healthy_etcd_cluster; then | |
warn "Cluster not responding!" | |
if is_boolean_yes "$ETCD_DISASTER_RECOVERY"; then | |
latest_snapshot_file="$(find /snapshots/ -maxdepth 1 -type f -name 'db-*' | sort | tail -n 1)" |
So removing this duplicate code:
elif ! is_healthy_etcd_cluster; then
warn "Cluster not responding!"
fi
member_id="$(get_member_id)"
if ! is_healthy_etcd_cluster; then
warn "Cluster not responding!"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sincere apologies for the churn :(. I've pushed another commit after testing with your suggested change, worked great! let me know if this looks ok now?
@@ -666,10 +666,6 @@ etcd_initialize() { | |||
export ETCD_INITIAL_CLUSTER_STATE=existing | |||
elif ! is_healthy_etcd_cluster; then | |||
warn "Cluster not responding!" | |||
fi | |||
member_id="$(get_member_id)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't remove this. Instead, you can add it below line 663:
if [[ ${#initial_members[@]} -gt 1 ]]; then
member_id="$(get_member_id)"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it, added back
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm! Thanks for your contribution.
Signed-off-by: Brad Klein <bklein@cray.com>
Signed-off-by: Brad Klein <bklein@cray.com>
Description of the change
When etcd is configured with a static member list (ETCD_DISABLE_PRESTOP set), simply scaling the cluster to zero then back up, or powering off/on the cluster, all pods start in CLBO. This change exits the setup code in this case and lets etcd attempt to join the cluster once other members start.
Benefits
Better resiliency.
Possible drawbacks
Can't think of any.
Applicable issues
N/A
Additional information
Tested scaling down and up, forcing loss of quorum: