Skip to content

Migrations that concurrently create indices hang in Flyway 9.1.2 #96

@nickelsen

Description

@nickelsen

Hi. After upgrading from Flyway 9.0.3 to 9.1.2, a migration that concurrently creates an index hangs in the preparer.

The behavior can be seen in the two commits here: https://github.com/nickelsen/embedded-postgres-flyway-test

I'm not sure if Flyway 9 is supported in the first place, but it works for us on Flyway 9.0.3.

In 9.1.2, Flyway switched from session locks to transactional locks in Postgres, which I think causes this hanging.

We're supposed to be able to turn off transactional locks through configuration, but as far as I can tell, the preparer just uses default configuration and cannot be configured using API or configuration files.

I've unsuccessfully attempted to override the configuration through the environment variable described here: https://flywaydb.org/documentation/configuration/parameters/postgresqlTransactionalLock

Writing this, I realized that we can go around the preparer and set the config on the API, so I added a commit demonstrating that in the above repo.

I'm not sure if this is relevant here or needs to be addressed in flyway-core, but this issue prevents us from using the FlywayPreparer so we have had to create our own preparer.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions