Skip to content

Commit

Permalink
Merge pull request #238 from catpineapple/disaggregated_be_scale_down
Browse files Browse the repository at this point in the history
be scale down and resource clear
  • Loading branch information
intelligentfu8 authored Sep 4, 2024
2 parents 03247fa + 7d666e8 commit e74cf04
Show file tree
Hide file tree
Showing 17 changed files with 4,538 additions and 391 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# under the License.

# Build the manager binary
FROM golang:1.21.12 as builder
FROM golang:1.21.12 AS builder
ARG TARGETOS
ARG TARGETARCH

Expand Down
16 changes: 13 additions & 3 deletions api/disaggregated/cluster/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ type ComputeCluster struct {
//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.
Name string `json:"name,omitempty"`

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

CommonSpec `json:",inline"`
Expand Down Expand Up @@ -294,8 +294,14 @@ const (
//Failed represents service failed to start, can't be accessed.
Failed Phase = "Failed"
//Creating represents service in creating stage.
Reconciling Phase = "Reconciling"
ReconclingDropFailed Phase = "ReconclingDropFailed"
Reconciling Phase = "Reconciling"

//Scaling represents service in Scaling.
Scaling Phase = "Scaling"
ScaleDownFailed Phase = "ScaleDownFailed"
ResumeFailed Phase = "ResumeFailed"
SuspendFailed Phase = "SuspendFailed"
Suspended Phase = "Suspended"
)

type AvailableStatus string
Expand All @@ -308,6 +314,8 @@ const (
UnAvailable AvailableStatus = "UnAvailable"
)

// AvailableStatus StatefulsetName ServiceName

type ComputeClusterStatus struct {
//Phase represent the stage of reconciling.
Phase Phase `json:"phase,omitempty"`
Expand All @@ -321,6 +329,8 @@ type ComputeClusterStatus struct {
AvailableStatus AvailableStatus `json:"availableStatus,omitempty"`
//ClusterId display the clusterId of compute cluster in meta.
ClusterId string `json:"clusterId,omitempty"`
//suspend replicas display the replicas of compute cluster before resume.
SuspendReplicas int32 `json:"suspendReplicas,omitempty"`

// replicas is the number of Pods created by the StatefulSet controller.
Replicas int32 `json:"replicas,omitempty"`
Expand Down
1 change: 1 addition & 0 deletions api/disaggregated/cluster/v1/unique_id.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func (ddc *DorisDisaggregatedCluster) GetInstanceId() string {
// need config in vaultConfigMap.
return ""
}

func (ddc *DorisDisaggregatedCluster) GetCCId(cc *ComputeCluster) string {
if cc == nil || ddc == nil {
return ""
Expand Down
4 changes: 4 additions & 0 deletions api/disaggregated/cluster/v1/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@ var (
DisaggregatedBE DisaggregatedComponentType = "BE"
DisaggregatedMS DisaggregatedComponentType = "MS"
)

const (
DefaultMetaserviceNumber int32 = 2
)
81 changes: 65 additions & 16 deletions api/disaggregated/cluster/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e74cf04

Please sign in to comment.