Skip to content

Deletion sequencing usages can be dropped during reconcile when readiness gating short-circuits #121

@fabioaraujopt

Description

@fabioaraujopt

What happened?

With enableDeletionSequencing: true, usage resources are expected to remain consistently desired while participating resources still exist.

In practice, a reconcile can short-circuit on readiness gating (desired == 0 || desired != readyResources) before generating all deletion usages for the current sequence step. Because usages are rebuilt each run from an empty map, previously generated usages that are not re-emitted can disappear from desired state and then be garbage-collected, which can loosen deletion ordering.

Minimal example

- step: sequence
  functionRef:
    name: function-sequencer
  input:
    apiVersion: sequencer.fn.crossplane.io/v1beta1
    kind: Input
    enableDeletionSequencing: true
    replayDeletion: true
    usageVersion: v2
    resetCompositeReadiness: true
    rules:
      - sequence:
          - '^a$'
          - '^b$'
          - '^c$'

Repro outline

  1. a, b, and c are all created and usages are generated.
  2. Start deletion (foreground cascade).
  3. During teardown/reconcile churn, a gating condition for one sequence step fails (desired == 0 or not fully ready), causing early break in that step.
  4. Some previously existing usage edges are not re-emitted in that run.
  5. Missing usages are removed from desired and may be garbage-collected, allowing broader-than-expected deletion concurrency.

Expected behavior

When enableDeletionSequencing is enabled, usage edges should be generated/stable based on observed composed resources and sequence relationships, independent of transient creation readiness gating paths.

Notes

This appears adjacent to (but distinct from) the usage endless-loop fix in #93/#94. The issue here is usage edge stability under readiness short-circuit paths.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions