danhuawang commented on PR #13674:
URL: https://github.com/apache/gravitino/pull/13674#issuecomment-6818803911

   ### Design follow-up (merged PR): one migration path for in-cluster and 
external databases
   
   When consolidating with #13673, the merged change should use **one shared 
migration implementation** for bundled MySQL/PostgreSQL and external JDBC—not 
this PR’s hook Job **plus** the existing `init-mysql` / `init-postgresql` DDL.
   
   Reference pattern used in mature Gravitino Helm charts:
   
   1. **One migrate script** (ConfigMap or chart file) — all DDL logic lives 
there; templates only wire env, secrets, and volumes.
   2. **One migrate Job** — helpers resolve DB engine/host/credentials for 
in-cluster vs external; the Job always runs the same script.
   3. **Init containers** — `sqlfile` staging only; bundled DB inits become 
**wait-for-schema** (no duplicate `mysql`/`psql` migrate blocks), which 
addresses #11099 for multi-replica rolls on bundled DBs too.
   4. **Hooks** — external DB: `pre-install` / `pre-upgrade` migrate hook is 
OK; bundled DB: avoid `pre-install` deadlock—use a regular Job + wait gate (as 
documented in #13673’s design doc).
   5. **Upgrade behavior** — evolve the shared script toward chained 
`upgrade-*` and avoiding full `schema-*.sql` on existing databases (document 
gaps until implemented).
   
   `entity.initializeSchema` host/port fields should fold into JDBC-driven 
helpers where possible so the merged values surface does not duplicate 
connection config.
   
   ### CI: chart-test upgrade scenarios
   
   Please add **install → upgrade** kind coverage in 
`.github/workflows/chart-test.yaml` (see comment on #13673 for the same CI 
bullet list): bundled DB baseline, upgrade to newer chart/image, assert migrate 
Job success and rollout health. External JDBC upgrade is a valuable second 
matrix row when the merged Job lands.
   
   Fold design + CI into the single combined PR.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to