Abhitocode opened a new issue, #2382: URL: https://github.com/apache/incubator-kie-issues/issues/2382
When several replicas of the same application start at the same time, each one indexes its own process definitions. They all read an empty state before any of them commits, so they all insert the same `(id, version)` rows. All but the first fail with a primary key violation on the definitions` table, and the replica crashes on startup. Quarkus: `org.hibernate.exception.ConstraintViolationException: could not execute statement [ERROR: duplicate key value violates unique constraint "definitions_pkey" Detail: Key (id, version)=(myProcess, 1.0) already exists.] at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:348) Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "definitions_pkey"` Springboot: On Spring Boot the same race gives `org.springframework.dao.DataIntegrityViolationException`, thrown from `JpaTransactionManager.doCommit`. **Expected behaviour** A definition already registered by another replica is not an error. The replica should keep the stored definition and continue starting up -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
