Skip to content

Commit 26589db

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 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.39 instead. The docs drop the private-preview badges because the surface is generally available once nothing gates it.
1 parent d7ff178 commit 26589db

13 files changed

Lines changed: 14 additions & 58 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 target 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

doc/user/data/examples/alter_cluster.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@
9696
The following `<with_option>`s are supported:
9797
| Option | Description |
9898
|--------|-------------|
99-
| `WAIT UNTIL READY(...)` | ***Private preview.** This option has known performance or stability issues and is under active development.* {{< include-from-yaml data="examples/alter_cluster" name="wait-until-ready-cmd-option" >}} |
100-
| `WAIT FOR` | ***Private preview.** This option has known performance or stability issues and is under active development.* A fixed duration to wait for the new replicas to be ready. This option can lead to downtime. As such, we recommend using the `WAIT UNTIL READY` option instead.|
99+
| `WAIT UNTIL READY(...)` | {{< include-from-yaml data="examples/alter_cluster" name="wait-until-ready-cmd-option" >}} |
100+
| `WAIT FOR` | A fixed duration to wait for the new replicas to be ready. This option can lead to downtime. As such, we recommend using the `WAIT UNTIL READY` option instead.|
101101
102102
- name: "syntax-reset-to-default"
103103
code: |

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
@@ -167,6 +167,14 @@ def get_minimal_system_parameters(
167167
"true" if version >= MzVersion.parse_mz("v26.29.0-dev") else "false"
168168
)
169169

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

172180

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
@@ -6727,15 +6727,6 @@ pub fn plan_alter_cluster(
67276727
);
67286728
}
67296729

6730-
match alter_strategy {
6731-
AlterClusterPlanStrategy::None => {}
6732-
_ => {
6733-
scx.require_feature_flag(
6734-
&crate::session::vars::ENABLE_ZERO_DOWNTIME_CLUSTER_RECONFIGURATION,
6735-
)?;
6736-
}
6737-
}
6738-
67396730
if replica_defs.is_some() {
67406731
sql_bail!("REPLICAS not supported for managed clusters");
67416732
}

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2253,12 +2253,6 @@ feature_flags!(
22532253
default: false,
22542254
enable_for_item_parsing: false,
22552255
},
2256-
{
2257-
name: enable_zero_downtime_cluster_reconfiguration,
2258-
desc: "Enable zero-downtime reconfiguration for alter cluster",
2259-
default: false,
2260-
enable_for_item_parsing: false,
2261-
},
22622256
{
22632257
name: enable_network_policies,
22642258
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
@@ -6318,7 +6318,6 @@ def workflow_test_zero_downtime_reconfigure(
63186318
key${kafka-ingest.iteration}:value${kafka-ingest.iteration}
63196319
63206320
$ postgres-execute connection=postgres://mz_system:materialize@${testdrive.materialize-internal-sql-addr}
6321-
ALTER SYSTEM SET enable_zero_downtime_cluster_reconfiguration = true;
63226321
CREATE CLUSTER cluster1 ( SIZE = 'scale=1,workers=1');
63236322
GRANT ALL ON CLUSTER cluster1 TO materialize;
63246323
@@ -6435,13 +6434,6 @@ def workflow_test_zero_downtime_reconfigure(
64356434
> SELECT count(*) FROM kafka_tbl
64366435
1000
64376436
"""))
6438-
c.sql(
6439-
"""
6440-
ALTER SYSTEM RESET enable_zero_downtime_cluster_reconfiguration;
6441-
""",
6442-
port=6877,
6443-
user="mz_system",
6444-
)
64456437

64466438

64476439
def workflow_test_pending_replica_audit_events(
@@ -6457,11 +6449,10 @@ def workflow_test_pending_replica_audit_events(
64576449
"""
64586450
c.up("materialized")
64596451

6460-
# Enable the WAIT surface and drive the controller tick down so the (empty)
6461-
# cluster's reconfiguration converges quickly.
6452+
# Drive the controller tick down so the (empty) cluster's reconfiguration
6453+
# converges quickly.
64626454
c.sql(
64636455
"""
6464-
ALTER SYSTEM SET enable_zero_downtime_cluster_reconfiguration = true;
64656456
ALTER SYSTEM SET cluster_controller_tick_interval = '5ms';
64666457
CREATE CLUSTER test_audit (SIZE = 'scale=1,workers=1');
64676458
GRANT ALL ON CLUSTER test_audit TO materialize;
@@ -6556,7 +6547,6 @@ def workflow_test_pending_replica_audit_events(
65566547
c.sql(
65576548
"""
65586549
DROP CLUSTER test_audit CASCADE;
6559-
ALTER SYSTEM RESET enable_zero_downtime_cluster_reconfiguration;
65606550
""",
65616551
port=6877,
65626552
user="mz_system",

test/launchdarkly-flag-consistency/mzcompose.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@
480480
enable_repr_typecheck
481481
enable_unified_cluster_arrangment
482482
enable_yugabyte_connection
483+
enable_zero_downtime_cluster_reconfiguration
483484
kafka_default_metadata_fetch_interval
484485
mysql_offset_known_interval
485486
persist_enable_arrow_lgalloc_noncc_sizes
@@ -516,7 +517,6 @@
516517
"enable_lgalloc",
517518
"enable_timely_zero_copy_lgalloc",
518519
"enable_upsert_paged_spill",
519-
"enable_zero_downtime_cluster_reconfiguration",
520520
"kafka_client_id_enrichment_rules",
521521
"kafka_progress_record_fetch_timeout",
522522
"kafka_socket_timeout",

0 commit comments

Comments
 (0)