Skip to content

sql: accept WITH (WAIT ...) on ALTER CLUSTER unconditionally - #38104

Open
aljoscha wants to merge 2 commits into
aljoscha/cluster-legacy-03-staged-machinefrom
aljoscha/cluster-legacy-04-zdt-flag
Open

sql: accept WITH (WAIT ...) on ALTER CLUSTER unconditionally#38104
aljoscha wants to merge 2 commits into
aljoscha/cluster-legacy-03-staged-machinefrom
aljoscha/cluster-legacy-04-zdt-flag

Conversation

@aljoscha

@aljoscha aljoscha commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Motivation

WITH (WAIT ...) on ALTER CLUSTER is gated behind
enable_zero_downtime_cluster_reconfiguration, default off. Stacked on #38103,
every graceful reconfiguration already runs through one durable controller path,
so the flag only controls whether users can express a deadline and a timeout
action for it.

Description

Removes the feature flag and its planner gate, so WITH (WAIT ...) is accepted
on every deployment. The two rejections that share that code path stay: a WAIT
without a replica-shape change, and a WAIT on an unmanaged cluster.

The mixed-version default is bounded at v26.41 so upgrade scenarios running
against an older binary still set the flag, and the private-preview badges come
off the ALTER CLUSTER reference page.

enable_cluster_schedule_refresh, the near-identical sibling gate, is
deliberately untouched. It gates a separate SQL surface under its own rollout.

Verification

Existing graceful-reconfiguration coverage in testdrive, sqllogictest, and
platform checks now exercises the surface without setting a flag.

User-visible behavior

Graceful cluster reconfiguration with WITH (WAIT UNTIL READY ...) and
WITH (WAIT FOR ...) becomes generally available, no longer private preview and
no longer requiring a feature flag.

@aljoscha
aljoscha force-pushed the aljoscha/cluster-legacy-04-zdt-flag branch from b3e6c5d to 44e8e16 Compare August 7, 2026 08:00
@aljoscha
aljoscha force-pushed the aljoscha/cluster-legacy-04-zdt-flag branch from 44e8e16 to e06b9d6 Compare August 7, 2026 08:01
@aljoscha
aljoscha marked this pull request as ready for review August 7, 2026 08:14
@aljoscha
aljoscha requested review from a team as code owners August 7, 2026 08:14
@aljoscha
aljoscha force-pushed the aljoscha/cluster-legacy-04-zdt-flag branch from e06b9d6 to 8f88cec Compare August 7, 2026 08:28
@aljoscha
aljoscha force-pushed the aljoscha/cluster-legacy-04-zdt-flag branch from 8f88cec to f1f08b2 Compare August 7, 2026 08:45
@aljoscha
aljoscha force-pushed the aljoscha/cluster-legacy-04-zdt-flag branch from f1f08b2 to c6c719e Compare August 7, 2026 10:05
@aljoscha
aljoscha force-pushed the aljoscha/cluster-legacy-04-zdt-flag branch from c6c719e to d9f10e3 Compare August 10, 2026 17:52
@aljoscha
aljoscha requested review from ggevay and mtabebe August 12, 2026 09:17
@aljoscha
aljoscha force-pushed the aljoscha/cluster-legacy-04-zdt-flag branch from d9f10e3 to cc7aa1f Compare August 17, 2026 09:58
@ggevay

ggevay commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Fine to remove the "private preview" status from my side! cc @maheshwarip

@aljoscha
aljoscha force-pushed the aljoscha/cluster-legacy-04-zdt-flag branch from cc7aa1f to 93798f7 Compare August 24, 2026 09:39
@aljoscha
aljoscha force-pushed the aljoscha/cluster-legacy-04-zdt-flag branch from 93798f7 to 7328043 Compare August 24, 2026 09:44
@aljoscha
aljoscha force-pushed the aljoscha/cluster-legacy-04-zdt-flag branch from 7328043 to cac31da Compare August 24, 2026 09:46
@aljoscha
aljoscha force-pushed the aljoscha/cluster-legacy-04-zdt-flag branch 2 times, most recently from faa0152 to a8209bf Compare August 25, 2026 11:14
@aljoscha
aljoscha force-pushed the aljoscha/cluster-legacy-04-zdt-flag branch 2 times, most recently from 7722520 to 6c1bd78 Compare August 31, 2026 10:58
@def-

def- commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

QA LLM Review

1. MEDIUM -- Mixed-version pin for enable_zero_downtime_cluster_reconfiguration is bounded two minor versions too low

misc/python/materialize/mzcompose/__init__.py:175

The planner gate is removed in v26.41.0-dev (the version at this head), but the pin only applies to version < v26.39.0-dev. v26.39 and v26.40 binaries still carry the gate with default: false, so upgrade scenarios that run a WITH (WAIT ...) phase against them now get Enable zero-downtime reconfiguration for alter cluster is not available instead of the coverage this PR says it relies on.

