Skip to content

fix(db): prevent code review GDPR deletion timeouts - #5996

Merged
eshurakov merged 2 commits into
mainfrom
eshurakov/lush-glade
Sep 9, 2026
Merged

fix(db): prevent code review GDPR deletion timeouts#5996
eshurakov merged 2 commits into
mainfrom
eshurakov/lush-glade

Conversation

@eshurakov

Copy link
Copy Markdown
Contributor

Summary

  • add a concurrent index for cloud_agent_code_review_attempts.retry_of_attempt_id
  • prevent self-referential retry cleanup scans from exceeding the GDPR page timeout

Root cause

Production EXPLAIN ANALYZE showed 9.74 seconds in the self-referential foreign-key trigger while deleting 78 attempts. The child lookup had no index on retry_of_attempt_id.

Verification

  • pnpm --filter @kilocode/db typecheck
  • pnpm --filter @kilocode/db lint
  • POSTGRES_URL=... pnpm drizzle check
  • POSTGRES_URL=... pnpm drizzle:verify-bootstrap
  • changed-file formatting and git diff --check

@kilo-code-bot

kilo-code-bot Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (4 files)
  • packages/db/src/schema.ts
  • packages/db/src/migrations/0242_magical_rhodey.sql
  • packages/db/src/migrations/meta/0242_snapshot.json
  • packages/db/src/migrations/meta/_journal.json
Previous Review Summary (commit 44a6aae)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 44a6aae)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (4 files)
  • packages/db/src/schema.ts
  • packages/db/src/migrations/0241_overconfident_chameleon.sql
  • packages/db/src/migrations/meta/0241_snapshot.json
  • packages/db/src/migrations/meta/_journal.json

Reviewed by grok-4.6 · Input: 103K · Output: 7.5K · Cached: 335.1K

Review guidance: REVIEW.md from base branch main

@eshurakov
eshurakov force-pushed the eshurakov/lush-glade branch from 44a6aae to 76e6c65 Compare September 9, 2026 14:50
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.

2 participants