Skip to content

fix: migration deadlock under helm --atomic --wait#206

Draft
vishnu-narayanan wants to merge 1 commit into
mainfrom
fix/cw-7008-migration-pattern
Draft

fix: migration deadlock under helm --atomic --wait#206
vishnu-narayanan wants to merge 1 commit into
mainfrom
fix/cw-7008-migration-pattern

Conversation

@vishnu-narayanan

Copy link
Copy Markdown
Member

Summary

The post-install/post-upgrade migration hook deadlocks under helm upgrade --install --atomic --wait. Web pods can't pass their /health probe before the schema is created (Rails AccountDashboard class-load queries installation_configs), but Helm waits for web Ready before firing the post-install hook. Affects DigitalOcean Marketplace installs (chatwoot/chatwoot#14360) and any user passing --atomic --wait.

Changes

  • migrations-job.yaml -> plain batch/v1 Job (no helm.sh/hook annotation), version-suffixed name via new chatwoot.jobSuffix helper, ttlSecondsAfterFinished: 86400.
  • web-deployment.yaml + worker-deployment.yaml -> wait-for-migrations initContainer that polls postgres with pg_isready, then waits for the installation_configs table to exist.
  • values.yaml -> drop hooks.migrate.hookAnnotation (no longer used).

Pattern mirrors GitLab's official chart: regular Job + wait-for-deps initContainer on app pods.

Validated

Fresh DOKS cluster, all four scenarios pass with --atomic --wait:

  • Fresh install with the DO Marketplace command.
  • Upgrade from broken 2.0.22 to fixed chart.
  • Same-version no-op upgrade.
  • Chart-version bump (replays migration with new Job name).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant