References
- CPS-438Getting issue details... STATUS
Background
Liquibase container attempts restart if it takes too long. Liquibase does not release the changelog lock on the data table if it gets restarted. An init container should be used which will not restart and will run until completion.
Possible Fixes:
Fix | Name | Steps | Positives | Negatives |
---|---|---|---|---|
1 | Liquibase init container |
| Solution proposed by Liquibase | Double changelog dependency? one in oom, one in cps Changes to oom and cps projects |
2 | Change/Add liveness probes? | Liquibase container is restarted by Kubernetes as it does not read a readiness probe within a certain amount of time. We could extend the time limit, change the restart condition etc... | "Hacky" solution | |
3 | Remove Liquibase and replace with similar technology | Replace Liquibase with Flyway | Might come with same issue as Liquibase as is more of a Kubernetes issue? Flyway does not support NoSQL: Neo4J Flyway only does sql changelogs, would have to change from yaml > sql | |
4 | Remove db migration technologies altogether | Remove Liquibase and trigger an sql script that will build the table. | Won't have changelog & rollback unless implement ourselves | |
5 | Use Session lock instead of transaction lock for Liquibase | https://mvnrepository.com/artifact/com.github.blagerweij/liquibase-sessionlock/1.2.5 | Changeloglock will be dropped once session is dropped by Liquibase container | Doesn't stop kubernetes from restarting the container, just makes it so that the changeloglock will not be retained. |
6 | Execute Liquibase logic in Spring Boot Service Start Up | Solution 3: https://localcoder.org/how-to-solve-liquibase-waiting-for-changelog-lock-problem-in-several-pods-in-ope | Liquibase start up is contained within CPS start up so can avoid kubernetes Liquibase setup | Not sure if Liquibase will have its own container or if it will be part of the springboot init container |