123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- # Copyright Materialize, Inc. and contributors. All rights reserved.
- #
- # Use of this software is governed by the Business Source License
- # included in the LICENSE file at the root of this repository.
- #
- # As of the Change Date specified in that file, in accordance with
- # the Business Source License, use of this software will be governed
- # by the Apache License, Version 2.0.
- $ set-arg-default replicas=1
- $ set-arg-default default-replica-size=1
- # The expected number of rows in system tables depends on the number of replicas
- $ skip-if
- SELECT ${arg.replicas} > 1;
- $ postgres-connect name=mz_system url=postgres://mz_system:materialize@${testdrive.materialize-internal-sql-addr}
- $ postgres-execute connection=mz_system
- > SELECT name FROM (SHOW CLUSTERS)
- mz_analytics
- mz_system
- mz_catalog_server
- quickstart
- mz_probe
- mz_support
- $ postgres-execute connection=mz_system
- > select managed from mz_catalog.mz_clusters where id like 's%';
- true
- true
- true
- true
- true
- $ postgres-execute connection=postgres://mz_system@${testdrive.materialize-internal-sql-addr}/materialize
- ALTER SYSTEM SET enable_rbac_checks TO false
- ! DROP CLUSTER mz_system CASCADE
- contains:must be owner of CLUSTER mz_system
- ! DROP CLUSTER mz_catalog_server CASCADE
- contains:must be owner of CLUSTER mz_catalog_server
- $ postgres-execute connection=postgres://mz_system@${testdrive.materialize-internal-sql-addr}/materialize
- ALTER SYSTEM SET enable_rbac_checks TO true
- ! DROP CLUSTER mz_joe CASCADE
- contains:unknown cluster 'mz_joe'
- ! CREATE CLUSTER mz_joe REPLICAS (r1 (size '1'))
- contains:cluster name "mz_joe" is reserved
- $ postgres-execute connection=postgres://mz_system@${testdrive.materialize-internal-sql-addr}/materialize
- ALTER SYSTEM SET enable_rbac_checks TO false
- ! CREATE CLUSTER REPLICA mz_system.r2 SIZE '1';
- contains: cannot modify managed cluster mz_system
- ! DROP CLUSTER REPLICA mz_system.r1;
- contains:must be owner of CLUSTER REPLICA mz_system.r1
- ! ALTER CLUSTER mz_system SET (SIZE='2');
- contains: must be owner of CLUSTER mz_system
- $ postgres-execute connection=postgres://mz_system@${testdrive.materialize-internal-sql-addr}/materialize
- ALTER SYSTEM SET enable_rbac_checks TO true
- > CREATE MATERIALIZED VIEW mv AS SELECT AVG(50)
- > SET CLUSTER TO mz_catalog_server
- > SHOW MATERIALIZED VIEWS
- mv quickstart ""
- #! CREATE MATERIALIZED VIEW mv1 AS SELECT MIN(1)
- #contains:system cluster 'mz_catalog_server' cannot be modified
- > SET CLUSTER TO mz_system
- # Query gets automatically run on mz_catalog_server, despite mz_system being set
- > SHOW MATERIALIZED VIEWS
- mv quickstart ""
- #! CREATE MATERIALIZED VIEW mv1 AS SELECT MIN(1)
- #contains:must be owner of CLUSTER mz_system
- > SET CLUSTER TO quickstart
- > CREATE TABLE temp (a INT)
- > INSERT INTO temp VALUES (1), (2)
- $ postgres-execute connection=mz_system
- SET CLUSTER TO mz_system
- INSERT INTO temp SELECT * FROM temp
- > SELECT * FROM temp
- 1
- 2
- 1
- 2
- # Ready is false in the process orchestrator, but true in K8s
- $ set-regex match=true|false replacement=<TRUE_OR_FALSE>
- > SHOW CLUSTER REPLICAS WHERE cluster = 'mz_system'
- mz_system r1 bootstrap <TRUE_OR_FALSE> ""
- > SELECT COUNT(*) FROM mz_catalog.mz_cluster_replicas as r, mz_catalog.mz_clusters as c WHERE r.cluster_id = c.id and c.name = 'mz_support';
- 0
- ! ALTER CLUSTER mz_support SET (replication factor 1, size '2');
- contains: must be owner of CLUSTER mz_support
- $ postgres-execute connection=postgres://mz_support@${testdrive.materialize-internal-sql-addr}/materializeI
- ALTER CLUSTER mz_support SET (replication factor 0, size '1');
- $ unset-regex
- > select name, introspection_debugging from mz_catalog.mz_clusters where name IN ('quickstart', 'mz_support');
- name introspection_debugging
- ------------------------
- quickstart false
- mz_support false
- ! ALTER CLUSTER quickstart SET (introspection debugging = TRUE);
- contains: must be owner of CLUSTER quickstart
- ! ALTER CLUSTER mz_support SET (introspection debugging = TRUE);
- contains: must be owner of CLUSTER mz_support
- $ postgres-execute connection=postgres://mz_support@${testdrive.materialize-internal-sql-addr}/materializeI
- ALTER CLUSTER mz_support SET (introspection debugging = TRUE);
- > select name, introspection_debugging from mz_catalog.mz_clusters where name IN ('quickstart', 'mz_support');
- quickstart false
- mz_support true
- $ postgres-execute connection=postgres://mz_support@${testdrive.materialize-internal-sql-addr}/materializeI
- ALTER CLUSTER mz_support SET (introspection interval = '10ms');
- > select name, introspection_debugging, introspection_interval from mz_catalog.mz_clusters where name = 'mz_support';
- mz_support true "00:00:00.01"
- $ postgres-execute connection=postgres://mz_support@${testdrive.materialize-internal-sql-addr}/materializeI
- ALTER CLUSTER mz_support SET (introspection interval = '0s');
- > select name, introspection_debugging, introspection_interval from mz_catalog.mz_clusters where name = 'mz_support';
- mz_support true <null>
|