Skip to content

Commit 66cf848

Browse files
committed
Revert "tests: Adapt to new cluster size reality"
This reverts commit 636264d.
1 parent 6941d74 commit 66cf848

File tree

12 files changed

+177
-81
lines changed

12 files changed

+177
-81
lines changed

misc/python/materialize/cli/run.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,10 @@ def main() -> int:
275275
if args.monitoring:
276276
command += ["--opentelemetry-endpoint=http://localhost:4317"]
277277
elif args.program == "sqllogictest":
278-
params = get_default_system_parameters()
279-
params["enable_columnation_lgalloc"] = "false"
280-
formatted_params = [f"{key}={value}" for key, value in params.items()]
278+
formatted_params = [
279+
f"{key}={value}"
280+
for key, value in get_default_system_parameters().items()
281+
]
281282
system_parameter_default = ";".join(formatted_params)
282283
# Connect to the database to ensure it exists.
283284
_connect_sql(args.postgres)

misc/python/materialize/mzcompose/services/sql_logic_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ def __init__(
2828
volumes: list[str] = ["../..:/workdir"],
2929
depends_on: list[str] = [METADATA_STORE],
3030
) -> None:
31-
params = get_default_system_parameters()
32-
# Otherwise very noisy in SLT: lgalloc error: I/O error, falling back to heap
33-
params["enable_columnation_lgalloc"] = "false"
3431
environment += [
3532
"MZ_SYSTEM_PARAMETER_DEFAULT="
36-
+ ";".join(f"{key}={value}" for key, value in params.items())
33+
+ ";".join(
34+
f"{key}={value}"
35+
for key, value in get_default_system_parameters().items()
36+
)
3737
]
3838

