disk-feature-flag.td 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. # Copyright Materialize, Inc. and contributors. All rights reserved.
  2. #
  3. # Use of this software is governed by the Business Source License
  4. # included in the LICENSE file at the root of this repository.
  5. #
  6. # As of the Change Date specified in that file, in accordance with
  7. # the Business Source License, use of this software will be governed
  8. # by the Apache License, Version 2.0.
  9. $ postgres-execute connection=postgres://mz_system:materialize@${testdrive.materialize-internal-sql-addr}
  10. ALTER SYSTEM SET enable_disk_cluster_replicas = false
  11. ALTER SYSTEM SET disk_cluster_replicas_default = false
  12. ! CREATE CLUSTER no SIZE = '1-no-disk', REPLICATION FACTOR 0, DISK;
  13. exact:`WITH (DISK)` for cluster replicas is not available
  14. > CREATE CLUSTER no SIZE = '1-no-disk', REPLICATION FACTOR 0;
  15. ! ALTER CLUSTER no SET (REPLICATION FACTOR 1, DISK);
  16. exact:`WITH (DISK)` for cluster replicas is not available
  17. > DROP CLUSTER no;
  18. # Test that if `enable_disk_cluster_replicas` is on, we can use `WITH(DISK)`.
  19. $ postgres-execute connection=postgres://mz_system:materialize@${testdrive.materialize-internal-sql-addr}
  20. ALTER SYSTEM SET enable_disk_cluster_replicas = true
  21. > DROP CLUSTER IF EXISTS c;
  22. # Can set unmanaged cluster replica options directly, mixing and matching disk
  23. > CREATE CLUSTER c REPLICAS (r1 (SIZE '1-no-disk', DISK), r2 (SIZE '1-no-disk'))
  24. > SELECT r.name, r.size, r.disk FROM mz_catalog.mz_clusters c, mz_catalog.mz_cluster_replicas r WHERE c.name = 'c' AND c.id = r.cluster_id;
  25. r1 1-no-disk true
  26. r2 1-no-disk false
  27. > DROP CLUSTER c;
  28. # Can set on managed clusters
  29. > CREATE CLUSTER c SIZE '1-no-disk', REPLICATION FACTOR = 2, DISK;
  30. > SELECT r.name, r.size, r.disk FROM mz_catalog.mz_clusters c, mz_catalog.mz_cluster_replicas r WHERE c.name = 'c' AND c.id = r.cluster_id;
  31. r1 1-no-disk true
  32. r2 1-no-disk true
  33. > DROP CLUSTER c;
  34. # Can toggle whether `DISK` defaults true or false
  35. $ postgres-execute connection=postgres://mz_system:materialize@${testdrive.materialize-internal-sql-addr}
  36. ALTER SYSTEM SET disk_cluster_replicas_default = true
  37. > CREATE CLUSTER c REPLICAS (r1 (SIZE '1-no-disk', DISK), r2 (SIZE '1-no-disk'))
  38. > SELECT r.name, r.size, r.disk FROM mz_catalog.mz_clusters c, mz_catalog.mz_cluster_replicas r WHERE c.name = 'c' AND c.id = r.cluster_id;
  39. r1 1-no-disk true
  40. r2 1-no-disk true
  41. > DROP CLUSTER c;
  42. $ postgres-execute connection=postgres://mz_system:materialize@${testdrive.materialize-internal-sql-addr}
  43. ALTER SYSTEM RESET disk_cluster_replicas_default
  44. # Can disable whether disk-backed replicas are allowed
  45. $ postgres-execute connection=postgres://mz_system:materialize@${testdrive.materialize-internal-sql-addr}
  46. ALTER SYSTEM SET enable_disk_cluster_replicas = false
  47. ! CREATE CLUSTER c REPLICAS (dff_3 (size '1-no-disk', disk))
  48. contains:`WITH (DISK)` for cluster replicas is not available
  49. # Cannot set DISK on unmanaged clusters (the option is per replica)
  50. ! CREATE CLUSTER c REPLICAS (dff_3 (size '1-no-disk')), DISK;
  51. contains:DISK not supported for unmanaged clusters
  52. # The following test that we don't crash envd with bad parameters, and instead just fallback
  53. # to safe parameters.
  54. $ postgres-execute connection=postgres://mz_system:materialize@${testdrive.materialize-internal-sql-addr}
  55. ALTER SYSTEM SET upsert_rocksdb_universal_compaction_ratio = 50;
  56. $ postgres-execute connection=postgres://mz_system:materialize@${testdrive.materialize-internal-sql-addr}
  57. ALTER SYSTEM RESET upsert_rocksdb_universal_compaction_ratio;
  58. $ postgres-execute connection=postgres://mz_system:materialize@${testdrive.materialize-internal-sql-addr}
  59. ALTER SYSTEM SET upsert_rocksdb_parallelism = -1;
  60. $ postgres-execute connection=postgres://mz_system:materialize@${testdrive.materialize-internal-sql-addr}
  61. ALTER SYSTEM RESET upsert_rocksdb_parallelism