d7171a5ca40427f8341fb7b5d2e94217b3c8fea1
discardKeys updated with `release_key = ANY(subquery)`, which locks rows in the plan's scan order, and deadlocked against a batch upsert that takes its rows by key (LOG.md (137)). It now updates from a subquery that selects the rows ORDER BY release_key FOR UPDATE, so the locks are taken sorted (the plan: LockRows above Sort). record() runs the same SELECT ... FOR UPDATE over its taken rows before its UPDATE ... FROM jsonb_to_recordset, whose join order the planner chooses. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Languages
TypeScript
95.5%
JavaScript
2.4%
CSS
1.4%
HTML
0.6%
Dockerfile
0.1%