diff --git a/api/v1alpha1/hyperbytedbcluster_types.go b/api/v1alpha1/hyperbytedbcluster_types.go index 135844f..7faa463 100644 --- a/api/v1alpha1/hyperbytedbcluster_types.go +++ b/api/v1alpha1/hyperbytedbcluster_types.go @@ -195,12 +195,6 @@ type FlushSpec struct { // +kubebuilder:default=10 IntervalSecs int32 `json:"intervalSecs,omitempty"` - // +kubebuilder:default=64 - WALSizeThresholdMB int32 `json:"walSizeThresholdMb,omitempty"` - - // +kubebuilder:default="1h" - TimeBucketDuration string `json:"timeBucketDuration,omitempty"` - // Max points per chDB insert batch (clamped server-side to 10k–500k). // +kubebuilder:default=50000 // +optional diff --git a/api/v1alpha1/hyperbytedbcluster_webhook.go b/api/v1alpha1/hyperbytedbcluster_webhook.go index 267b086..a3769ce 100644 --- a/api/v1alpha1/hyperbytedbcluster_webhook.go +++ b/api/v1alpha1/hyperbytedbcluster_webhook.go @@ -68,10 +68,6 @@ func (w *HyperbytedbClusterWebhook) Default(_ context.Context, obj *HyperbytedbC } } - if obj.Spec.Flush.TimeBucketDuration == "" { - obj.Spec.Flush.TimeBucketDuration = "1h" - } - if obj.Spec.ChDB.PoolSize == 0 { obj.Spec.ChDB.PoolSize = 1 } diff --git a/config/crd/bases/hyperbytedb.hyperbyte.cloud_hyperbytedbclusters.yaml b/config/crd/bases/hyperbytedb.hyperbyte.cloud_hyperbytedbclusters.yaml index fa7ae24..007e56c 100644 --- a/config/crd/bases/hyperbytedb.hyperbyte.cloud_hyperbytedbclusters.yaml +++ b/config/crd/bases/hyperbytedb.hyperbyte.cloud_hyperbytedbclusters.yaml @@ -3172,9 +3172,6 @@ spec: format: int32 minimum: 0 type: integer - timeBucketDuration: - default: 1h - type: string walBatchDelayUs: description: 'WAL group-commit: max microseconds to wait for more entries before flushing.' @@ -3187,10 +3184,6 @@ spec: format: int32 minimum: 0 type: integer - walSizeThresholdMb: - default: 64 - format: int32 - type: integer type: object hintedHandoff: description: |- diff --git a/config/samples/hyperbytedb_v1alpha1_hyperbytedbcluster_cluster.yaml b/config/samples/hyperbytedb_v1alpha1_hyperbytedbcluster_cluster.yaml index b99186e..caa05b1 100644 --- a/config/samples/hyperbytedb_v1alpha1_hyperbytedbcluster_cluster.yaml +++ b/config/samples/hyperbytedb_v1alpha1_hyperbytedbcluster_cluster.yaml @@ -17,8 +17,6 @@ spec: size: 10Gi flush: intervalSecs: 10 - walSizeThresholdMb: 64 - timeBucketDuration: "1h" maxPointsPerBatch: 50000 chdb: sessionDataPath: /var/lib/hyperbytedb/chdb diff --git a/config/samples/hyperbytedb_v1alpha1_hyperbytedbcluster_ha.yaml b/config/samples/hyperbytedb_v1alpha1_hyperbytedbcluster_ha.yaml index 02a5dc8..fae4725 100644 --- a/config/samples/hyperbytedb_v1alpha1_hyperbytedbcluster_ha.yaml +++ b/config/samples/hyperbytedb_v1alpha1_hyperbytedbcluster_ha.yaml @@ -17,8 +17,6 @@ spec: storageClassName: fast-ssd flush: intervalSecs: 5 - walSizeThresholdMb: 128 - timeBucketDuration: "1h" chdb: sessionDataPath: /var/lib/hyperbytedb/chdb auth: diff --git a/dist/chart/templates/crd/hyperbytedbclusters.hyperbytedb.hyperbyte.cloud.yaml b/dist/chart/templates/crd/hyperbytedbclusters.hyperbytedb.hyperbyte.cloud.yaml index 61905e4..007e56c 100644 --- a/dist/chart/templates/crd/hyperbytedbclusters.hyperbytedb.hyperbyte.cloud.yaml +++ b/dist/chart/templates/crd/hyperbytedbclusters.hyperbytedb.hyperbyte.cloud.yaml @@ -1,11 +1,8 @@ -{{- if .Values.crd.enable }} +--- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - {{- if .Values.crd.keep }} - "helm.sh/resource-policy": keep - {{- end }} controller-gen.kubebuilder.io/version: v0.20.1 name: hyperbytedbclusters.hyperbytedb.hyperbyte.cloud spec: @@ -2980,20 +2977,39 @@ spec: chdb: properties: poolSize: - default: 1 description: |- - Ignored by hyperbytedb (libchdb is a process-global singleton). Retained - for API stability; always written as 1 in config.toml. + Sets both query and write pool sizes when QueryPoolSize and WritePoolSize + are unset. Defaults to 1 when all pool fields are unset. + format: int32 + minimum: 1 + type: integer + queryPoolSize: + description: chDB connections reserved for queries. Isolated from + ingest/flush. format: int32 + minimum: 1 type: integer sessionDataPath: description: |- chDB session directory inside the data volume. Defaults to /var/lib/hyperbytedb/chdb when unset. type: string + writePoolSize: + description: chDB connections reserved for ingest and flush (Arrow + WAL build, INSERTs). + format: int32 + minimum: 1 + type: integer type: object cluster: properties: + drainWaitSecs: + default: 10 + description: |- + Seconds to wait after excluding a backend from the proxy before + deleting its pod. Gives in-flight requests time to drain. + format: int32 + type: integer heartbeatIntervalSecs: default: 2 format: int32 @@ -3007,7 +3023,7 @@ spec: format: int32 type: integer raftHeartbeatIntervalMs: - default: 300 + default: 1000 format: int32 type: integer raftSnapshotThreshold: @@ -3156,9 +3172,6 @@ spec: format: int32 minimum: 0 type: integer - timeBucketDuration: - default: 1h - type: string walBatchDelayUs: description: 'WAL group-commit: max microseconds to wait for more entries before flushing.' @@ -3171,10 +3184,6 @@ spec: format: int32 minimum: 0 type: integer - walSizeThresholdMb: - default: 64 - format: int32 - type: integer type: object hintedHandoff: description: |- @@ -3980,6 +3989,41 @@ spec: description: 'Replication convergence state: Healthy, Lagging, Diverged, Unknown.' type: string + rollingRestart: + description: |- + Tracks pod-by-pod proxy exclusion during rolling upgrades. + Nil when no rolling restart is in progress. + properties: + currentOrdinal: + description: Ordinal of the pod currently being restarted. + format: int32 + type: integer + excludeConfirmed: + description: True once the proxy confirms the backend is excluded. + type: boolean + oldPodIP: + description: IP of the pod being excluded (set during Excluding + phase). + type: string + phase: + description: Current phase of the restart state machine. + type: string + phaseStartedAt: + description: When the current phase started (used to compute drain + wait). + format: date-time + type: string + totalOrdinals: + description: Total number of pod ordinals to cycle through. + format: int32 + type: integer + required: + - currentOrdinal + - excludeConfirmed + - phase + - phaseStartedAt + - totalOrdinals + type: object type: object required: - spec @@ -3988,4 +4032,3 @@ spec: storage: true subresources: status: {} -{{- end }} diff --git a/dist/install.yaml b/dist/install.yaml index 8abbd19..472fb06 100644 --- a/dist/install.yaml +++ b/dist/install.yaml @@ -3180,20 +3180,39 @@ spec: chdb: properties: poolSize: - default: 1 description: |- - Ignored by hyperbytedb (libchdb is a process-global singleton). Retained - for API stability; always written as 1 in config.toml. + Sets both query and write pool sizes when QueryPoolSize and WritePoolSize + are unset. Defaults to 1 when all pool fields are unset. + format: int32 + minimum: 1 + type: integer + queryPoolSize: + description: chDB connections reserved for queries. Isolated from + ingest/flush. format: int32 + minimum: 1 type: integer sessionDataPath: description: |- chDB session directory inside the data volume. Defaults to /var/lib/hyperbytedb/chdb when unset. type: string + writePoolSize: + description: chDB connections reserved for ingest and flush (Arrow + WAL build, INSERTs). + format: int32 + minimum: 1 + type: integer type: object cluster: properties: + drainWaitSecs: + default: 10 + description: |- + Seconds to wait after excluding a backend from the proxy before + deleting its pod. Gives in-flight requests time to drain. + format: int32 + type: integer heartbeatIntervalSecs: default: 2 format: int32 @@ -3207,7 +3226,7 @@ spec: format: int32 type: integer raftHeartbeatIntervalMs: - default: 300 + default: 1000 format: int32 type: integer raftSnapshotThreshold: @@ -3356,9 +3375,6 @@ spec: format: int32 minimum: 0 type: integer - timeBucketDuration: - default: 1h - type: string walBatchDelayUs: description: 'WAL group-commit: max microseconds to wait for more entries before flushing.' @@ -3371,10 +3387,6 @@ spec: format: int32 minimum: 0 type: integer - walSizeThresholdMb: - default: 64 - format: int32 - type: integer type: object hintedHandoff: description: |- @@ -4180,6 +4192,41 @@ spec: description: 'Replication convergence state: Healthy, Lagging, Diverged, Unknown.' type: string + rollingRestart: + description: |- + Tracks pod-by-pod proxy exclusion during rolling upgrades. + Nil when no rolling restart is in progress. + properties: + currentOrdinal: + description: Ordinal of the pod currently being restarted. + format: int32 + type: integer + excludeConfirmed: + description: True once the proxy confirms the backend is excluded. + type: boolean + oldPodIP: + description: IP of the pod being excluded (set during Excluding + phase). + type: string + phase: + description: Current phase of the restart state machine. + type: string + phaseStartedAt: + description: When the current phase started (used to compute drain + wait). + format: date-time + type: string + totalOrdinals: + description: Total number of pod ordinals to cycle through. + format: int32 + type: integer + required: + - currentOrdinal + - excludeConfirmed + - phase + - phaseStartedAt + - totalOrdinals + type: object type: object required: - spec diff --git a/internal/hyperbytedb/configmap.go b/internal/hyperbytedb/configmap.go index f076a15..8029ab5 100644 --- a/internal/hyperbytedb/configmap.go +++ b/internal/hyperbytedb/configmap.go @@ -126,16 +126,6 @@ func writeFlushSection(b *strings.Builder, spec *v1alpha1.HyperbytedbClusterSpec intervalSecs = spec.Flush.IntervalSecs } fmt.Fprintf(b, "interval_secs = %d\n", intervalSecs) - walThreshold := int32(64) - if spec.Flush.WALSizeThresholdMB > 0 { - walThreshold = spec.Flush.WALSizeThresholdMB - } - fmt.Fprintf(b, "wal_size_threshold_mb = %d\n", walThreshold) - timeBucket := "1h" - if spec.Flush.TimeBucketDuration != "" { - timeBucket = spec.Flush.TimeBucketDuration - } - fmt.Fprintf(b, "time_bucket_duration = \"%s\"\n", timeBucket) maxPointsPerBatch := int32(50000) if spec.Flush.MaxPointsPerBatch > 0 { maxPointsPerBatch = spec.Flush.MaxPointsPerBatch