Skip to content

fix: use sync waves to run migrations before app rollout#677

Merged
Mukil Loganathan (langchain-infra) merged 1 commit into
v14-stablefrom
mukil/sync-waves-migration-ordering
Apr 17, 2026
Merged

fix: use sync waves to run migrations before app rollout#677
Mukil Loganathan (langchain-infra) merged 1 commit into
v14-stablefrom
mukil/sync-waves-migration-ordering

Conversation

@langchain-infra

@langchain-infra Mukil Loganathan (langchain-infra) commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Switches DB migrations from PostSync hooks to sync-wave ordering so migrations complete before application code rolls out
  • Adds sync-wave: "-2" to all database resources (postgres, clickhouse, redis — StatefulSets, Services, Secrets, ServiceAccounts, PDBs, ConfigMaps) so they're healthy first
  • Changes migration Jobs to Sync hooks at sync-wave: "-1" (Argo CD) and post-install, pre-upgrade (Helm) so they run after DBs are up but before Deployments
  • Auth bootstrap remains as PostSync since it depends on the running application

Argo CD sync order

Phase Wave Resources
Sync -2 DB Secrets, ServiceAccounts, Services, StatefulSets
Sync -1 PG + CH migration Jobs
Sync 0 Application Deployments/Rollouts
PostSync Auth bootstrap, agent bootstrap

Helm behavior

  • First install: post-install — DBs are already deployed, migrations run after
  • Upgrades: pre-upgrade — migrations run before new app code rolls out

Test plan

  • Verify helm template renders without errors
  • Test fresh Argo CD install — DBs should come up at wave -2, migrations at -1, then app at 0
  • Test Argo CD upgrade — migrations should complete before deployments update
  • Test Helm upgrade — migrations should run as pre-upgrade hooks before new code
  • Verify auth-bootstrap still runs after app is up

🤖 Generated with Claude Code

DB migrations currently run as PostSync hooks, meaning application code
rolls out before migrations complete. This switches to sync-wave ordering
so that databases are healthy (wave -2) and migrations finish (wave -1)
before deployments roll out (wave 0).

For Helm, migrations change from post-upgrade to pre-upgrade so they run
before new code on upgrades, while keeping post-install for first installs
when databases aren't yet available.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@langchain-infra
Mukil Loganathan (langchain-infra) merged commit c7ff8ae into v14-stable Apr 17, 2026
3 checks passed
@langchain-infra
Mukil Loganathan (langchain-infra) deleted the mukil/sync-waves-migration-ordering branch April 17, 2026 15:45
Mukil Loganathan (langchain-infra) added a commit that referenced this pull request Apr 20, 2026
DB migrations currently run as PostSync hooks, meaning application code
rolls out before migrations complete. This switches to sync-wave ordering
so that databases are healthy (wave -2) and migrations finish (wave -1)
before deployments roll out (wave 0).

For Helm, migrations change from post-upgrade to pre-upgrade so they run
before new code on upgrades, while keeping post-install for first installs
when databases aren't yet available.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Mukil Loganathan (langchain-infra) added a commit that referenced this pull request Apr 20, 2026
* added .Values.commonEnv to hostBackend

* fix: use sync waves to run migrations before app rollout (#677)

DB migrations currently run as PostSync hooks, meaning application code
rolls out before migrations complete. This switches to sync-wave ordering
so that databases are healthy (wave -2) and migrations finish (wave -1)
before deployments roll out (wave 0).

For Helm, migrations change from post-upgrade to pre-upgrade so they run
before new code on upgrades, while keeping post-install for first installs
when databases aren't yet available.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* chore: remove feedback migration jobs and configurations (#682)

The feedback-data-migration and feedback-config-migration Jobs ran
one-shot scripts (migrate-feedback-to-postgres.pyc,
migrate-feedback-config.pyc) that are no longer shipped in the backend
image. Both were disabled by default. Removes the templates and all
values.yaml/ci fixture/README references.

* chore: bump appVersion and image tags to 0.14.3 (#684)

* chore: bump appVersion and image tags to 0.14.2

* chore: bump appVersion and image tags to 0.14.3

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix: restore frontend.enabled default lost in rebase

The v14-stable branch did not have frontend.enabled, but main added
it as true. Rebase took v14-stable's file wholesale, dropping the
default. New validate.yaml requires it when ingress is enabled.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Joaquin Borggio <joaquin@langchain.dev>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

2 participants