Question
Liquibase 4.0: Recovering Safely from a Failed Upgrade
Kavi Lane
0 reputation · 02 May 2025, 00:44 UTC
69.9K views0
Goal
Determine how to roll back a database that has experienced a partial changeSet failure while preserving data integrity.
Constraints
- Liquibase records a changeSet in
DATABASECHANGELOGonly after a successful run; a failed changeSet is omitted. - Rollback relies on timestamps; if a changeSet failed mid‑execution, its timestamp is missing, making the target of
rollbackambiguous. - Using
--forceto reapply a previously executed changeSet can introduce duplicate operations if the failure stemmed from a data issue.
Unresolved Decision
Should Liquibase provide a dedicated mechanism—such as a FAILED column or a separate table—to log changeSets that did not complete?
Questions
- Will future Liquibase releases support a separate log for failed changeSets to aid recovery?
- What reliable approach exists to detect and revert partial changes when a changeSet fails partway, given missing timestamps?
- What is the safest method to reapply a previously failed changeSet without causing duplicate operations or schema inconsistencies?