cluster_deployment_lineage.slt 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. mode cockroach
  10. # Start from a pristine server
  11. reset-server
  12. # Test: Create a cluster and verify blue/green lineage
  13. # Create the clusters for blue/green deployment
  14. statement ok
  15. CREATE CLUSTER blue_green (SIZE = '1');
  16. statement ok
  17. CREATE CLUSTER blue_green_dbt_deploy (SIZE = '1');
  18. # Create a cluster that is not part of the blue/green deployment
  19. statement ok
  20. CREATE CLUSTER non_blue_green (SIZE = '1');
  21. query TT
  22. SELECT id, name FROM mz_clusters WHERE id IN ('u2', 'u3', 'u4') ORDER BY id;
  23. ----
  24. u2 blue_green
  25. u3 blue_green_dbt_deploy
  26. u4 non_blue_green
  27. # Initiate the blue/green deployment
  28. statement ok
  29. ALTER CLUSTER blue_green_dbt_deploy SWAP WITH blue_green;
  30. statement ok
  31. DROP CLUSTER blue_green_dbt_deploy;
  32. # Verify the blue/green lineage
  33. query TTT
  34. SELECT cluster_id, current_deployment_cluster_id, cluster_name
  35. FROM mz_internal.mz_cluster_deployment_lineage
  36. WHERE cluster_id IN ('u2', 'u3', 'u4')
  37. ORDER BY cluster_id;
  38. ----
  39. u2 u3 blue_green
  40. u3 u3 blue_green
  41. u4 u4 non_blue_green