Skip to content

Commit f0821d2

Browse files
committed
fix: member leave fails
1 parent 2365aa5 commit f0821d2

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

addons/tidb/scripts/pd_memberleave.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ echo "$KB_LEAVE_MEMBER_POD_NAME"
66
res=$(/pd-ctl member delete name "$KB_LEAVE_MEMBER_POD_NAME")
77
echo "$res"
88
not_found_pattern="Failed to delete member.*not found"
9-
if [[ $res != "Success!" && ! $res =~ $not_found_pattern ]]; then
9+
# this redirect_not_leader_pattern is a workaround when scaling in multiple pd instances,
10+
# pd cluster may fail to create a new leader until the deleted members' pod is stopped.
11+
# See: https://github.com/apecloud/apecloud/issues/13893#issuecomment-3574029284
12+
# In the future, when scale in is implemented in instanceset controller, we can have a better
13+
# solution that does memberLeave one by one.
14+
redirect_not_leader_pattern="redirect to not leader"
15+
if [[ $res != "Success!" && ! $res =~ $not_found_pattern && ! $res =~ $redirect_not_leader_pattern ]]; then
1016
exit 1
1117
fi
18+
echo "member leave success"

addons/tidb/templates/cmpd-tidb.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ spec:
1111
description: tidb's SQL layer
1212
serviceKind: MySQL
1313
updateStrategy: BestEffortParallel
14+
podManagementPolicy: Parallel
1415
vars:
1516
- name: CLUSTER_NAMESPACE
1617
valueFrom:

addons/tidb/templates/cmpd-tikv.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ spec:
1010
provider: kubeblocks
1111
description: a distributed transactional key-value database
1212
updateStrategy: BestEffortParallel
13+
podManagementPolicy: Parallel
1314
vars:
1415
- name: CLUSTER_NAMESPACE
1516
valueFrom:

0 commit comments

Comments
 (0)