pub static MZ_CLUSTER_DEPLOYMENT_LINEAGE: LazyLock<BuiltinView>
Expand description

Traces the blue/green deployment lineage in the audit log to determine all cluster IDs that are logically the same cluster. cluster_id: The ID of a cluster. current_deployment_cluster_id: The cluster ID of the last cluster in cluster_id’s blue/green lineage. cluster_name: The name of the cluster. The approach taken is as follows. First, find all extant clusters and add them to the result set. Per cluster, we do the following:

  1. Find the most recent create or rename event. This moment represents when the cluster took on its final logical identity.
  2. Look for a cluster that had the same name (or the same name with _dbt_deploy appended) that was dropped within one minute of that moment. That cluster is almost certainly the logical predecessor of the current cluster. Add the cluster to the result set.
  3. Repeat the procedure until a cluster with no logical predecessor is discovered. Limiting the search for a dropped cluster to a window of one minute is a heuristic, but one that’s likely to be pretty good one. If a name is reused after more than one minute, that’s a good sign that it wasn’t an automatic blue/green process, but someone turning on a new use case that happens to have the same name as a previous but logically distinct use case.