Which version and edition of Flyway are you using?
Spring Boot integration (Boot 2.1.3, Flyway 5.2.4)
If this is not the latest version, can you reproduce the issue with the latest one as well?
(Many bugs are fixed in newer releases and upgrading will often resolve the issue)
Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)
Which database are you using (type & version)?
Which operating system are you using?
Kubernetes -> Docker -> debian:stretch
What did you do?
(Please include the content causing the issue, any relevant configuration settings, the SQL statement that failed (if relevant) and the command you ran.)
PostgreSQL is configured in cluster mode with load balancing using PgPool II. The issue is that when Flyway runs the migration in DbMigrate#migrateAll in while loop it executes during first iteration and metadata is successfully written to master node. But immediately after that next iteration is updating local Flyway cache in JdbcTableSchemaHistory#refreshCache that is sent to Read slave that sometimes had not yet replicated from master. Migration is not read to cache and executes second time with either failing on existing table or corrupting data.
What did you expect to see?
Cache update should be either transactional to guarantee it would be send to master, or there should be some retry mechanism.
What did you see instead?
Duplicated execution of same migration.
The text was updated successfully, but these errors were encountered:
Don't know if it would be compatible with our boot version and other third-parties... Basically, I believe, making read transactional may be enough, but as for me the idea with while-true loop is not obvious. Don't see when it could be helpful to execute same flow till it returns 0 executed actions...
I may extract my PostgreSQL cluster config and try it on Minikube with very basic demo app for latest release to check. But can't say when I'll have enough free time to do that, may take a few days.