-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DatabaseChangeLogLock race condition exists if two nodes both try to create the table on ORACLE #1036
Comments
Thanks for reporting this! We will review and prioritize. If you are able to submit a PR, that will help expedite a fix. |
We implemented a small fix yesterday(actually by checking for the contents of the ORA error message, though I'm not sure if that is the way to go). Unfortunately we ran into another problem thereafter. Context:
Now some of the processes try to execute following SQL statements, but the processes do this with an offset of only a few milliseconds, resulting in the following error below. Therefore we changed our approach and now wait for the 1st process to be completely started before launching the other processes in parallel. Sidenote: We know there are alternative and better approaches to execute liquibase without these issues, but the situation at the customer is as described.
|
@davidcyp I'm assuming that the different modules have different Liquibase changelog sets, otherwise you might not need Liquibase to run for all of them. Another thought on a solution would be to have a Liquibase option to indicate that Liquibase on the other processes should wait for the lock table to exist rather than try to create it. |
@nealeu unfortunately not. These processes all operate on the same tables. We fixed it by writing a small orchestration tool for our processes. ps: I know that designing our codebase differently would also be a fix, but see my initial sidenote ;) |
@davidcyp. Surely in that case, you only need to run Liquibase on the one that you are running first - the others are just spending CPU cycles parsing Liquibase changelogs to find that the original process beat them to it. |
This also affects PostgreSQL @molivasdat (3.10.2) |
Discovered this race condition when upgrading to Liquibase 4.23.1. Recently when upgrading to 4.23.1 from 4.21.1, one of our automated tests for concurrent use failed with As k8s may start several containers we need to handle concurrent use. We use Liquibase-sessionlock to handle concurrent use in the migration scripts. A quick fix from our side will be to create the |
Description
See the description for CORE-2596(https://liquibase.jira.com/browse/CORE-2596). The issue mentioned in CORE-2596 still arises when working with Oracle database.
While the fix for CORE-2596 checks for the message to contain the keyword exists, Oracle responds with the following error message:
_ora-00955 name is already used by an existing object _. Given that the keyword exists is not present in Oracle's description the code to resolve the deadlock is not executed, resulting in the described problem.
The solution is to adapt the if clause in the code implemented to fix the referenced issue.
To Reproduce
See the linked ticket. The application still ends up in a race condition.
Expected behavior
See the linked ticket.
Screenshots
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered: