Flyway 如何处理多个测功机可以尝试 运行 并行迁移的事实?
How does Flyway deal with the fact that several dynos can try to run several migrations in parallel?
我只是想知道 Flyway 如何处理这样一个事实,即多个测功机可以在 Heroku 等集群环境中多次尝试 运行 数据库迁移,从而导致冲突?
Flyway似乎使用了锁来处理这个问题。
引用文档:
Can multiple nodes migrate in parallel? Yes! Flyway uses the locking
technology of your database to coordinate multiple nodes. This ensures
that even if even multiple instances of your application attempt to
migrate the database at the same time, it still works. Cluster
configurations are fully supported.
此 question 进一步解释了锁定行为的工作原理。它似乎获得了 Flyway 模式 table: select * from dbschema.schema_version for update
的锁定,这可能会导致更长的 运行 迁移出现问题,因为 innodb_lock_wait_timeout
设置可能会导致超时,至少在MySQL.
的情况
我只是想知道 Flyway 如何处理这样一个事实,即多个测功机可以在 Heroku 等集群环境中多次尝试 运行 数据库迁移,从而导致冲突?
Flyway似乎使用了锁来处理这个问题。
引用文档:
Can multiple nodes migrate in parallel? Yes! Flyway uses the locking technology of your database to coordinate multiple nodes. This ensures that even if even multiple instances of your application attempt to migrate the database at the same time, it still works. Cluster configurations are fully supported.
此 question 进一步解释了锁定行为的工作原理。它似乎获得了 Flyway 模式 table: select * from dbschema.schema_version for update
的锁定,这可能会导致更长的 运行 迁移出现问题,因为 innodb_lock_wait_timeout
设置可能会导致超时,至少在MySQL.