Skip to content

Commit 70fc218

Browse files
committed
platform-checks & parallel-workload. Allow multi-replica clusters with webhook sources
1 parent bfb64d9 commit 70fc218

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ def initialize(self) -> Testdrive:
2525
schemas()
2626
+ dedent(
2727
"""
28-
> CREATE CLUSTER webhook_cluster REPLICAS (r1 (SIZE '1'));
28+
>[version>=14700] CREATE CLUSTER webhook_cluster REPLICATION FACTOR 2
29+
>[version<14700] CREATE CLUSTER webhook_cluster REPLICATION FACTOR 1
2930
3031
> CREATE SOURCE webhook_text IN CLUSTER webhook_cluster FROM WEBHOOK BODY FORMAT TEXT;
3132
@@ -144,7 +145,7 @@ def initialize(self) -> Testdrive:
144145
schemas()
145146
+ dedent(
146147
"""
147-
> CREATE CLUSTER webhook_table_cluster REPLICAS (r1 (SIZE '1'));
148+
> CREATE CLUSTER webhook_table_cluster REPLICATION FACTOR 2
148149
> SET cluster = webhook_table_cluster
149150
> CREATE TABLE webhook_table_text FROM WEBHOOK BODY FORMAT TEXT;
150151
> SET cluster = quickstart

misc/python/materialize/parallel_workload/action.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1956,14 +1956,6 @@ def run(self, exe: Executor) -> bool:
19561956

19571957

19581958
class CreateWebhookSourceAction(Action):
1959-
def errors_to_ignore(self, exe: Executor) -> list[str]:
1960-
result = super().errors_to_ignore(exe)
1961-
if exe.db.scenario in (Scenario.Kill, Scenario.ZeroDowntimeDeploy):
1962-
result.extend(
1963-
["cannot create webhook source in cluster with more than one replica"]
1964-
)
1965-
return result
1966-
19671959
def run(self, exe: Executor) -> bool:
19681960
with exe.db.lock:
19691961
if len(exe.db.webhook_sources) >= MAX_WEBHOOK_SOURCES:
@@ -1975,7 +1967,7 @@ def run(self, exe: Executor) -> bool:
19751967
with schema.lock, cluster.lock:
19761968
if schema not in exe.db.schemas:
19771969
return False
1978-
if cluster not in exe.db.clusters or len(cluster.replicas) != 1:
1970+
if cluster not in exe.db.clusters:
19791971
return False
19801972

19811973
source = WebhookSource(webhook_source_id, cluster, schema, self.rng)

0 commit comments

Comments
 (0)