Skip to content

Commit e74cf04

Browse files
Merge pull request #238 from catpineapple/disaggregated_be_scale_down
be scale down and resource clear
2 parents 03247fa + 7d666e8 commit e74cf04

File tree

17 files changed

+4538
-391
lines changed

17 files changed

+4538
-391
lines changed

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# under the License.
1717

1818
# Build the manager binary
19-
FROM golang:1.21.12 as builder
19+
FROM golang:1.21.12 AS builder
2020
ARG TARGETOS
2121
ARG TARGETARCH
2222

api/disaggregated/cluster/v1/types.go

+13-3
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ type ComputeCluster struct {
6464
//Name is the identifier of computeCluster, name can be used specify what computeCluster to run sql. if not set, will use `computeCluster` and the index in array to set.ep: computeCluster-1.
6565
Name string `json:"name,omitempty"`
6666

67-
//ClusterId is the identifier of computeCluster, this will distinguish all com puteCluster in meta.
67+
//ClusterId is the identifier of computeCluster, this will distinguish all computeCluster in meta.
6868
ClusterId string `json:"clusterId,omitempty"`
6969

7070
CommonSpec `json:",inline"`
@@ -294,8 +294,14 @@ const (
294294
//Failed represents service failed to start, can't be accessed.
295295
Failed Phase = "Failed"
296296
//Creating represents service in creating stage.
297-
Reconciling Phase = "Reconciling"
298-
ReconclingDropFailed Phase = "ReconclingDropFailed"
297+
Reconciling Phase = "Reconciling"
298+
299+
//Scaling represents service in Scaling.
300+
Scaling Phase = "Scaling"
301+
ScaleDownFailed Phase = "ScaleDownFailed"
302+
ResumeFailed Phase = "ResumeFailed"
303+
SuspendFailed Phase = "SuspendFailed"
304+
Suspended Phase = "Suspended"
299305
)
300306

301307
type AvailableStatus string
@@ -308,6 +314,8 @@ const (
308314
UnAvailable AvailableStatus = "UnAvailable"
309315
)
310316

317+
// AvailableStatus StatefulsetName ServiceName
318+
311319
type ComputeClusterStatus struct {
312320
//Phase represent the stage of reconciling.
313321
Phase Phase `json:"phase,omitempty"`
@@ -321,6 +329,8 @@ type ComputeClusterStatus struct {
321329
AvailableStatus AvailableStatus `json:"availableStatus,omitempty"`
322330
//ClusterId display the clusterId of compute cluster in meta.
323331
ClusterId string `json:"clusterId,omitempty"`
332+
//suspend replicas display the replicas of compute cluster before resume.
333+
SuspendReplicas int32 `json:"suspendReplicas,omitempty"`
324334

325335
// replicas is the number of Pods created by the StatefulSet controller.
326336
Replicas int32 `json:"replicas,omitempty"`

api/disaggregated/cluster/v1/unique_id.go

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ func (ddc *DorisDisaggregatedCluster) GetInstanceId() string {
6464
// need config in vaultConfigMap.
6565
return ""
6666
}
67+
6768
func (ddc *DorisDisaggregatedCluster) GetCCId(cc *ComputeCluster) string {
6869
if cc == nil || ddc == nil {
6970
return ""

api/disaggregated/cluster/v1/utils.go

+4
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,7 @@ var (
3737
DisaggregatedBE DisaggregatedComponentType = "BE"
3838
DisaggregatedMS DisaggregatedComponentType = "MS"
3939
)
40+
41+
const (
42+
DefaultMetaserviceNumber int32 = 2
43+
)

api/disaggregated/cluster/v1/zz_generated.deepcopy.go

+65-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)