deadlock_repro

command
v0.33.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2026 License: MIT Imports: 16 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL