Skip to content

Commit dba9f12

Browse files
committed
Set replication factor to 0 for mz_probe and mz_system by default in self managed
1 parent da774ee commit dba9f12

File tree

6 files changed

+20
-10
lines changed

6 files changed

+20
-10
lines changed

misc/helm-charts/operator/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ The following table lists the configurable parameters of the Materialize operato
125125
| `operator.cloudProvider.providers.gcp` | GCP Configuration (placeholder for future use) | ``{"enabled":false}`` |
126126
| `operator.cloudProvider.region` | Common cloud provider settings | ``"kind"`` |
127127
| `operator.cloudProvider.type` | Specifies cloud provider. Valid values are 'aws', 'gcp', 'azure' , 'generic', or 'local' | ``"local"`` |
128+
| `operator.clusters.defaultReplicationFactor.probe` | | ``0`` |
129+
| `operator.clusters.defaultReplicationFactor.system` | | ``0`` |
128130
| `operator.clusters.defaultSizes.analytics` | | ``"25cc"`` |
129131
| `operator.clusters.defaultSizes.catalogServer` | | ``"50cc"`` |
130132
| `operator.clusters.defaultSizes.default` | | ``"25cc"`` |

misc/helm-charts/operator/templates/deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ spec:
103103
{{ if .Values.operator.clusters.defaultSizes.analytics }}
104104
- "--bootstrap-builtin-analytics-cluster-replica-size={{ .Values.operator.clusters.defaultSizes.analytics }}"
105105
{{- end }}
106+
{{ if .Values.operator.clusters.defaultReplicationFactor.system }}
107+
- "--bootstrap-builtin-system-cluster-replication-factor={{ .Values.operator.clusters.defaultReplicationFactor.system }}"
108+
{{- end }}
109+
{{ if .Values.operator.clusters.defaultReplicationFactor.probe }}
110+
- "--bootstrap-builtin-probe-cluster-replication-factor={{ .Values.operator.clusters.defaultReplicationFactor.probe }}"
111+
{{- end }}
106112
{{- end }}
107113
- "--image-pull-policy={{ kebabcase .Values.operator.image.pullPolicy }}"
108114
{{- range $key, $value := .Values.environmentd.nodeSelector }}

misc/helm-charts/operator/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ operator:
175175
support: 25cc
176176
catalogServer: 50cc
177177
analytics: 25cc
178+
defaultReplicationFactor:
179+
system: 0
180+
probe: 0
178181

179182
# Node selector to use for the operator pod
180183
nodeSelector: {}

src/environmentd/tests/bootstrap_builtin_clusters.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@ fn test_zero_replication_factor_no_replicas() {
2222
let system_cluster = client
2323
.query_one(
2424
r#"
25-
SELECT c.id, c.name, c.replication_factor::integer, COUNT(cr.id)::integer as replica_count
25+
SELECT c.id, c.name, c.replication_factor::integer, COUNT(cr.id)::integer as replica_count
2626
FROM mz_clusters c
2727
LEFT JOIN mz_cluster_replicas cr ON c.id = cr.cluster_id
2828
WHERE c.name = 'mz_system'
29-
GROUP BY c.id, c.name, c.replication_factor
30-
"#,
29+
GROUP BY c.id, c.name, c.replication_factor"#,
3130
&[],
3231
)
3332
.unwrap();

src/orchestratord/src/controller/materialize.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ pub struct MaterializeControllerArgs {
105105
#[clap(long)]
106106
bootstrap_builtin_support_cluster_replica_size: Option<String>,
107107
#[clap(long)]
108-
bootstrap_builtin_catalog_server_cluster_replica_size: Option<String>,
108+
bootstrap_builtin_system_cluster_replication_factor: Option<u32>,
109109
#[clap(long)]
110-
bootstrap_builtin_analytics_cluster_replica_size: Option<String>,
110+
bootstrap_builtin_probe_cluster_replication_factor: Option<u32>,
111111

112112
#[clap(
113113
long,

src/orchestratord/src/controller/materialize/environmentd.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -831,15 +831,15 @@ fn create_environmentd_statefulset_object(
831831
.as_ref()
832832
.map(|size| format!("--bootstrap-builtin-support-cluster-replica-size={size}")),
833833
config
834-
.bootstrap_builtin_catalog_server_cluster_replica_size
834+
.bootstrap_builtin_system_cluster_replication_factor
835835
.as_ref()
836-
.map(|size| {
837-
format!("--bootstrap-builtin-catalog-server-cluster-replica-size={size}")
836+
.map(|replication_factor| {
837+
format!("--bootstrap-builtin-system-cluster-replication-factor={replication_factor}")
838838
}),
839839
config
840-
.bootstrap_builtin_analytics_cluster_replica_size
840+
.bootstrap_builtin_probe_cluster_replication_factor
841841
.as_ref()
842-
.map(|size| format!("--bootstrap-builtin-analytics-cluster-replica-size={size}")),
842+
.map(|replication_factor| format!("--bootstrap-builtin-probe-cluster-replication-factor={replication_factor}")),
843843
]
844844
.into_iter()
845845
.flatten(),

0 commit comments

Comments
 (0)