diff --git a/src/adapter/src/catalog/builtin_table_updates.rs b/src/adapter/src/catalog/builtin_table_updates.rs index 2ed641cbb72cc..1ad0d7a6bcf15 100644 --- a/src/adapter/src/catalog/builtin_table_updates.rs +++ b/src/adapter/src/catalog/builtin_table_updates.rs @@ -2013,13 +2013,14 @@ impl CatalogState { continue; } - // Just invent something when the limits are `None`, which only happens in non-prod - // environments (tests, process orchestrator, etc.) + // Limits can be `None`, specifying that resource usage is unlimited. Unfortunately, + // the relevant table fields are not nullable, so we have to put in some value. We put + // in the maximum (based on `u64::MAX`), which makes it at least immediately clear that + // the limit is a bogus one. let cpu_limit = alloc.cpu_limit.unwrap_or(CpuLimit::MAX); let MemoryLimit(ByteSize(memory_bytes)) = - (alloc.memory_limit).unwrap_or(MemoryLimit::MAX); - let DiskLimit(ByteSize(disk_bytes)) = - (alloc.disk_limit).unwrap_or(DiskLimit::ARBITRARY); + alloc.memory_limit.unwrap_or(MemoryLimit::MAX); + let DiskLimit(ByteSize(disk_bytes)) = alloc.disk_limit.unwrap_or(DiskLimit::MAX); let row = Row::pack_slice(&[ size.as_str().into(), diff --git a/test/sqllogictest/cluster.slt b/test/sqllogictest/cluster.slt index f8dae2e241fcc..dbc0190337e1f 100644 --- a/test/sqllogictest/cluster.slt +++ b/test/sqllogictest/cluster.slt @@ -659,19 +659,35 @@ CREATE CLUSTER REPLICA quickstart.replica AVAILABILITY ZONE 'a', STORAGECTL ADDR # Test that the contents of mz_cluster_replicas look sensible statement ok -CREATE CLUSTER foo REPLICAS (size_1 (SIZE 'scale=1,workers=1'), size_32 (SIZE 'scale=1,workers=32'), size_2_2 (SIZE 'scale=2,workers=2'), size_1_8g (SIZE 'scale=1,workers=1,mem=8GiB')) - -query TTTTTTT -SELECT r.name, r.size, s.processes, s.cpu_nano_cores, s.memory_bytes, s.workers, s.credits_per_hour FROM mz_cluster_replicas r JOIN mz_catalog.mz_cluster_replica_sizes s ON r.size = s.size ORDER BY r.name ----- -r1 scale=1,workers=2 1 18446744073709000000 18446744073709551615 2 1 -r1 scale=1,workers=2 1 18446744073709000000 18446744073709551615 2 1 -r1 scale=1,workers=2 1 18446744073709000000 18446744073709551615 2 1 -r1 scale=1,workers=2 1 18446744073709000000 18446744073709551615 2 1 -size_1 scale=1,workers=1 1 18446744073709000000 18446744073709551615 1 1 -size_1_8g scale=1,workers=1,mem=8GiB 1 18446744073709000000 8589934592 1 1 -size_2_2 scale=2,workers=2 2 18446744073709000000 18446744073709551615 2 2 -size_32 scale=1,workers=32 1 18446744073709000000 18446744073709551615 32 1 +CREATE CLUSTER foo REPLICAS ( + size_1 (SIZE 'scale=1,workers=1'), + size_32 (SIZE 'scale=1,workers=32'), + size_2_2 (SIZE 'scale=2,workers=2'), + size_1_8g (SIZE 'scale=1,workers=1,mem=8GiB') +) + +query TTTTTTTT +SELECT + r.name, + r.size, + s.processes, + s.cpu_nano_cores, + s.memory_bytes, + s.disk_bytes, + s.workers, + s.credits_per_hour +FROM mz_cluster_replicas r +JOIN mz_catalog.mz_cluster_replica_sizes s ON r.size = s.size +ORDER BY r.name +---- +r1 scale=1,workers=2 1 18446744073709000000 18446744073709551615 18446744073709551615 2 1 +r1 scale=1,workers=2 1 18446744073709000000 18446744073709551615 18446744073709551615 2 1 +r1 scale=1,workers=2 1 18446744073709000000 18446744073709551615 18446744073709551615 2 1 +r1 scale=1,workers=2 1 18446744073709000000 18446744073709551615 18446744073709551615 2 1 +size_1 scale=1,workers=1 1 18446744073709000000 18446744073709551615 18446744073709551615 1 1 +size_1_8g scale=1,workers=1,mem=8GiB 1 18446744073709000000 8589934592 18446744073709551615 1 1 +size_2_2 scale=2,workers=2 2 18446744073709000000 18446744073709551615 18446744073709551615 2 2 +size_32 scale=1,workers=32 1 18446744073709000000 18446744073709551615 18446744073709551615 32 1 statement ok DROP CLUSTER foo CASCADE