Skip to main content

compute_dirty_datalog

Function compute_dirty_datalog 

Source
pub(super) fn compute_dirty_datalog(
    changed_stmts: &BTreeSet<ObjectId>,
    base_facts: &BaseFacts,
    forced_dirty_schemas: &BTreeSet<SchemaQualifier>,
) -> (BTreeSet<ObjectId>, BTreeSet<Cluster>, BTreeSet<SchemaQualifier>)
Expand description

Compute dirty objects, clusters, and schemas using fixed-point iteration.

Implements the Datalog rules defined at the top of this module.

forced_dirty_schemas seeds the fixed-point with schemas the caller forces dirty (e.g. stage --redeploy-schema); pass an empty set for pure change-driven dirtiness. Every object in a forced schema, and its downstream dependents, ends up in the dirty set.

Important: Sinks are special - they do NOT propagate dirtiness to clusters or schemas. Sinks write to external systems and are created after the swap during apply, so they shouldn’t cause other objects to be redeployed.