Skip to content

fix: add bigTransactionTimeout and retryOnDeadlock to delete operations#2678

Open
dkindlund wants to merge 1 commit intoteableio:developfrom
dkindlund:fix/delete-records-timeout-retry
Open

fix: add bigTransactionTimeout and retryOnDeadlock to delete operations#2678
dkindlund wants to merge 1 commit intoteableio:developfrom
dkindlund:fix/delete-records-timeout-retry

Conversation

@dkindlund
Copy link
Contributor

Bug Description

deleteRecord and deleteRecords use $tx but with the default Prisma transaction timeout (5s) and no deadlock retry. With FOR UPDATE locking in the computed orchestrator, delete operations can deadlock with concurrent updates touching the same records. Large batch deletes with cascading link changes can also exceed the 5s default timeout.

This is inconsistent with updateRecords and multipleCreateRecords which both use bigTransactionTimeout and @retryOnDeadlock.

What This Fix Does

  • Adds @retryOnDeadlock() to deleteRecord and deleteRecords in RecordOpenApiService
  • Injects ThresholdConfig into RecordDeleteService
  • Passes bigTransactionTimeout to the $tx call in deleteRecords

Client Information

  • OS: Linux (Docker, Google Cloud Run)
  • Database: PostgreSQL 17

Platform

Docker standalone (Google Cloud Run)

deleteRecord and deleteRecords in RecordDeleteService use $tx but with
the default Prisma transaction timeout (5s) and no deadlock retry.

With FOR UPDATE locking in the computed orchestrator, delete operations
can deadlock with concurrent updates touching the same records. Large
batch deletes with cascading link changes can also exceed the 5s
default timeout.

This is inconsistent with updateRecords and multipleCreateRecords which
both use bigTransactionTimeout and @retryOnDeadlock.

This fix:
- Adds @retryOnDeadlock() to deleteRecord and deleteRecords in
  RecordOpenApiService
- Injects ThresholdConfig into RecordDeleteService
- Passes bigTransactionTimeout to the $tx call in deleteRecords

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant