Skip to content

[v3-4-test] Use READ COMMITTED for async MySQL metadata sessions (#76694) - #77687

Merged
vatsrahul1001 merged 1 commit into
v3-4-testfrom
backport-ed91827-v3-4-test
Nov 27, 2026
Merged

vatsrahul1001 merged 1 commit into
v3-4-testfrom
backport-ed91827-v3-4-test

Conversation

@vatsrahul1001

Copy link
Copy Markdown
Contributor

The async engine never got the isolation level the sync engine sets for
MySQL, so its sessions ran at the server default, REPEATABLE READ. A
query repeated in one async transaction could then read a stale snapshot
that the sync engine's sessions would not, and task heartbeats, audit
log rows and other writes that already go through the async engine
behaved differently from their sync counterparts.
(cherry picked from commit ed91827)

Co-authored-by: Dev-iL [email protected]


The automatic backport failed on a conflict in airflow-core/tests/unit/core/test_settings.py, so this was cherry-picked manually (-x). The settings.py change applied cleanly.

Conflict resolution (test file only): kept the mysql+aiomysql READ-COMMITTED parametrization this PR adds. Dropped the mysql+asyncmy parametrizations: v3-4-test has no asyncmy support in settings.py or in this test, so they belong to a different main change.

Verified locally: test_settings.py 58 passed, 7 skipped (the MySQL-backend params are skipped without a MySQL backend, so the new aiomysql isolation case ran only in CI's MySQL lane).

Backport of #76694.

🤖 Generated with Claude Code

)

The async engine never got the isolation level the sync engine sets for
MySQL, so its sessions ran at the server default, REPEATABLE READ. A
query repeated in one async transaction could then read a stale snapshot
that the sync engine's sessions would not, and task heartbeats, audit
log rows and other writes that already go through the async engine
behaved differently from their sync counterparts.
(cherry picked from commit ed91827)

Co-authored-by: Dev-iL <[email protected]>
Co-Authored-By: Claude <[email protected]>
@vatsrahul1001 vatsrahul1001 added this to the Airflow 3.4.1 milestone Nov 27, 2026
@vatsrahul1001
vatsrahul1001 enabled auto-merge (squash) November 27, 2026 13:56
@vatsrahul1001
vatsrahul1001 merged commit 51e7106 into v3-4-test Nov 27, 2026
109 checks passed
@vatsrahul1001
vatsrahul1001 deleted the backport-ed91827-v3-4-test branch November 27, 2026 14:06
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