Skip to main content

validate_cluster_isolation

Function validate_cluster_isolation 

Source
pub(crate) fn validate_cluster_isolation(
    project: &Project,
    sources_by_cluster: &BTreeMap<String, Vec<String>>,
) -> Result<(), (String, Vec<String>, Vec<String>)>
Expand description

Validate that sources and sinks don’t share clusters with indexes or materialized views.

This validation prevents accidentally recreating sources/sinks when updating compute objects. During a blue/green swap, all objects on a cluster are affected — mixing storage and compute objects on the same cluster means a view update could trigger source recreation.

§Arguments

  • project - The project graph to validate
  • sources_by_cluster - Map of cluster name to list of source FQNs from the database

§Returns

  • Ok(()) if no conflicts found
  • Err((cluster_name, compute_objects, storage_objects)) if conflicts detected