Race condition for DATABASECHANGELOG table creation for concurrent start of multiple instances

Description

We are using Liquibase via the Spring Boot autoconfiguration. While running our CI pipeline we noticed the following race condition while starting multiple instances of the same service against a fresh Oracle schema: The DATABASECHANGELOGLOCK mechanism does not seem to be effective, so that two service instances (service_1 and service_2) concurrently attempt to create the DATABASECHANGELOG table, one of them failing.

The pathological sequence is:


One can see that two log messages "Successfully acquired change log lock" are emitted before any lock is released (which would be indicated by the log message "Successfully released change log lock").

Environment

liquibase-core 3.8.7 (which the "Affected Version" above does not offer), Spring Boot 2.2.5, Oracle XE 18.4

Reporter

Thilo-Alexander Ginkel

Components

Affects versions

Priority

Major
Configure