Details

The pin has to cover every binary that still gates the surface, i.e. everything below the version where the gate disappears. That is exactly the convention the sibling block ten lines above uses: enable_cluster_controller was removed at v26.38.0-dev and is pinned for version < v26.38.0-dev.

Concretely, with MzVersion.parse_cargo() == v26.41.0-dev.0, get_published_minor_mz_versions(..., limit=4, include_release_candidates=True) yields [v26.40.0-rc.2, v26.39.0, v26.38.2, v26.37.0], and v26.39.0 < v26.39.0-dev is False. AlterClusterGracefulReconfiguration (misc/python/materialize/checks/all_checks/cluster.py:137) only skips below v26.35.0-dev, and this PR deleted the ALTER SYSTEM SET it used to do in initialize(), so:

  • UpgradeEntireMz — base v26.40.0-rc.2, manipulate phase 1 runs ALTER CLUSTER ... WITH (WAIT UNTIL READY ...) on that binary, unpinned.
  • UpgradeEntireMzTwoVersions — phase 1 on v26.40.0-rc.2, unpinned.
  • UpgradeEntireMzFourVersions — phase 2 on v26.39.0, unpinned.

StartMz passes system_parameter_version = tag (misc/python/materialize/checks/mzcompose_actions.py:65), so get_minimal_system_parameters is evaluated per old image and the pin is genuinely absent for those tags. Sending the pin to a binary that no longer knows the name is harmless: catalog/open.rs:258 downgrades an unknown --system-parameter-default to a warn!.

-    # The `WITH (WAIT ...)` graceful-reconfiguration surface. Always accepted
-    # from v26.39 on. Older binaries still gate it behind this feature flag, so
+    # The `WITH (WAIT ...)` graceful-reconfiguration surface. Always accepted
+    # from v26.41 on. Older binaries still gate it behind this feature flag, so
     # pin it on for them: the tests that use the surface no longer enable it
     # themselves, and in a mixed-version run some of their phases execute
     # against the old binary.
-    if version < MzVersion.parse_mz("v26.39.0-dev"):
+    if version < MzVersion.parse_mz("v26.41.0-dev"):
         config["enable_zero_downtime_cluster_reconfiguration"] = "true"

Worth re-checking the bound at merge time: if the stack sits until the next version bump, it needs to move again.

@aljoscha
aljoscha force-pushed the aljoscha/cluster-legacy-04-zdt-flag branch from 6c1bd78 to 26589db Compare August 31, 2026 11:18
@aljoscha
aljoscha force-pushed the aljoscha/cluster-legacy-04-zdt-flag branch from 26589db to a63a200 Compare August 31, 2026 11:20
@aljoscha
aljoscha force-pushed the aljoscha/cluster-legacy-04-zdt-flag branch 2 times, most recently from a3ff998 to c2743f3 Compare August 31, 2026 12:23
@aljoscha
aljoscha force-pushed the aljoscha/cluster-legacy-04-zdt-flag branch from c2743f3 to 6b0fdfd Compare August 31, 2026 14:30
@aljoscha
aljoscha force-pushed the aljoscha/cluster-legacy-04-zdt-flag branch from 6b0fdfd to 02e2ef7 Compare August 31, 2026 14:40
@aljoscha

Copy link
Copy Markdown
Contributor Author

Fixed. Current upstream main is v26.41.0-dev.0, so mixed-version defaults now pin enable_zero_downtime_cluster_reconfiguration=true for versions below v26.41.0-dev. The PR description and commit message use the same bound.

@aljoscha
aljoscha force-pushed the aljoscha/cluster-legacy-04-zdt-flag branch from 02e2ef7 to 4dd05f1 Compare August 31, 2026 15:15
@aljoscha
aljoscha force-pushed the aljoscha/cluster-legacy-04-zdt-flag branch from 4dd05f1 to 3506904 Compare August 31, 2026 15:32
Graceful cluster reconfiguration has been behind the
`enable_zero_downtime_cluster_reconfiguration` feature flag, default off, so
the `WITH (WAIT ...)` surface is rejected at plan time unless a deployment
turns it on. The controller record is now the only managed-cluster reshape
path, which leaves the flag controlling only whether users can express its
deadline and timeout behavior.

Remove the flag and planner gate. The two rejections that share the code path
stay: a `WAIT` without a replica-shape change, and a `WAIT` on an unmanaged
cluster.

Every test that used the surface enabled the flag itself, so those statements
go. In a mixed-version run some phases execute against a released binary that
still enforces the gate, so `get_minimal_system_parameters` pins the flag on
below v26.41 instead.

The docs drop the private-preview badges because the surface is generally
available once nothing gates it.
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.

4 participants