Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-12071 Official support for CockroachDB
  3. CAM-12138

[BUG] CRDB concurrent transactions must be retried or reported to caller

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Done
    • Icon: L3 - Default L3 - Default
    • 7.14.0, 7.14.0-alpha3
    • None
    • engine
    • None

      Given:
      Two Job Executor threads.

      When:
      Both Job Executors attempt to concurrently acquire the same jobs.

      Then:
      The second Job Executor fails to correctly utilize the Back-off algorithm due to an undetected OLE. The following exception is thrown:

      ERROR: restart transaction: TransactionRetryWithProtoRefreshError: TransactionRetryError: retry txn (RETRY_WRITE_TOO_OLD - WriteTooOld flag converted to WriteTooOldError): "sql txn" meta={id=260a2275 key=/Table/57/1/"10955"/0 pri=0.00050915 epo=0 ts=1594130960.041192598,1 min=1594130959.871861724,0 seq=1} lock=true stat=PENDING rts=1594130960.041192598,1 wto=false max=1594130959.871861724,0  Call getNextException to see other errors in the batch.
      ### Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.JobEntity.updateAcquirableJob (batch index #1) failed. Cause: java.sql.BatchUpdateException: Batch entry 0 update ACT_RU_JOB
      

      Expected:
      The second Job Executor correctly detects an OLE, or correctly handles the above Exception, and does a back-off.

      Note:

      • The exception above occurs due to CRDB's own Optimistic Locking mechanism. Implementing a Transaction Retries mechanism will resolve this issue.
      • The same problem occurs with any concurrent operation that is expected to produce an Optimistic Locking Exception.

        This is the controller panel for Smart Panels app

              nikola.koevski Nikola Koevski
              nikola.koevski Nikola Koevski
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: