LiJie20190102 opened a new issue, #14312:
URL: https://github.com/apache/gravitino/issues/14312

   ### What would you like to be improved?
   
   The MySQL upgrade scripts are not retryable today. If an upgrade fails 
halfway, the already-applied statements (e.g. `CREATE INDEX`, `ALTER TABLE ... 
ADD COLUMN`, `DROP INDEX`, `RENAME INDEX`) make the re-run fail, so users 
cannot recover by simply retrying the script.
   
   This is split out of #12516 during the review of #12968: that PR keeps only 
the PostgreSQL `IF NOT EXISTS` changes, because MySQL 8.0 does not support 
`CREATE INDEX IF NOT EXISTS` and guarding only index creation does not make the 
whole MySQL upgrade retryable.
   
   Note the 1.3.0-to-2.0.0 upgrade scripts are already retryable thanks to 
#13689; this issue targets the remaining MySQL scripts 
(`upgrade-0.5.0-to-0.6.0-mysql.sql` through `upgrade-1.2.0-to-1.3.0-mysql.sql`).
   
   
   
   ### How should we improve?
   
   Make all DDL in the remaining MySQL upgrade scripts idempotent, e.g. with 
`information_schema`-guarded prepared statements or stored procedures:
   
   - `AddColumnIfMissing` for `ALTER TABLE ... ADD COLUMN`
   - `DropIndexIfExists` / `RenameIndexIfExists`
   - `CreateIndexIfNotExists` for `CREATE [UNIQUE] INDEX`
   
   Unexpected schema differences should still be reported rather than silently 
accepted, and the retry behavior should be documented in the upgrade guide, 
similar to what #13689 did for the 1.3.0-to-2.0.0 scripts.


-- 
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