Documentation
¶
Overview ¶
Deadlock reproduction harness for the jobs/tasks counter triggers.
Drives K goroutines doing concurrent batched UPDATEs against overlapping random subsets of tasks across N jobs. Counts:
- 40P01 (deadlock_detected) errors
- 55P03 (lock_not_available) and 57014 (statement_timeout) outliers
- per-statement latency (mean / p95 / max)
- final counter consistency: SUM(jobs.completed_tasks) vs the actual COUNT(tasks WHERE status='completed').
Designed to be run pre- and post-migration to compare 40P01 rate and latency. Pre-migration the row-level triggers must be active; post- migration the statement-level triggers (Phase 3) are active.
Usage:
go run ./scripts/deadlock_repro \
--jobs=8 --tasks-per-job=400 --workers=12 \
--batches=300 --batch-size=40 \
--dsn=postgres://postgres:postgres@127.0.0.1:54322/postgres
Click to show internal directories.
Click to hide internal directories.