Add changelog file path to upToDateFastCheck cache key (#4891) #5039
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Impact
Description
Fixes #4891.
Update the
isUpToDateFastCheckmethod to include the changelog file path in the cache key, preventing the bug reported in the issue, as suggested by @nwwerum.I also created a simple Spring app with steps to reproduce this bug, you may find it here https://github.com/ggwadera/liquibase-bug-4891.
Things to be aware of
None as far as I know.
Things to worry about
This bug was not captured in any of the automated tests. I tried to include a unit test for this but unfortunately I couldn't get it working. Would gladly accept any suggestions for this.
Additional Context
From my testing, this bug only happens with an already initialized database. When more than one
SpringLiquibasebeans are present, the first ones that have already been applied causes theisUpToDateFastCheckcache key to be marked as up-to-date. This prevents the following changelogs to be executed, as the cache key is the same for all of them.