Skip to content

Commit

Permalink
add rolling restart
Browse files Browse the repository at this point in the history
  • Loading branch information
catpineapple committed Nov 21, 2024
1 parent 6142868 commit 820c6a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions api/doris/v1/doriscluster_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ const (

FERestartAt string = "apache.doris.fe/restartedAt"
BERestartAt string = "apache.doris.be/restartedAt"
CNRestartAt string = "apache.doris.cn/restartedAt"
BrokerRestartAt string = "apache.doris.broker/restartedAt"
DorisRollingRestartAt string = "apache.doris.org/restartedAt"
)

Expand Down
6 changes: 3 additions & 3 deletions pkg/controller/sub_controller/sub_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,16 @@ func (d *SubDefaultController) ClassifyPodsByStatus(namespace string, status *do
}

var creatings, readys, faileds []string
var firstStartAnnotation string
var firstRestartAnnotation string
podmap := make(map[string]corev1.Pod)
if len(podList.Items) > 0 {
firstStartAnnotation = podList.Items[0].Annotations[dorisv1.DorisRollingRestartAt]
firstRestartAnnotation = podList.Items[0].Annotations[dorisv1.DorisRollingRestartAt]
}

//get all pod status that controlled by st.
stsRollingRestartAnnotationsSameCheck := true
for _, pod := range podList.Items {
stsRollingRestartAnnotationsSameCheck = stsRollingRestartAnnotationsSameCheck && pod.Annotations[dorisv1.DorisRollingRestartAt] == firstStartAnnotation
stsRollingRestartAnnotationsSameCheck = stsRollingRestartAnnotationsSameCheck && pod.Annotations[dorisv1.DorisRollingRestartAt] == firstRestartAnnotation
podmap[pod.Name] = pod
if ready := k8s.PodIsReady(&pod.Status); ready {
readys = append(readys, pod.Name)
Expand Down

0 comments on commit 820c6a8

Please sign in to comment.