Fix Grid view failing to load large Dags on MySQL - #71342
Open
WonYong-Jang wants to merge 1 commit into
Open
Conversation
WonYong-Jang
marked this pull request as ready for review
August 9, 2026 07:14
WonYong-Jang
requested review from
bugraoz93,
choo121600,
ephraimbuddy,
henry3260,
jason810496,
pierrejeambrun,
rawwar and
shubhamraj-git
as code owners
August 9, 2026 07:14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Grid view showed no tasks for large Dags when the metadata backend is MySQL.
The API server logged:
Root cause
The grid endpoint used
_get_latest_serdagto load the latest serialized Dag.That query did
select(SerializedDagModel) ... ORDER BY ... LIMIT 1, which loads the whole row - including the bigdata/data_compressedblob columns.On MySQL,
ORDER BYuses filesort, and filesort copies each candidate row (the blob too) into the sort buffer. The sort buffer has a fixed size (sort_buffer_size, 256 KB by default). When a single serialized Dag is bigger than that, the sort fails with "Out of sort memory", so the whole request fails and the Grid view renders nothing.PostgreSQL is not affected because it does not copy large values into the sort buffer.
Fix
Use the existing
SerializedDagModel.latest_item_select_objecthelper.On MySQL it first finds the latest row's
id(ORDER BY onidonly, no blob), and then loads that single row by primary key. The blob is never put into the sort buffer, so the error is gone.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 4.8) following the guidelines
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.