You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fc.K8srecorder.Event(cluster, string(sc.EventWarning), string(sc.FESpecSetError), "The number of fe ElectionNumber is large than Replicas, Replicas has been corrected to the correct minimum value")
51
-
klog.Errorf("prepareStatefulsetApply namespace=%s,name=%s ,The number of fe ElectionNumber(%d) is large than Replicas(%d)", cluster.Namespace, cluster.Name, ele, *(cluster.Spec.FeSpec.Replicas))
52
-
cluster.Spec.FeSpec.Replicas=&ele
53
-
}
47
+
fc.safeScaleDown(cluster, &oldSt)
54
48
55
49
// wroa means: oldReplicas - newReplicas, the opposite of removedAmount, willRemovedOppositeAmount shortly as wroa
//if scale down observers,(replicas > election number), be allowed.
83
+
ifnr>=ele {
84
+
return
85
+
}
86
+
87
+
ifor>=ele {
88
+
// if the scale down nodes have observer and follower roles, scale down observers.
89
+
*cluster.Spec.FeSpec.Replicas=ele
90
+
fc.K8srecorder.Event(cluster,string(sc.EventWarning), sc.FollowerScaleDownFailed,"Replicas is not allowed less than ElectionNumber, because of the bdbje (like raft) consistency protocol, if want do that please set ElectionNumber less than replicas. like that \"spec:{feSpec:{electionNumber}}\"")
91
+
} else {
92
+
//if the scale down nodes only have followers, not be allowed.
93
+
*cluster.Spec.FeSpec.Replicas=or
94
+
fc.K8srecorder.Event(cluster,string(sc.EventWarning), sc.FollowerScaleDownFailed,"Replicas less than electionNumber, so not allowed scale down. This is because the bdbje(like raft) consistency protocol, if want do that please set ElectionNumber less than replicas. like that \"spec:{feSpec:{electionNumber}}\"")
95
+
}
96
+
97
+
return
98
+
}
79
99
// dropObserverBySqlClient handles doris'SQL(drop frontend) through the MySQL client when dealing with scale in observer
0 commit comments