Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better handle property dependencies and deletedWith #16088

Merged
merged 1 commit into from
May 3, 2024

Commits on May 3, 2024

  1. Better handle property dependencies and deletedWith

    A resource `A` depends on a resource `B` if:
    
    1. `B` is `A`'s `Provider`.
    2. `B` is `A`'s `Parent`.
    3. `B` appears in `A`'s `Dependencies`.
    4. `B` appears in one or more of `A`'s `PropertyDependencies`.
    5. `B` is referenced by `A`'s `DeletedWith` field.
    
    While cases 1, 2, and 3 (providers, parents, and dependencies) are
    handled fairly consistently, there have been a number of cases where the
    newer features of `PropertyDependencies` (case 4) and `DeletedWith`
    (case 5) have been neglected. This commit addresses some of these
    omissions. Specifically:
    
    * When refreshing state, it's important that we remove URNs that point
      to resources that we've identified as deleted. Presently we check
      pointers to parents and dependencies, but not property dependencies or
      `deletedWith`. This commit fixes these gaps where dangling URNs could
      lurk.
    
    * Linked to the above, this commit extends snapshot integrity checks to
      include property dependencies and `deletedWith`. Some tests that
      previously used now invalid states have to be repaired or removed as a
      result of this.
    
    * Fixing snapshot integrity checking reveals that dependency graph
      checks also fail to consider property dependencies and `deletedWith`.
      This probably hasn't bitten us since property dependencies are
      currently rolled up into dependencies (for temporary backwards
      compatibility) and `deletedWith` is typically an optimisation
      (moreover, one that only matters during deletes), so operations being
      parallelised due a perceived lack of dependency still succeed.
      However, tests that previously passed now fail as we can spot these
      races with our better integrity checks. This commit thus fixes up
      dependency graph construction and bulks out its test suite to
      cover the new cases.
    lunaris committed May 3, 2024
    Configuration menu
    Copy the full SHA
    2d03708 View commit details
    Browse the repository at this point in the history