Skip to content

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

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

sql: accept WITH (WAIT ...) on ALTER CLUSTER unconditionally#38104
aljoscha wants to merge 8 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-03-staged-machine branch from 385e39c to 281b832 Compare August 7, 2026 08:01
@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-03-staged-machine branch from 281b832 to 6aacdb9 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-03-staged-machine branch from 6aacdb9 to 0c59e5b 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-03-staged-machine branch from e115a22 to 86f1766 Compare August 10, 2026 17:52
@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
@aljoscha
aljoscha force-pushed the aljoscha/cluster-legacy-03-staged-machine branch from 86f1766 to fbc61b7 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-03-staged-machine branch from fbc61b7 to 958d547 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-03-staged-machine branch from 958d547 to cb3f460 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 a3ff998 to c2743f3 Compare August 31, 2026 12:23
@aljoscha
aljoscha force-pushed the aljoscha/cluster-legacy-03-staged-machine branch 2 times, most recently from c6f5a4c to fe8f383 Compare August 31, 2026 14:30
@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-03-staged-machine branch from fe8f383 to 3fc3358 Compare August 31, 2026 14:40
@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.

Remove ALTER-time prediction of the controller's transient strategy union. Concrete replica-create transactions enforce count and credit limits, and an exhausted graceful reconfiguration keeps serving from its realized replicas while recording a resource-exhausted status and audit transition. Keep only intrinsic target-baseline and replication-factor checks in the sequencer.

A forced cut-over waits for its complete target set to exist, while the baseline yields the realized set once the commit deadline has passed. The controller creates the target and retires the realized replicas in one catalog transaction, so a zero-wait replacement needs room for the settled target rather than both sets. Catalog implications queue same-cluster drops before creates so physical orchestration quotas honor the same net accounting contract.

Derive create-time scoped configuration from concrete catalog create ops at the coordinator transaction boundary. This makes controller-created replacement replicas receive render-frozen overrides before their first render, regardless of which component produced the create.

Foreground waits report matching resource exhaustion as insufficient resources instead of a misleading timeout. A later ALTER that supersedes the waiter's target cannot misattribute its own failure.
@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-03-staged-machine branch 2 times, most recently from 3798c93 to a850316 Compare August 31, 2026 15:32
@aljoscha
aljoscha force-pushed the aljoscha/cluster-legacy-04-zdt-flag branch from 4dd05f1 to 3506904 Compare August 31, 2026 15:32
Preserve the design's historical framing while recording the few
implementation refinements readers need to interpret it accurately.
The controller owns every managed cluster's replica set. Shape-changing
ALTERs return through the durable reconfiguration-record path before
reaching the managed-to-managed config write. The `controller_owns = true`
guard therefore left the staged producer and sequencer reconciliation
branches unreachable. Deleting those branches does not change
managed-cluster behavior.

Delete the WaitForHydrated and Finalize stages, pending overlap replicas,
per-connection pending ALTER state, sequencer replica create/drop branches,
and their dead op and error plumbing. Keep the durable pending field and
catalog-open cleanup so a replica stranded by an older binary is still
reaped after upgrade.

The surviving managed-to-managed path is a config-only write. The cluster
controller reconciles replication-factor changes and scheduled-cluster shape
changes on its next tick.
Record the narrow compatibility reason the durable pending field and
catalog-open cleanup remain even though the controller does not use pending
replicas as active lifecycle state.
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.
@aljoscha
aljoscha force-pushed the aljoscha/cluster-legacy-03-staged-machine branch from a850316 to bc37a9e Compare August 31, 2026 17:52
@aljoscha
aljoscha force-pushed the aljoscha/cluster-legacy-04-zdt-flag branch from 3506904 to 0a1280c Compare August 31, 2026 17:52
@aljoscha
aljoscha force-pushed the aljoscha/cluster-legacy-03-staged-machine branch from bc37a9e to a0aa6db Compare September 4, 2026 10:20
@aljoscha
aljoscha requested a review from a team as a code owner September 4, 2026 10:20
@aljoscha aljoscha closed this Sep 4, 2026
@aljoscha
aljoscha deleted the aljoscha/cluster-legacy-04-zdt-flag branch September 4, 2026 10:20
@aljoscha
aljoscha restored the aljoscha/cluster-legacy-04-zdt-flag branch September 4, 2026 10:21
@aljoscha
aljoscha deleted the aljoscha/cluster-legacy-04-zdt-flag branch September 4, 2026 10:21
@aljoscha

aljoscha commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #38627, which landed the same unconditional WITH (WAIT ...) acceptance and the corrected v26.41 mixed-version pin on main. The remaining stack has been rebased without this PR.

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