OpenConext / OpenConext-attribute-aggregation

OpenConext attribute aggregation
Apache License 2.0
1 stars 2 forks source link

Issues running AA with Percona XtraDB (Galera) Cluster #1

Closed precurse closed 6 years ago

precurse commented 6 years ago

I recently tried adding Attribute Aggregation using the OpenConext-Deploy repo (version 247). I first set Percona to pxc_strict_mode=PERMISSIVE to get the database structure created. The AA server starts fine and creates the database structure. After this, I set pxc_strict_mode back to ENFORCING and restart the AA server, but keep getting the same error below:

2018-06-22 16:33:56,921  INFO [main] aa.Application:48 - Starting Application v2.0.8 on java-01.<truncated> with PID 3914 (/opt/attribute-aggregation/attribute-aggregation-server-2.0.8.jar started by attribute-aggregation in /opt/attribute-aggregation)
2018-06-22 16:33:56,928 DEBUG [main] aa.Application:51 - Running with Spring Boot v1.5.9.RELEASE, Spring v4.3.13.RELEASE
2018-06-22 16:33:56,928  INFO [main] aa.Application:593 - No active profile set, falling back to default profiles: default
2018-06-22 16:34:02,576 ERROR [main] o.f.c.i.d.mysql.MySQLNamedLockTemplate:56 - Unable to release MySQL named lock: Flyway-1710496727
java.sql.SQLException: (conn=96421) Percona-XtraDB-Cluster prohibits use of RELEASE_LOCK with pxc_strict_mode = ENFORCING
.....
2018-06-22 16:34:02,593  WARN [main] o.s.b.c.e.AnnotationConfigEmbeddedWebApplicationContext:551 - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with na
me '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.exception.FlywaySqlException:
Unable to acquire MySQL named lock: Flyway-1710496727
-----------------------------------------------------
SQL State  : HY000
Error Code : 1105
Message    : (conn=96421) Percona-XtraDB-Cluster prohibits use of GET_LOCK with pxc_strict_mode = ENFORCING

2018-06-22 16:34:02,653 ERROR [main] o.springframework.boot.SpringApplication:771 - Application startup failed
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 fa
iled; nested exception is org.flywaydb.core.internal.exception.FlywaySqlException:
Unable to acquire MySQL named lock: Flyway-1710496727

Is there any trick to get working? This seems to be the only OpenConext daemon that refuses to start when XtraDB/InnoDB strict mode is enabled.

Thanks!

precurse commented 6 years ago

I can confirm the same symptoms exist with version >=2.0.0 up to 2.0.8

oharsta commented 6 years ago

This is underlying issue: https://github.com/flyway/flyway/issues/1556

oharsta commented 6 years ago

Pushed commit https://github.com/OpenConext/OpenConext-attribute-aggregation/commit/510c42feaf14dfe2c977ed1f10f45f6be79d021d and made a https://build.openconext.org/repository/public/snapshots/org/openconext/attribute-aggregation-server/2.0.9-SNAPSHOT/ new snapshot release. @precurse can you confirm that this fixes this issue?

precurse commented 6 years ago

Thanks @oharsta that looks like it's resolved. I still had some of these errors on first run:

Migration V4___attribute_skip_consent.sql failed
------------------------------------------------
SQL State  : HY000
Error Code : 1105
Message    : (conn=258168) Percona-XtraDB-Cluster prohibits use of DML command on a table (aaserver.aggregations_attributes) without an explicit primary key with pxc_strict_mode = ENFORCING or MASTER
Location   : db/migration/V4___attribute_skip_consent.sql (/opt/attribute-aggregation/file:/opt/attribute-aggregation/attribute-aggregation-server-2.0.9-20180623.054152-1.jar!/BOOT-INF/classes!/db/migration/V4___attribute_skip_consent.sql)
Line       : 5
Statement  : DELETE FROM aggregations_attributes

I set strict mode to PERMISSIVE until it was able to create the database structure. After that I set it back to ENFORCING and the AA service started up fine.

Thanks!