Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-8162

Concurrent issue while starting engine in a cluster (duplicate key for history level)

      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

        This is the controller panel for Smart Panels app

            [CAM-8162] Concurrent issue while starting engine in a cluster (duplicate key for history level)

            Yana Vasileva created issue -
            Yana Vasileva made changes -
            Description Original: Problem:
            When process engine starts in a cluster a ProcessEngineException occurs while trying to commit the history level configuration to the database.

            There is no Locking mechanism while setting the history level.

            AT:

            New: Problem:
            When process engine starts in a cluster a ProcessEngineException occurs while trying to commit the history level configuration to the database.


            There is no Locking mechanism while setting the history level.
            {{org.camunda.bpm.engine.impl.SchemaOperationsProcessEngineBuild#checkHistoryLevel}}

            AT:

            Yana Vasileva made changes -
            Labels Original: engine New: SUPPORT
            Yana Vasileva made changes -
            Description Original: Problem:
            When process engine starts in a cluster a ProcessEngineException occurs while trying to commit the history level configuration to the database.


            There is no Locking mechanism while setting the history level.
            {{org.camunda.bpm.engine.impl.SchemaOperationsProcessEngineBuild#checkHistoryLevel}}

            AT:

            New: Problem:
            When process engine starts in a cluster a ProcessEngineException occurs while trying to commit the history level configuration to the database.

            {code}
            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.
            {code}

            There is no Locking mechanism while setting the history level and this causes the concurrent issue.
            {{org.camunda.bpm.engine.impl.SchemaOperationsProcessEngineBuild#checkHistoryLevel}}

            AT:
            ...
            Yana Vasileva made changes -
            Link New: This issue depends on SUPPORT-3590 [ SUPPORT-3590 ]
            Yana Vasileva made changes -
            Description Original: Problem:
            When process engine starts in a cluster a ProcessEngineException occurs while trying to commit the history level configuration to the database.

            {code}
            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.
            {code}

            There is no Locking mechanism while setting the history level and this causes the concurrent issue.
            {{org.camunda.bpm.engine.impl.SchemaOperationsProcessEngineBuild#checkHistoryLevel}}

            AT:
            ...
            New: Problem:
            When process engine starts in a cluster a ProcessEngineException occurs while trying to commit the history level configuration to the database.

            {code}
            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.
            {code}

            There is no Locking mechanism while setting the history level and this causes the concurrent issue.
            {{org.camunda.bpm.engine.impl.SchemaOperationsProcessEngineBuild#checkHistoryLevel}}

            AT:
            ...
            Thorben Lindhauer made changes -
            Description Original: Problem:
            When process engine starts in a cluster a ProcessEngineException occurs while trying to commit the history level configuration to the database.

            {code}
            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.
            {code}

            There is no Locking mechanism while setting the history level and this causes the concurrent issue.
            {{org.camunda.bpm.engine.impl.SchemaOperationsProcessEngineBuild#checkHistoryLevel}}

            AT:
            ...
            New: 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.

            {code}
            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.
            {code}

            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 optimistic locking exception or primary key constraint violation
            Thorben Lindhauer made changes -
            Link Original: This issue depends on SUPPORT-3590 [ SUPPORT-3590 ]
            Thorben Lindhauer made changes -
            Link New: This issue is depended on by SUPPORT-3590 [ SUPPORT-3590 ]
            Thorben Lindhauer made changes -
            Fix Version/s New: 7.8.x [ 14900 ]

              svetlana.dorokhova Svetlana Dorokhova
              yana.vasileva Yana Vasileva
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: