Comments (2)
This seems like a problem in Liquibase itself (not the lock implementation). You'll notice these lines in pod #3:
INFO 2023-08-29T11:06:10.703Z Successfully acquired change log lock
INFO 2023-08-29T11:06:13.105Z Reading from rfid.DATABASECHANGELOG
INFO 2023-08-29T11:06:13.382Z Successfully released change log lock
At this time, the second pod has not finished, so the DATABASECHANGELOG will not have the changeset marked as done.
Then later, after it acquired the lock again, it will execute the changesets which it think still need execution, but it does not reread from the DATABASECHANGELOG table.
Either Liquibase should not release the lock between the read and execute, or it should reread from the DATABASECHANGELOG table. Are you able to upgrade to the latest version of Liquibase, to see if the problem is still present in the latest version?
It would be nice to include an integration test for your scenario, but I also realize it might be hard to implement.
from liquibase-sessionlock.
Thank you for your answer, after some more testing, debugging and digging through Liquibase release notes, I think I found why the lock is released after readnig the rfid.DATABASECHANGELOG
table: Liquibase Issue.
For some reason without liquibase-sessionlock
the change set was never applied twice in my tests, but with it it was always applied twice.
The releasing of the lock was fixed in Liquibase v4.4.1, so I upgraded our Spring Boot version to 2.7.15
which uses Liquibase version 4.9.1
, and ran my tests again, the lock was not released between reading the rfid.DATABASECHANGELOG
table and applying the change set, with or without liquibase-sessionlock
.
It was just a coincidence, that after adding the liquibase-sessionlock
dependency I started to notice the change set applying twice.
Thank you again for your answer, I'll close this issue.
from liquibase-sessionlock.
Related Issues (12)
- Oracle, getChangeLogLockName() return wrong handle HOT 2
- Sessionlock breaks "dropAll" ? HOT 6
- java.lang.NoClassDefFoundError: liquibase/Scope Liquibase 3.5.2 Spring Boot 1.5.15 HOT 5
- Sessionlock not detected when imported as non direct dependency HOT 2
- NPE at startup when using Spring Native HOT 3
- DatabaseChangeLogLock table is not initialized in an empty Postgres database HOT 2
- Vulnerability -2022-0839 HOT 1
- CockroachDB support HOT 4
- Cannot acquire lock when running integration tests with liquibase dropAll
- Liquibase failure due to long user-level lock name HOT 2
- Don't support CockroachDB & don't fail if it's there
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from liquibase-sessionlock.