Skip to content

Commit e06b9d6

Browse files
committed
sql: accept WITH (WAIT ...) on ALTER CLUSTER unconditionally
Graceful cluster reconfiguration has been behind the `enable_zero_downtime_cluster_reconfiguration` feature flag, default off, so the `WITH (WAIT ...)` surface was rejected at plan time unless a deployment turned it on. That is now the only thing standing between an operator and the synchronous cut-over, which is the escape hatch for a reshape when the cluster controller itself is the problem. A break-glass path behind a default-off flag is not a break-glass path. Remove the flag and the planner gate. The two rejections that share that 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 (platform-checks' graceful-reconfiguration check runs its first manipulate phase there), so `get_minimal_system_parameters` pins the flag on below v26.38 instead. The docs drop the private-preview badges: the surface is generally available once nothing gates it.
1 parent 281b832 commit e06b9d6

12 files changed

Lines changed: 12 additions & 56 deletions

File tree

doc/user/content/sql/alter-cluster.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,6 @@ by default), Materialize rolls back the resize and the cluster keeps its current
177177
size. To customize the timeout behavior, use the `WAIT UNTIL READY` or `WAIT FOR` options.
178178
The resize still proceeds in the background.
179179

180-
{{< private-preview >}}
181-
Customizing the resize timeout with `WAIT UNTIL READY` or `WAIT FOR`
182-
{{< /private-preview >}}
183-
184180
- `WAIT UNTIL READY (TIMEOUT = ..., ON TIMEOUT = ...)` sets the timeout for the
185181
resize. On timeout, `ON TIMEOUT` selects whether to `COMMIT` (retire the old
186182
replicas and proceed with the not-yet-hydrated new ones, which can cause
@@ -225,7 +221,6 @@ current size. Materialize drops the pending replicas and keeps the current
225221
configuration.
226222

227223
#### Downtime considerations for v26.34 or before
228-
{{< private-preview />}}
229224

230225
You can use the `WAIT UNTIL READY` option to perform a zero-downtime resizing,
231226
which incurs **no downtime**. Instead of restarting the cluster, this approach

misc/python/materialize/checks/all_checks/cluster.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,6 @@ def _can_run(self, e: Executor) -> bool:
152152

153153
def initialize(self) -> Testdrive:
154154
return Testdrive(dedent("""
155-
$ postgres-execute connection=postgres://mz_system@${testdrive.materialize-internal-sql-addr}
156-
ALTER SYSTEM SET enable_zero_downtime_cluster_reconfiguration = true
157-
158155
$ postgres-execute connection=postgres://postgres:postgres@postgres
159156
CREATE USER graceful_reconfig WITH SUPERUSER PASSWORD 'postgres';
160157
ALTER USER graceful_reconfig WITH replication;

misc/python/materialize/mzcompose/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,14 @@ def get_minimal_system_parameters(
131131
"true" if version >= MzVersion.parse_mz("v26.29.0-dev") else "false"
132132
)
133133

134+
# The `WITH (WAIT ...)` graceful-reconfiguration surface. Always accepted
135+
# from v26.38 on. Older binaries still gate it behind this feature flag, so
136+
# pin it on for them: the tests that use the surface no longer enable it
137+
# themselves, and in a mixed-version run some of their phases execute
138+
# against the old binary.
139+
if version < MzVersion.parse_mz("v26.38.0-dev"):
140+
config["enable_zero_downtime_cluster_reconfiguration"] = "true"
141+
134142
return config
135143

136144

misc/python/materialize/parallel_workload/parallel_workload.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,6 @@ def run(
168168
system_exe.execute("ALTER SYSTEM SET max_sql_server_connections = 1000000")
169169
system_exe.execute("ALTER SYSTEM SET max_kafka_connections = 1000000")
170170
system_exe.execute("ALTER SYSTEM SET idle_in_transaction_session_timeout = 0")
171-
# Gates the WITH (WAIT ...) clause used by ReconfigureClusterAction.
172-
system_exe.execute(
173-
"ALTER SYSTEM SET enable_zero_downtime_cluster_reconfiguration = true"
174-
)
175171
# Most queries should not fail because of privileges
176172
for object_type in [
177173
"TABLES",

src/sql/src/plan/statement/ddl.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6557,15 +6557,6 @@ pub fn plan_alter_cluster(
65576557
);
65586558
}
65596559

6560-
match alter_strategy {
6561-
AlterClusterPlanStrategy::None => {}
6562-
_ => {
6563-
scx.require_feature_flag(
6564-
&crate::session::vars::ENABLE_ZERO_DOWNTIME_CLUSTER_RECONFIGURATION,
6565-
)?;
6566-
}
6567-
}
6568-
65696560
if replica_defs.is_some() {
65706561
sql_bail!("REPLICAS not supported for managed clusters");
65716562
}

src/sql/src/session/vars/definitions.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2227,12 +2227,6 @@ feature_flags!(
22272227
default: false,
22282228
enable_for_item_parsing: false,
22292229
},
2230-
{
2231-
name: enable_zero_downtime_cluster_reconfiguration,
2232-
desc: "Enable zero-downtime reconfiguration for alter cluster",
2233-
default: false,
2234-
enable_for_item_parsing: false,
2235-
},
22362230
{
22372231
name: enable_network_policies,
22382232
desc: "ENABLE NETWORK POLICIES",

test/cloudtest/test_managed_cluster.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ def test_zero_downtime_reconfiguration(mz: MaterializeApplication) -> None:
146146
# within the short poll loops below.
147147
mz.environmentd.sql(
148148
"""
149-
ALTER SYSTEM SET enable_zero_downtime_cluster_reconfiguration = true;
150149
ALTER SYSTEM SET cluster_controller_tick_interval = '5ms';
151150
""",
152151
port="internal",

test/cluster/mzcompose.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5829,7 +5829,6 @@ def workflow_test_zero_downtime_reconfigure(
58295829
key${kafka-ingest.iteration}:value${kafka-ingest.iteration}
58305830
58315831
$ postgres-execute connection=postgres://mz_system:materialize@${testdrive.materialize-internal-sql-addr}
5832-
ALTER SYSTEM SET enable_zero_downtime_cluster_reconfiguration = true;
58335832
CREATE CLUSTER cluster1 ( SIZE = 'scale=1,workers=1');
58345833
GRANT ALL ON CLUSTER cluster1 TO materialize;
58355834
@@ -5946,13 +5945,6 @@ def workflow_test_zero_downtime_reconfigure(
59465945
> SELECT count(*) FROM kafka_tbl
59475946
1000
59485947
"""))
5949-
c.sql(
5950-
"""
5951-
ALTER SYSTEM RESET enable_zero_downtime_cluster_reconfiguration;
5952-
""",
5953-
port=6877,
5954-
user="mz_system",
5955-
)
59565948

59575949

59585950
def workflow_test_pending_replica_audit_events(
@@ -5968,11 +5960,10 @@ def workflow_test_pending_replica_audit_events(
59685960
"""
59695961
c.up("materialized")
59705962

5971-
# Enable the WAIT surface and drive the controller tick down so the (empty)
5972-
# cluster's reconfiguration converges quickly.
5963+
# Drive the controller tick down so the (empty) cluster's reconfiguration
5964+
# converges quickly.
59735965
c.sql(
59745966
"""
5975-
ALTER SYSTEM SET enable_zero_downtime_cluster_reconfiguration = true;
59765967
ALTER SYSTEM SET cluster_controller_tick_interval = '5ms';
59775968
CREATE CLUSTER test_audit (SIZE = 'scale=1,workers=1');
59785969
GRANT ALL ON CLUSTER test_audit TO materialize;
@@ -6067,7 +6058,6 @@ def workflow_test_pending_replica_audit_events(
60676058
c.sql(
60686059
"""
60696060
DROP CLUSTER test_audit CASCADE;
6070-
ALTER SYSTEM RESET enable_zero_downtime_cluster_reconfiguration;
60716061
""",
60726062
port=6877,
60736063
user="mz_system",

test/launchdarkly-flag-consistency/mzcompose.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,7 @@
465465
enable_repr_typecheck
466466
enable_unified_cluster_arrangment
467467
enable_yugabyte_connection
468+
enable_zero_downtime_cluster_reconfiguration
468469
kafka_default_metadata_fetch_interval
469470
mysql_offset_known_interval
470471
persist_enable_arrow_lgalloc_noncc_sizes
@@ -502,7 +503,6 @@
502503
"enable_scoped_system_parameters",
503504
"enable_timely_zero_copy_lgalloc",
504505
"enable_upsert_paged_spill",
505-
"enable_zero_downtime_cluster_reconfiguration",
506506
"kafka_client_id_enrichment_rules",
507507
"kafka_progress_record_fetch_timeout",
508508
"kafka_socket_timeout",

test/pg-cdc/cluster-graceful-reconfiguration.td

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@
1616
# new replica until cut-over drops the old one. Readiness must therefore not
1717
# wait for the source to hydrate on the target, but must still wait for the
1818
# target's processes to come online before cutting over.
19-
#
20-
# The background flag is pinned explicitly so the test does not depend on the
21-
# harness defaults.
22-
23-
$ postgres-execute connection=postgres://mz_system:materialize@${testdrive.materialize-internal-sql-addr}
24-
ALTER SYSTEM SET enable_zero_downtime_cluster_reconfiguration = true
2519

2620
> CREATE SECRET pgpass AS 'postgres'
2721
> CREATE CONNECTION pg TO POSTGRES (

0 commit comments

Comments
 (0)