Failure to start Ververica Platform due to left-over lock

Issue

Ververica Platform startup fails, and the logs of the gateway container show the following exception:

liquibase.executor.jvm.JdbcExecutor : SELECT LOCKED FROM DATABASECHANGELOGLOCK WHERE ID=1
l.lockservice.StandardLockService : Waiting for changelog lock....

Environment

  • Ververica Platform version: 2.1 or later
  • vvp.persistence set to anything but legacy

Resolution

Run the following command against your database to manually delete the stale lock that is preventing the startup:

SQLite

UPDATE DATABASECHANGELOGLOCK SET LOCKED=0;

Other Databases

UPDATE DATABASECHANGELOGLOCK SET LOCKED=FALSE;

This will allow the gateway container to start.

Cause

On application startup, Ververica Platform performs a schema migration of its metadata store if its schema has changed. It takes the database lock, verifies the schema, changes the schema (if necessary), and releases the lock again. If you (or Kubernetes) interrupt the pod at any time between these steps, you may run into a race condition in the Spring application signal handling that may not release the database lock. If this lock still exists during startup, it will prevent the migration step and fail with the error shown above.

Related Information