3939
super().__init__(

misc/python/materialize/parallel_benchmark/scenarios.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,6 @@ def __init__(self, c: Composition, conn_infos: dict[str, PgConnInfo]):
746746
c,
747747
),
748748
dist=Periodic(per_second=1),
749-
report_regressions=False, # Don't care about this
750749
),
751750
ClosedLoop(
752751
action=StandaloneQuery(

src/catalog/tests/snapshots/debug__opened_trace.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ Trace {
374374
),
375375
replica_name: "r1",
376376
logical_size: "1",
377-
disk: true,
377+
disk: false,
378378
billed_as: None,
379379
internal: false,
380380
reason: Some(
@@ -558,7 +558,7 @@ Trace {
558558
),
559559
},
560560
),
561-
disk: true,
561+
disk: false,
562562
optimizer_feature_overrides: [],
563563
schedule: Some(
564564
ClusterSchedule {
@@ -628,7 +628,7 @@ Trace {
628628
ManagedLocation {
629629
size: "1",
630630
availability_zone: None,
631-
disk: true,
631+
disk: false,
632632
internal: false,
633633
billed_as: None,
634634
pending: false,

src/catalog/tests/snapshots/open__initial_audit_log.snap

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
source: src/catalog/tests/open.rs
33
expression: audit_log
4-
snapshot_kind: text
54
---
65
[
76
V1(
@@ -187,7 +186,7 @@ snapshot_kind: text
187186
),
188187
replica_name: "r1",
189188
logical_size: "1",
190-
disk: true,
189+
disk: false,
191190
billed_as: None,
192191
internal: false,
193192
reason: System,

src/catalog/tests/snapshots/open__initial_snapshot.snap

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
source: src/catalog/tests/open.rs
33
expression: test_snapshot
4-
snapshot_kind: text
54
---
65
Snapshot {
76
databases: {
@@ -1221,7 +1220,7 @@ Snapshot {
12211220
),
12221221
},
12231222
),
1224-
disk: true,
1223+
disk: false,
12251224
optimizer_feature_overrides: [],
12261225
schedule: Some(
12271226
ClusterSchedule {
@@ -1347,7 +1346,7 @@ Snapshot {
13471346
ManagedLocation {
13481347
size: "1",
13491348
availability_zone: None,
1350-
disk: true,
1349+
disk: false,
13511350
internal: false,
13521351
billed_as: None,
13531352
pending: false,

test/cloudtest/test_compute.py

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -133,21 +133,27 @@ def test_disk_label(mz: MaterializeApplication) -> None:
133133
user="mz_system",
134134
)
135135

136-
mz.environmentd.sql("CREATE CLUSTER disk MANAGED, SIZE = '2-1', DISK = true")
136+
for value in ("true", "false"):
137+
mz.environmentd.sql(
138+
f"CREATE CLUSTER disk_{value} MANAGED, SIZE = '2-1', DISK = {value}"
139+
)
137140

138-
(cluster_id, replica_id) = mz.environmentd.sql_query(
139-
"SELECT mz_clusters.id, mz_cluster_replicas.id FROM mz_cluster_replicas JOIN mz_clusters ON mz_cluster_replicas.cluster_id = mz_clusters.id WHERE mz_clusters.name = 'disk'"
140-
)[0]
141-
assert cluster_id is not None
142-
assert replica_id is not None
141+
(cluster_id, replica_id) = mz.environmentd.sql_query(
142+
f"SELECT mz_clusters.id, mz_cluster_replicas.id FROM mz_cluster_replicas JOIN mz_clusters ON mz_cluster_replicas.cluster_id = mz_clusters.id WHERE mz_clusters.name = 'disk_{value}'"
143+
)[0]
144+
assert cluster_id is not None
145+
assert replica_id is not None
143146

144-
node_selectors = get_node_selector(mz, cluster_id, replica_id)
145-
assert (
146-
node_selectors
147-
== '\'{"materialize.cloud/disk":"true"} {"materialize.cloud/disk":"true"}\''
148-
), node_selectors
147+
node_selectors = get_node_selector(mz, cluster_id, replica_id)
148+
if value == "true":
149+
assert (
150+
node_selectors
151+
== '\'{"materialize.cloud/disk":"true"} {"materialize.cloud/disk":"true"}\''
152+
), node_selectors
153+
else:
154+
assert node_selectors == "''"
149155

150-
mz.environmentd.sql("DROP CLUSTER disk CASCADE")
156+
mz.environmentd.sql(f"DROP CLUSTER disk_{value} CASCADE")
151157

152158
# Reset
153159
mz.environmentd.sql(

test/cloudtest/test_disk.py

Lines changed: 81 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def test_disk_replica(mz: MaterializeApplication) -> None:
2626
2727
> CREATE CLUSTER testdrive_no_reset_disk_cluster1
2828
REPLICAS (r1 (
29-
SIZE '1'
29+
SIZE '1', DISK = true
3030
))
3131
3232
> CREATE CONNECTION IF NOT EXISTS kafka TO KAFKA (BROKER '${testdrive.kafka-addr}', SECURITY PROTOCOL PLAINTEXT)
@@ -83,7 +83,7 @@ def test_disk_replica(mz: MaterializeApplication) -> None:
8383

8484

8585
def test_always_use_disk_replica(mz: MaterializeApplication) -> None:
86-
"""Testing `cluster_always_use_disk = true` cluster replicas"""
86+
"""Testing `DISK = false, cluster_always_use_disk = true` cluster replicas"""
8787
mz.environmentd.sql(
8888
"ALTER SYSTEM SET cluster_always_use_disk = true",
8989
port="internal",
@@ -93,43 +93,43 @@ def test_always_use_disk_replica(mz: MaterializeApplication) -> None:
9393
mz.testdrive.run(
9494
input=dedent(
9595
"""
96-
$ kafka-create-topic topic=test
96+
$ kafka-create-topic topic=test
9797
98-
$ kafka-ingest key-format=bytes format=bytes topic=test
99-
key1:val1
100-
key2:val2
98+
$ kafka-ingest key-format=bytes format=bytes topic=test
99+
key1:val1
100+
key2:val2
101101
102-
> CREATE CLUSTER disk_cluster2
103-
REPLICAS (r1 (SIZE '1'))
102+
> CREATE CLUSTER disk_cluster2
103+
REPLICAS (r1 (SIZE '1'))
104104
105-
> CREATE CONNECTION IF NOT EXISTS kafka TO KAFKA (BROKER '${testdrive.kafka-addr}', SECURITY PROTOCOL PLAINTEXT)
105+
> CREATE CONNECTION IF NOT EXISTS kafka TO KAFKA (BROKER '${testdrive.kafka-addr}', SECURITY PROTOCOL PLAINTEXT)
106106
107-
> CREATE SOURCE source1
108-
IN CLUSTER disk_cluster2
109-
FROM KAFKA CONNECTION kafka
110-
(TOPIC 'testdrive-test-${testdrive.seed}');
107+
> CREATE SOURCE source1
108+
IN CLUSTER disk_cluster2
109+
FROM KAFKA CONNECTION kafka
110+
(TOPIC 'testdrive-test-${testdrive.seed}');
111111
112-
> CREATE TABLE source1_tbl FROM SOURCE source1 (REFERENCE "testdrive-test-${testdrive.seed}")
113-
KEY FORMAT TEXT
114-
VALUE FORMAT TEXT
115-
ENVELOPE UPSERT;
112+
> CREATE TABLE source1_tbl FROM SOURCE source1 (REFERENCE "testdrive-test-${testdrive.seed}")
113+
KEY FORMAT TEXT
114+
VALUE FORMAT TEXT
115+
ENVELOPE UPSERT;
116116
117117
118-
> SELECT * FROM source1_tbl;
119-
key text
120-
------------------
121-
key1 val1
122-
key2 val2
118+
> SELECT * FROM source1_tbl;
119+
key text
120+
------------------
121+
key1 val1
122+
key2 val2
123123
124-
$ kafka-ingest key-format=bytes format=bytes topic=test
125-
key1:val3
124+
$ kafka-ingest key-format=bytes format=bytes topic=test
125+
key1:val3
126126
127-
> SELECT * FROM source1_tbl;
128-
key text
129-
------------------
130-
key1 val3
131-
key2 val2
132-
"""
127+
> SELECT * FROM source1_tbl;
128+
key text
129+
------------------
130+
key1 val3
131+
key2 val2
132+
"""
133133
)
134134
)
135135

@@ -153,3 +153,54 @@ def test_always_use_disk_replica(mz: MaterializeApplication) -> None:
153153
"ls /scratch/storage/upsert",
154154
)
155155
assert source_global_id in on_disk_sources
156+
157+
158+
def test_no_disk_replica(mz: MaterializeApplication) -> None:
159+
"""Testing `DISK = false` cluster replicas"""
160+
mz.testdrive.run(
161+
input=dedent(
162+
"""
163+
$ kafka-create-topic topic=test-no-disk
164+
165+
$ kafka-ingest key-format=bytes format=bytes topic=test-no-disk
166+
key1:val1
167+
key2:val2
168+
169+
> CREATE CLUSTER no_disk_cluster1
170+
REPLICAS (r1 (
171+
SIZE '1', DISK = false
172+
))
173+
174+
> CREATE CONNECTION IF NOT EXISTS kafka
175+
TO KAFKA (BROKER '${testdrive.kafka-addr}', SECURITY PROTOCOL PLAINTEXT)
176+
177+
> CREATE SOURCE no_disk_source1
178+
IN CLUSTER no_disk_cluster1
179+
FROM KAFKA CONNECTION kafka
180+
(TOPIC 'testdrive-test-no-disk-${testdrive.seed}');
181+
182+
> CREATE TABLE no_disk_source1_tbl FROM SOURCE no_disk_source1 (REFERENCE "testdrive-test-no-disk-${testdrive.seed}")
183+
KEY FORMAT TEXT
184+
VALUE FORMAT TEXT
185+
ENVELOPE UPSERT;
186+
187+
188+
> SELECT * FROM no_disk_source1_tbl;
189+
key text
190+
------------------
191+
key1 val1
192+
key2 val2
193+
194+
$ kafka-ingest key-format=bytes format=bytes topic=test-no-disk
195+
key1:val3
196+
197+
> SELECT * FROM no_disk_source1_tbl;
198+
key text
199+
------------------
200+
key1 val3
201+
key2 val2
202+
203+
> DROP CLUSTER no_disk_cluster1 CASCADE;
204+
"""
205+
)
206+
)

test/sqllogictest/audit_log.slt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ SELECT id, event_type, object_type, details, user FROM mz_audit_events ORDER BY
151151
12 create cluster {"id":"u1","name":"quickstart"} NULL
152152
13 grant cluster {"grantee_id":"p","grantor_id":"s1","object_id":"Cu1","privileges":"U"} NULL
153153
14 grant cluster {"grantee_id":"u1","grantor_id":"s1","object_id":"Cu1","privileges":"UC"} NULL
154-
15 create cluster-replica {"billed_as":null,"cluster_id":"u1","cluster_name":"quickstart","disk":true,"internal":false,"logical_size":"2","reason":"system","replica_id":"u1","replica_name":"r1"} NULL
154+
15 create cluster-replica {"billed_as":null,"cluster_id":"u1","cluster_name":"quickstart","disk":false,"internal":false,"logical_size":"2","reason":"system","replica_id":"u1","replica_name":"r1"} NULL
155155
16 grant system {"grantee_id":"s1","grantor_id":"s1","object_id":"SYSTEM","privileges":"RBNP"} NULL
156156
17 grant system {"grantee_id":"u1","grantor_id":"s1","object_id":"SYSTEM","privileges":"RBNP"} NULL
157157
18 alter system {"name":"enable_reduce_mfp_fusion","value":"on"} mz_system

test/sqllogictest/managed_cluster.slt

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -420,24 +420,33 @@ ALTER SYSTEM SET enable_disk_cluster_replicas = true;
420420
----
421421
COMPLETE 0
422422

423-
statement error db error: ERROR: DISK option not supported for non-legacy cluster sizes because disk is always enabled
423+
statement ok
424424
CREATE CLUSTER foo REPLICAS (r1 (SIZE '1'), r2 (SIZE '1', DISK))
425425

426-
statement error db error: ERROR: unknown cluster 'foo'
426+
statement error db error: ERROR: Cluster replicas with DISK true do not match expected DISK false
427427
ALTER CLUSTER foo SET (MANAGED, DISK=False, SIZE '1')
428428

429+
statement ok
430+
DROP CLUSTER foo
431+
429432
statement ok
430433
CREATE CLUSTER foo REPLICAS (r1 (SIZE '1'))
431434

432-
statement error db error: ERROR: DISK option not supported for modern cluster sizes because disk is always enabled
435+
statement error db error: ERROR: Cluster replicas with DISK true do not match expected DISK false
433436
ALTER CLUSTER foo SET (MANAGED, SIZE '1', DISK=False)
434437

435438
statement ok
436439
DROP CLUSTER foo
437440

438-
statement error db error: ERROR: DISK option not supported for non-legacy cluster sizes because disk is always enabled
441+
statement ok
439442
CREATE CLUSTER foo REPLICAS (r1 (SIZE '1', DISK), r2 (SIZE '1', DISK))
440443

444+
statement ok
445+
ALTER CLUSTER foo SET (MANAGED, SIZE '1', DISK)
446+
447+
statement ok
448+
DROP CLUSTER foo
449+
441450

442451
simple conn=mz_system,user=mz_system
443452
ALTER SYSTEM SET enable_graceful_cluster_reconfiguration = true;

0 commit comments

Comments
 (0)