Skip to content
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

[BugFix] Uninstalling StarRocks Cluster is stuck in k8s (backport #47541) #47898

Merged
merged 1 commit into from
Jul 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions docker/dockerfiles/be/cn_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ drop_my_self()
local start=`date +%s`
local memlist=

while true
# If we infinitely retry to drop myself, it may cause the pod to be stuck in the Terminating state.
for ((i=0;i<3;++i))
do
log_stderr "try to drop myself($MY_SELF) from FE ..."
memlist=`show_compute_nodes $svc`
Expand All @@ -112,11 +113,12 @@ drop_my_self()
# return code 0: no error
selfinfo=`echo "$memlist" | grep -w "\<$MY_SELF\>" | awk '{printf("%s:%s\n", $2, $3);}'`
if [[ "x$selfinfo" == "x" ]] ; then
log_stderr "myself $selfinfo is not in fe cluster"
log_stderr "myself is not in fe cluster"
return 0
else
log_stderr "drop my self $selfinfo ..."
timeout 15 mysql --connect-timeout 2 -h $svc -P $FE_QUERY_PORT -u root --skip-column-names --batch -e "ALTER SYSTEM DROP COMPUTE NODE \"$selfinfo\";"
break;
fi
else
log_stderr "Got error $ret, sleep and retry ..."
Expand Down
Loading