mz-deploy: staging cluster-name quoting and external-index collision (DEX-61, DEX-39) - #37368
Open
sjwiesman wants to merge 2 commits into
Open
Conversation
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
marked this pull request as ready for review
July 1, 2026 14:19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 usesthe identifier's quoted
Displayform. A cluster whose name is not bare(e.g.
prod-cluster) became"prod-cluster"_staging, with the quotesembedded in the name, so the staged
IN CLUSTERpointed at a clusterthat 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