You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Inside the validate() method, the ranChangeSetList (from StandardChangeLogHistoryService) is created and filled with the values from the change log table
in the update() a lock on the table is created
the content on the table is not read again, the cached ranChangeSetList is used. -> so both services that loaded the ranChangeSetList before any change, will try to run the new changesets.
Hi @joggeli34 - just a note that this error only happens when executing 2 processes: if you run 2 threads you get the following error:
Exception in thread "Thread-13" Exception in thread "Thread-12" java.lang.RuntimeException: liquibase.exception.LiquibaseException: java.lang.RuntimeException: Cannot end scope nvazcrkxnr when currently at scope awqeyfxdhb
at liquibase.dbtest.pgsql.RunnableProblem.run(PostgreSQLIntegrationTest.java:234)
at java.base/java.lang.Thread.run(Thread.java:829)
Anyway I'm working on that, thanks for the report.
PR #3396 adresses this issue and will fix your scenario. But as you aim for performance, I would suggest another approach as using the current code you will be loading the changeset twice (one to validate and the second to update). My suggestion would be to manage the lock within your code, thus keeping the cache in memory. Something like that:
By holding the lock you will prevent Liquibase from reloading the caches. This code works with current versions of Liquibase, you don't need to wait for the next release with the associated PR to start using it.
Environment
Liquibase Version: 4.9.0
Liquibase Integration & Version: Quarkus 2.8.1
Liquibase Extension(s) & Version:
Database Vendor & Version: PSQL
Operating System Type & Version:
Description
When creating a liquibase instance and use them for two commands, the lock is not working correctly.
We have following code:
Following happens:
validate()
method, theranChangeSetList
(fromStandardChangeLogHistoryService
) is created and filled with the values from the change log tableupdate()
a lock on the table is createdranChangeSetList
is used. -> so both services that loaded theranChangeSetList
before any change, will try to run the new changesets.Steps To Reproduce
Create following code:
Run the code twice in parallel.
Actual Behavior
The new changesets will be applied twice.
Expected/Desired Behavior
The
ranChangeSetList
is revalidated during the duration of the lock, and so the changes are applied only onceThe text was updated successfully, but these errors were encountered: