-
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
change at 4.19.1 makes includeAll is finding duplicates #3881
Comments
It's not caused by includeAll. We're not using includeAll, but some of our change sets are also broken In our case it was actually a mistake in an included changelog file that re-included the same files again. Apparently there used to be duplicate-detection that removed these duplicates. |
Hello @bmoregeo , I believe that @hylkevds comment is right, it's not related to include all but to a performance fix introduced to how we load changesets. In fact allowing duplicated changesets to be processed was a bug and not a feature, but the bug lived so long that seems it became a feature - and as such it should be on a major release and with better documentation, sorry for that. |
@filipelautert, yes I'm sure it will work if I remove the includeAll. My issue is that we originally named the changelogs poorly and this resulted in changesets being executed out of sequence. 1.10.0 was executing before 1.2.0 etc. The fix was to name all of the poorly named changesets into the root xml in the correct order and then use the catchall includeAll to get all the correctly formatted stuff. I'll play around with the it and see if I can come up with a better solution given the new constraints. Thanks! |
@bmoregeo thanks for the feedback! If you are willing to skip 4.19.1 , we are discussing about using "strict" flag on 4.20.0 to bypass it, as we were not expecting this issue with includes (ie none of our tests were addressing this case yet). The change may be: if strict is set then don't allow duplicates; otherwise use the old behavior. |
@filipelautert we just stumbled over this while trying to update from 4.19.0. We've had duplicated In our case it is easy to fix by removing the redundant include, so it's not a big issue, but it took some time to figure out why it used to work in 4.19.0. |
@bodewig not yet, it still in our dev queue. Hopefully it will be released in the next version. |
This ticket requires manual testing. Depending on developer tests and implementation, we may also need to add a functional test. |
Same here with Quarkus 3.2.2 that uses Liquibase 4.20.0, also on empty database (e.g. fresh mariadb testcontainer). |
Turns out that #3790 clashes with So if you have a changelog in folder x which includes other changelogs in subfolders of x and you say includeAll x from some other changelog, then there are of course duplicates. |
Hi, As far as I can tell, this issue does not only apply to includeAll, but also to the regular include. Up to 4.19.0 the following was allowed:
From 4.20.0 on the startup fails, as 001 is recognized as a forbidden duplicated entry. So I wonder if the fix of this issue will also restore the old behavior in regard of this situation. In my opinion this is a regression. Best regards Nils |
Hi, Any news or plans on this topic? With the current Spring Boot version (3.2.0) a downgrade of Liquibase to 4.19.0 is no longer possible, due to a ClassNotFoundException (e.g., liquibase.UpdateSummaryEnum). So this issue became a blocker for us. Best regards Nils |
@nils-christian @famod thanks for the examples, let me see if I manage to reproduce it and find a fix. |
@nils-christian @famod I created PR #5296 as a possible solution for this problem. |
Sounds good to me, @filipelautert. Thank you. Who would be responsible for adding this property to org.springframework.boot.autoconfigure.liquibase.LiquibaseProperties as well? |
@nils-christian as this is a liquibase global parameter, it should work if you start springboot with parameter
And you will need to add github repository to your maven settings as explained here -> https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry .
|
Hi @filipelautert, Unfortunately, I just realized that the issue is a little bit deeper than we originally thought and that the fix does not solve it. If we modify my above example and let the changeset create a table named "A" we get an error during the execution, as the table exists already. This means the regression does not only affect the duplication check but also the actual execution.
So I think the regression is a little bit more serious than I originally thought. Best regards, Nils |
@nils-christian ah, good catch. I found out the issue: I was ignoring the error and adding the duplicated changeset; now I fixed it and I'm ignoring the duplicated changeset thus not triggering the error. |
Hi @filipelautert, Yes, this looks better. The example works now as expected, thank you very much. |
@filipelautert So has this truly been fixed? If not what is the workaround? |
Hi @mdimond - we added a new flag that enables the old behavior. For command line you can use |
@filipelautert Just so I am clear I can add the following to my properties file: |
@mdimond yes, you are right. |
Hi @filipelautert: Can you estimate when this release will happen? :) |
@RiVogel hopefully by today or tomorrow! |
Hello! Was this fix included in 4.25.1? I tried today to execute h2 tests with liqubase migrations and |
Hi @muzuro - yes, this has been included in 4.25.1 . If you are executing liquibase from the command line please try to use flag |
@filipelautert I am actually executing spring boot tests with gradle. So command line looks like: I have tried to create reproduce project but it works even without new property, so I am little confused why it don't works at main project UPD: I updated reproduce project with README and added test |
@filipelautert I don't think a global parameter is a great idea for those who are using the springboot integration of liquibase. This means I have to add a command line param in 3 places: On my local machine, in my CI/CD environment and my runtime environment. Unless I made a mistake it seems setting on a side note:
I have this folder structure:
I'm including the init folder first:
and after that I want to introduce the changesets directory:
Obviously we can see how recursion would cause duplicate identifiers here, I expected setting min and maxDepth to 0 would fix this but instead it causes an error to be thrown regarding the |
We can also set |
Search first
Description
Granted our change log is pretty janky due to some not great decisions when we started out with this repo, but it was working with 4.19.0. The update with 4.19.1 is now raising an exception that we have duplicate changelogs defined. Previously the final changelog lookup would skip over the existing changelogs that were defined.
Steps To Reproduce
Actual Behavior
Expected/Desired Behavior
Go back to how it was or document a fix moving forward?
Liquibase Version
4.19.1
Database Vendor & Version
postgresql
Liquibase Integration
Github Action
Liquibase Extensions
None
OS and/or Infrastructure Type/Provider
Ubuntu
Additional Context
No response
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: