How to fix Liquibase database lock that does not get cleared

5/11/2019

I'm using liquibase in project and it is working fine so far.
I added a new changeset and it works good locally, once deployed , the container's state hungs with the following statement: "liquibase: Waiting for changelog lock...".

The limit resources of the deployment are not set.
The update of table "databasechangeloglock" is not working, cause the pod keeps locking it.
How can i solve this?

-- maryam
kubernetes
kubernetes-pod
liquibase

1 Answer

5/11/2019

If you are completely sure that there is no active migration (pod) running, you can manually release the lock:

UPDATE <your table name> (f.e. DATABASECHANGELOG)

SET locked=false, lockgranted=null, lockedby=null

WHERE id=1;

Usually the lock is cleared automatically, you might want to check your isolation level for the database connection as well.

-- Thomas
Source: StackOverflow