You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using argocd.argoproj.io/sync-options: Replace=true,Force=true sync options on a resource, you can end up in a sync deadlock when dealing with the creation or deletion of dependant resources.
For example, if you have a statically provisioned PV and a PVC claiming that PV via the spec.volumeName field, you have to specify a sync order using sync waves to get it to work.
It should be possible to sync new configuration on resources which are immutable by opting in to recreating them. However, if these resources have dependants, finalizers can deadlock the sync. This is because a recreation (i.e. Replace=true,Force=true) is a delete action followed by a create.
Sync waves are thought out in this regard such that during pruning, sync waves are run in reverse order. However, this logic also needs to apply to resources marked for recreation. If I have two resources marked for recreation, the one with the greater sync wave should be deleted first, but creation should then occur in ascending sync wave order.
In summary, resources marked with Replace=true,Force=true will be deleted and as such should be considered pruned (in effect) and therefore be taken care of during a pruning round prior to syncing. If this can be problematic, at least a new sync option could be added to handle recreation explicitly as a "delete in reverse order before performing the sync" functionality.
Version
2.12.2+560953c
The text was updated successfully, but these errors were encountered:
Checklist:
argocd version
.Describe the bug
When using
argocd.argoproj.io/sync-options: Replace=true,Force=true
sync options on a resource, you can end up in a sync deadlock when dealing with the creation or deletion of dependant resources.For example, if you have a statically provisioned PV and a PVC claiming that PV via the
spec.volumeName
field, you have to specify a sync order using sync waves to get it to work.To Reproduce
Approach 1
Unable to update
Create
Delete
Update
Approach 2
Unable to delete
Create
Delete
Update
Expected behavior
It should be possible to sync new configuration on resources which are immutable by opting in to recreating them. However, if these resources have dependants, finalizers can deadlock the sync. This is because a recreation (i.e. Replace=true,Force=true) is a delete action followed by a create.
Sync waves are thought out in this regard such that during pruning, sync waves are run in reverse order. However, this logic also needs to apply to resources marked for recreation. If I have two resources marked for recreation, the one with the greater sync wave should be deleted first, but creation should then occur in ascending sync wave order.
In summary, resources marked with Replace=true,Force=true will be deleted and as such should be considered pruned (in effect) and therefore be taken care of during a pruning round prior to syncing. If this can be problematic, at least a new sync option could be added to handle recreation explicitly as a "delete in reverse order before performing the sync" functionality.
Version
The text was updated successfully, but these errors were encountered: