flyway: Flyway 9.19.3 migrate hangs forever on second non-transactional migration

Which version and edition of Flyway are you using?

9.19.3 docker image

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)

CLI in docker

Which database are you using? (Type & version)

postgres 13

Which operating system are you using?

alpine (docker)

What did you do? (Please include the content causing the issue, any relevant configuration settings, the SQL statement(s) that failed (if any), and the command you ran)

Command:

flyway -url=jdbc:postgresql://db:5432/postgres -schemas=public -user=user -password=password -connectRetries=60 -outOfOrder="true" -postgresql.transactional.lock=false migrate

Migrations that have worked before suddenly freeze on the second non-transactional query using the latest docker image release (9.19.3).

What I’ve tried:

  • I tested the previous image (9.19.1) and verified it works as expected
  • I rearranged the queries and verified the migration halts on non-transactional queries
  • I tested that I get the exact same behavior on 9.19.1 when removing the -postgresql.transactional.lock=false flag
What did you expect to see?

I expected migrations to complete (within 15 minutes) and not freeze on non-transactional queries.

What did you see instead?

Migration freezes, -postgresql.transactional.lock=false does not work

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 1
  • Comments: 15 (1 by maintainers)

Most upvoted comments

I’ve tried with this previous minimal example and changing Flyway version to 9.19.4 or 9.21.1, but it still hangs when creating the index. Is there anything else that needs to be done to make it work? https://github.com/AvaPL/flyway-postgres-concurrent-index-issue

My workaround is to add if not exists to the create index statement. Then I:

  • Run the migration.
  • It hangs.
  • Ctrl-C to cancel, which frees up the locks so create index can successfully run (despite the connection breaking)
  • Run the migration again, which skips the index (because it now exists) and completes successfully.

Thanks for your update. We have been making updates to the configuration of Flyway and it seems like this has become disconnected. We have already started a fix for this and will update soon.

I can confirm that this is also happening on the Flyway Docker Image as well.