fix: auto-sync skipped when newer commit arrives during sync with manifest-generate-paths (#27875)#28227
Open
pepe9012 wants to merge 1 commit into
Open
Conversation
🔴 Preview Environment stopped on BunnyshellSee: Environment Details | Pipeline Logs Available commands (reply to this comment):
|
f23f173 to
05f8217
Compare
…ifest-generate-paths (argoproj#27875) When an app uses the manifest-generate-paths annotation, the revisionsMayHaveChanges optimization was also used to decide whether to run auto-sync. If a newer commit arrived while the app was still syncing, UpdateRevisionForPaths could report no changes, so auto-sync was skipped and the app stayed OutOfSync until a manual sync or controller restart. Only use that optimization to skip manifest regeneration, not to gate the sync decision. When the app is OutOfSync, always compare the desired revision against the last synced one. Drift at the same revision with selfHeal disabled is still left untouched. Signed-off-by: pepe9012 <sotkovsky@gmail.com>
05f8217 to
d8aba1a
Compare
Bundle ReportChanges will increase total bundle size by 1.41kB (0.01%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: argo-cd-ui-array-pushAssets Changed:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #28227 +/- ##
==========================================
+ Coverage 64.71% 64.74% +0.02%
==========================================
Files 423 424 +1
Lines 58437 58668 +231
==========================================
+ Hits 37817 37983 +166
- Misses 17102 17152 +50
- Partials 3518 3533 +15 ☔ View full report in Codecov by Harness. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #27875
What
Applications with an automated sync policy and the
argocd.argoproj.io/manifest-generate-pathsannotation can stop auto-syncingwhen a new commit lands while a sync is already in progress. The application
reports OutOfSync but never syncs, and stays stuck until a manual sync or an
application-controller restart.
Why
With the annotation set, the controller uses the manifest-generate-paths
optimization (
revisionsMayHaveChanges) to decide whether to compare revisionsbefore auto-syncing. If a newer commit B arrives while the app is still synced
to A,
UpdateRevisionForPathscan report no changes, sorevisionsMayHaveChangesis false.
autoSyncthen skips the revision comparison and treats the sync asalready attempted, even though the app is OutOfSync against B. Without selfHeal
nothing recovers it.
The optimization exists to avoid regenerating manifests when only irrelevant
paths change. It should not gate the sync decision itself.
How
At the
autoSynccall site, also compare revisions whenever the app is OutOfSync:The optimization still avoids manifest regeneration, but it can no longer skip a
needed sync. Apps already synced to the target revision are unaffected, and
selfHeal:false apps are still not force-healed for drift at the same revision
(related #26769).
Testing
Added
TestAutoSyncManifestGeneratePathsNewCommitcovering the new-commit case(auto-sync triggers) and the same-revision drift case (no auto-sync with selfHeal
disabled).
Also verified on a live cluster: an app with the annotation, automated sync and
no selfHeal auto-synced to a new in-path commit within 20s, while an off-path
commit was correctly skipped.
Checklist: