Skip to content

mz-deploy: staging cluster-name quoting and external-index collision (DEX-61, DEX-39) - #37368

Open
sjwiesman wants to merge 2 commits into
MaterializeInc:mainfrom
sjwiesman:seth/dex-61-staging-cluster-name-and-external-index
Open

mz-deploy: staging cluster-name quoting and external-index collision (DEX-61, DEX-39)#37368
sjwiesman wants to merge 2 commits into
MaterializeInc:mainfrom
sjwiesman:seth/dex-61-staging-cluster-name-and-external-index

Conversation

@sjwiesman

@sjwiesman sjwiesman commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

When an incremental stage recreates an index belonging to an unchanged
object onto a staged cluster, the index kept its production name and
target. Materialize derives a named index's schema from its target
relation, so the recreated index landed in the production schema and
collided with the existing index of the same name, failing the stage.
Suffix the index's own name so it no longer collides; the optimizer
matches indexes by cluster and structure, not name.

Ticket: DEX-39

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

Both the external-index and deployed-index staging rewrites composed the
suffixed cluster name with format!("{}{}", ident, suffix), which uses
the identifier's quoted Display form. A cluster whose name is not bare
(e.g. prod-cluster) became "prod-cluster"_staging, with the quotes
embedded in the name, so the staged IN CLUSTER pointed at a cluster
that was never created. Compose with the raw as_str() value instead.

Ticket: DEX-61

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

🤖 Generated with Claude Code

https://claude.ai/code/session_01VAcnVpSQi8ZgF5LekQRwvw

sjwiesman and others added 2 commits June 30, 2026 12:41
Both the external-index and deployed-index staging rewrites composed the
suffixed cluster name with `format!("{}{}", ident, suffix)`, which uses
the identifier's quoted `Display` form. A cluster whose name is not bare
(e.g. `prod-cluster`) became `"prod-cluster"_staging`, with the quotes
embedded in the name, so the staged `IN CLUSTER` pointed at a cluster
that was never created. Compose with the raw `as_str()` value instead.

Ticket: DEX-61

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
When an incremental stage recreates an index belonging to an unchanged
object onto a staged cluster, the index kept its production name and
target. Materialize derives a named index's schema from its target
relation, so the recreated index landed in the production schema and
collided with the existing index of the same name, failing the stage.
Suffix the index's own name so it no longer collides; the optimizer
matches indexes by cluster and structure, not name.

Ticket: DEX-39

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sjwiesman
sjwiesman marked this pull request as ready for review July 1, 2026 14:19
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