dstandish opened a new pull request, #69977:
URL: https://github.com/apache/airflow/pull/69977

   When an asset event fans out to multiple consumer DAGs, the non-PostgreSQL 
branch of
   `AssetManager._queue_dagruns` inserts one row per consumer into 
`asset_dag_run_queue`
   inside a per-row `SAVEPOINT`, catching only `IntegrityError`. On 
MySQL/InnoDB this is
   deadlock-prone under concurrent fan-out (errno 1213), and because a deadlock 
discards the
   savepoint it also surfaces a secondary `SAVEPOINT ... does not exist` error. 
The deadlock
   is not retried.
   
   This routes MySQL to a single-statement `INSERT ... ON DUPLICATE KEY UPDATE` 
(a no-op
   update on conflict), mirroring the existing PostgreSQL `ON CONFLICT DO 
NOTHING` bulk path.
   The enqueue becomes atomic, drops the per-row savepoint churn, and holds 
locks far more
   briefly — greatly reducing the InnoDB deadlock window. PostgreSQL and SQLite 
behavior is
   unchanged.
   
   Note: a single-statement upsert can still deadlock on InnoDB gap/next-key 
locks under heavy
   concurrency, so adding deadlock retry on this path is a natural follow-up.
   
   related: #69938
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 4.8)
   
   Generated-by: Claude Code (Opus 4.8) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to