Skip to content

sql: Reject non-MANUAL SCHEDULE on a cluster with REPLICATION FACTOR > 1#37068

Merged
ggevay merged 1 commit into
MaterializeInc:mainfrom
ggevay:reject-refresh-schedule-high-replication-factor
Jun 16, 2026
Merged

sql: Reject non-MANUAL SCHEDULE on a cluster with REPLICATION FACTOR > 1#37068
ggevay merged 1 commit into
MaterializeInc:mainfrom
ggevay:reject-refresh-schedule-high-replication-factor

Conversation

@ggevay

@ggevay ggevay commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Fixes SQL-215

A cluster with a refresh schedule is turned on/off by the cluster scheduling policy, so its replication factor is always 0 or 1. But ALTER CLUSTER ... SET (SCHEDULE = ON REFRESH) on a cluster that already had a higher replication factor left it in an invalid state, which made SHOW CREATE CLUSTER panic the coordinator.

Reject such an ALTER at plan time, pointing the user to lower the replication factor first. As defense in depth, downgrade the assertion in unplan_create_cluster to a soft assert so a cluster that somehow ends up in this state can no longer crash the coordinator.

A cluster with a refresh schedule is turned on/off by the cluster
scheduling policy, so its replication factor is always 0 or 1. But
`ALTER CLUSTER ... SET (SCHEDULE = ON REFRESH)` on a cluster that already
had a higher replication factor left it in an invalid state, which made
`SHOW CREATE CLUSTER` panic the coordinator.

Reject such an ALTER at plan time, pointing the user to lower the
replication factor first. As defense in depth, downgrade the assertion in
`unplan_create_cluster` to a soft assert so a cluster that somehow ends up
in this state can no longer crash the coordinator.

Adds a regression test to test/sqllogictest/materialized_views.slt.

SQL-215

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ggevay ggevay requested review from a team and sjwiesman as code owners June 16, 2026 11:26
@ggevay ggevay added the A-ADAPTER Topics related to the ADAPTER layer label Jun 16, 2026
@ggevay ggevay merged commit 75d653a into MaterializeInc:main Jun 16, 2026
120 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ADAPTER Topics related to the ADAPTER layer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants