devops7 min read

When a sync window closes: How Argo CD self-heal skipped the migration hook

1 similar post
  • Argo CD
  • Kubernetes
  • Helm

AI Summary

An analysis of an Argo CD race condition where deployments pushed during a deny sync window result in self-heal triggering a partial sync that skips database migration hooks. Depending on whether a level-1 or level-2 refresh wins the race upon window closure, the application may transition to a synced state with new code running against an unmigrated schema.

Key Takeaways

  • Argo CD self-heal handles drift by performing a partial sync, which inherently skips all sync hooks.
  • A level-1 refresh can mistake the last compared revision for the last synced revision, concluding there are no changes except for drift.
  • Moving migrations into the declarative desired state using sync waves and release-specific names ensures they execute during any sync path.

Why it matters

Database migrations tied exclusively to Sync hooks can silently fail when combined with automated sync windows and self-heal, leading to production outages where new application code runs against old database schemas.

Conversation0

What would you add from your experience?

Checking your session…

Every good conversation starts with one perspective.