crossplane-contrib / crossplane-contrib/function-sequencer
Deletion sequencing usages can be dropped during reconcile when readiness gating short-circuits
- Dominant language
- Go
- Stars
- 37
- Forks
- 19
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 4
Description
## 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
```yaml
- 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.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.