Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bootstrap-builtin-analytics-cluster-replica-size #671

Merged
merged 7 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
---
version: "3.9"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is deprecated and no longer needed in compose files

services:

materialized:
image: materialize/materialized:latest
container_name: materialized
command:
- '--cluster-replica-sizes={"3xsmall": {"workers": 1, "scale": 1, "credits_per_hour": "1"}, "2xsmall": {"workers": 1, "scale": 1, "credits_per_hour": "1"}, "25cc": {"workers": 1, "scale": 1, "credits_per_hour": "1"}, "50cc": {"workers": 1, "scale": 1, "credits_per_hour": "1"}}'
- '--cluster-replica-sizes={"3xsmall": {"workers": 1, "scale": 1, "credits_per_hour": "1", "is_cc": false}, "2xsmall": {"workers": 1, "scale": 1, "credits_per_hour": "1", "is_cc": false}, "25cc": {"workers": 1, "scale": 1, "credits_per_hour": "1"}, "50cc": {"workers": 1, "scale": 1, "credits_per_hour": "1"}}'
- --bootstrap-default-cluster-replica-size=3xsmall
- --bootstrap-builtin-system-cluster-replica-size=3xsmall
- --bootstrap-builtin-catalog-server-cluster-replica-size=3xsmall
- --bootstrap-builtin-support-cluster-replica-size=3xsmall
- --bootstrap-builtin-probe-cluster-replica-size=3xsmall
- --bootstrap-builtin-analytics-cluster-replica-size=3xsmall
- --availability-zone=test1
- --availability-zone=test2
- --aws-account-id=123456789000
Expand All @@ -34,12 +32,13 @@ services:
image: materialize/materialized:latest
container_name: materialized2
command:
- '--cluster-replica-sizes={"3xsmall": {"workers": 1, "scale": 1, "credits_per_hour": "1"}, "2xsmall": {"workers": 1, "scale": 1, "credits_per_hour": "1"}, "25cc": {"workers": 1, "scale": 1, "credits_per_hour": "1"}, "50cc": {"workers": 1, "scale": 1, "credits_per_hour": "1"}}'
- '--cluster-replica-sizes={"3xsmall": {"workers": 1, "scale": 1, "credits_per_hour": "1", "is_cc": false}, "2xsmall": {"workers": 1, "scale": 1, "credits_per_hour": "1", "is_cc": false}, "25cc": {"workers": 1, "scale": 1, "credits_per_hour": "1"}, "50cc": {"workers": 1, "scale": 1, "credits_per_hour": "1"}}'
- --bootstrap-default-cluster-replica-size=3xsmall
- --bootstrap-builtin-system-cluster-replica-size=3xsmall
- --bootstrap-builtin-catalog-server-cluster-replica-size=3xsmall
- --bootstrap-builtin-support-cluster-replica-size=3xsmall
- --bootstrap-builtin-probe-cluster-replica-size=3xsmall
- --bootstrap-builtin-analytics-cluster-replica-size=3xsmall
- --availability-zone=test1
- --availability-zone=test2
- --aws-account-id=123456789000
Expand Down
3 changes: 2 additions & 1 deletion pkg/materialize/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ func (b *ClusterBuilder) GenerateClusterOptions() string {
p = append(p, i)
}

if b.disk {
// Only add DISK to the quiery builder if it's enabled AND size doesn't end in either "cc" or "C"
if b.disk && !strings.HasSuffix(b.size, "cc") && !strings.HasSuffix(b.size, "C") {
Comment on lines -170 to +171
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was working fine in the past as the disk option was silently ignored in Materialize for cc and C clusters. However this no longer seems to be the case so we need to explicitly skip it in the query builder.

i := fmt.Sprintf(`DISK`)
p = append(p, i)
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/materialize/cluster_replica.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ func (b *ClusterReplicaBuilder) Create() error {
p = append(p, s)
}

if b.disk {
// Only add DISK to the quiery builder if it's enabled AND size doesn't end in either "cc" or "C"
if b.disk && !strings.HasSuffix(b.size, "cc") && !strings.HasSuffix(b.size, "C") {
i := " DISK"
p = append(p, i)
}
Expand Down
14 changes: 7 additions & 7 deletions pkg/provider/acceptance_datasource_network_policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ func TestAccDataSourceNetworkPolicies_basic(t *testing.T) {
Config: testAccDataSourceNetworkPolicies(policyName),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet("data.materialize_network_policy.test", "network_policies.#"),
resource.TestCheckResourceAttr("data.materialize_network_policy.test", "network_policies.0.name", policyName),
resource.TestCheckResourceAttr("data.materialize_network_policy.test", "network_policies.0.comment", "Network policy for office locations"),
resource.TestCheckResourceAttr("data.materialize_network_policy.test", "network_policies.0.rules.#", "2"),
resource.TestCheckResourceAttr("data.materialize_network_policy.test", "network_policies.0.rules.0.name", "new_york"),
resource.TestCheckResourceAttr("data.materialize_network_policy.test", "network_policies.0.rules.0.action", "allow"),
resource.TestCheckResourceAttr("data.materialize_network_policy.test", "network_policies.0.rules.0.direction", "ingress"),
resource.TestCheckResourceAttr("data.materialize_network_policy.test", "network_policies.0.rules.0.address", "1.2.3.4/28"),
resource.TestCheckResourceAttr("data.materialize_network_policy.test", "network_policies.1.name", policyName),
resource.TestCheckResourceAttr("data.materialize_network_policy.test", "network_policies.1.comment", "Network policy for office locations"),
resource.TestCheckResourceAttr("data.materialize_network_policy.test", "network_policies.1.rules.#", "2"),
resource.TestCheckResourceAttr("data.materialize_network_policy.test", "network_policies.1.rules.0.name", "new_york"),
resource.TestCheckResourceAttr("data.materialize_network_policy.test", "network_policies.1.rules.0.action", "allow"),
resource.TestCheckResourceAttr("data.materialize_network_policy.test", "network_policies.1.rules.0.direction", "ingress"),
resource.TestCheckResourceAttr("data.materialize_network_policy.test", "network_policies.1.rules.0.address", "1.2.3.4/28"),
),
},
},
Expand Down
Loading