Details
-
Bug Report
-
Resolution: Fixed
-
L3 - Default
-
7.8.0-alpha3
Description
Problem:
When two process engines starts in a cluster in parallel, a ProcessEngineException can occur while trying to commit the history level configuration to the database.
org.camunda.bpm.engine.ProcessEngineException: ENGINE-03004 Exception while executing Database Operation 'INSERT PropertyEntity[historyLevel]' with message '#012### Error updating database. Cause: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "act_ge_property_pkey"#012 Detail: Key (name_)=(historyLevel) already exists.
There is no Locking mechanism while setting the history level and this causes the concurrent issue.
org.camunda.bpm.engine.impl.SchemaOperationsProcessEngineBuild#checkHistoryLevel
AT:
- both process engines start successfully
Implementation ideas:
- acquire pessimistic lock before inserting the history level
- perform automatic retry when history level insertion fails with optimistic locking exception or primary key constraint violation