Skip to content

dbt-materialize: support unmanaged clusters in deploy_init#36625

Open
sjwiesman wants to merge 1 commit into
MaterializeInc:mainfrom
sjwiesman:dbt
Open

dbt-materialize: support unmanaged clusters in deploy_init#36625
sjwiesman wants to merge 1 commit into
MaterializeInc:mainfrom
sjwiesman:dbt

Conversation

@sjwiesman
Copy link
Copy Markdown
Contributor

The deploy_init macro previously hard-failed when the production cluster was unmanaged, blocking blue/green deployments for any Materialize user not on a managed cluster. Add a dispatch path that, for unmanaged origins, queries mz_cluster_replicas and emits CREATE CLUSTER ... REPLICAS (...) cloning each user-facing replica's SIZE and AVAILABILITY ZONE. Internal replicas are filtered via mz_internal_cluster_replicas. Replicas without a SIZE (orchestrated replicas using COMPUTECTL/STORAGECTL ADDRESSES) cannot be faithfully cloned and now produce a compiler error that names the offending replica.

The new create_unmanaged_cluster macro mirrors the structure of the existing create_cluster macro (pre-existence check, CI tag re-entry, DDL emission, CI tag set) so the managed path is untouched.

Remove these sections if your commit already has a good description!

Motivation

Why does this change exist? Link to a GitHub issue, design doc, Slack
thread, or explain the problem in a sentence or two. A reviewer who has
no context should understand why after reading this section.

If this implements or addresses an existing issue, it's enough to link to that:
Closes
Fixes
etc.

Description

What does this PR actually do? Focus on the approach and any non-obvious
decisions. The diff shows the code --- use this space to explain what the
diff can't tell a reviewer.

Verification

How do you know this change is correct? Describe new or existing automated
tests, or manual steps you took.

The deploy_init macro previously hard-failed when the production cluster
was unmanaged, blocking blue/green deployments for any Materialize user
not on a managed cluster. Add a dispatch path that, for unmanaged
origins, queries mz_cluster_replicas and emits CREATE CLUSTER ...
REPLICAS (...) cloning each user-facing replica's SIZE and AVAILABILITY
ZONE. Internal replicas are filtered via mz_internal_cluster_replicas.
Replicas without a SIZE (orchestrated replicas using
COMPUTECTL/STORAGECTL ADDRESSES) cannot be faithfully cloned and now
produce a compiler error that names the offending replica.

The new create_unmanaged_cluster macro mirrors the structure of the
existing create_cluster macro (pre-existence check, CI tag re-entry,
DDL emission, CI tag set) so the managed path is untouched.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@sjwiesman sjwiesman requested a review from a team as a code owner May 19, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant