升级到 Flyway 4.2.1 后,我们在发布到 Percona MySQL 集群时开始出现错误。我们得到的错误是:
Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Invocation of init method failed; nested exception is org.flywaydb.core.internal.dbsupport.FlywaySqlException:
Unable to acquire MySQL named lock: Flyway-605484229
----------------------------------------------------
SQL State : HY000
Error Code : 1105
Message : Percona-XtraDB-Cluster prohibits use of GET_LOCK with pxc_strict_mode = ENFORCING
看起来 Flyway 4.1+ 试图锁定表,而 Percona 的 PXC 严格模式不允许这样做。
我相信我的问题是:我们可以在 Flyway 4.1+ 方面做些什么来避免这个错误(之前在 Flyway 4.0 中一切正常)还是我们唯一的选择是在 Percona 中禁用 PXC 严格模式?
谢谢!