branch-4.0: [fix] fix routine_load_jobs first_error_msg on non-master FE and flaky ann_index_basic#65942
Merged
morningman merged 2 commits intoJul 23, 2026
Conversation
…rom the master FE FIRST_ERROR_MSG and ERROR_LOG_URLS of a routine load job are transient, in-memory fields that are only maintained on the master FE (they are set in RoutineLoadJob.executeTaskOnTxnStatusChanged when a task txn commits; the follower replay path never sets them). information_schema.routine_load_jobs is served by the local (coordinating) FE, so when the query lands on a non-master FE these columns come back empty, while SHOW ROUTINE LOAD (which forwards to the master) shows them. In a multi-FE cluster this makes the two views inconsistent and makes test_routine_load_first_error_msg flaky. Route the routine_load_jobs scan to the master FE, the same way the information_schema.tables scan is already routed, so the result is consistent with SHOW ROUTINE LOAD. Gated by the existing enable_schema_scan_from_master_fe session variable (default true). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… visibility window ann_index_basic intermittently failed at the sql_ip_asc check, returning an empty result. Queries whose top-n cannot be evaluated by the ANN index (Asc inner_product, Desc l2, small-predicate top-n) fall back to a brute-force scan; right after an INSERT the freshly written raw rows can be briefly invisible to that scan, so the ordered query returns nothing. Add a scan-visibility gate after each INSERT that waits until a real row read (select id, not count(*) which may take a metadata shortcut) returns the expected number of rows. This does not touch the .out file or the qt_ tags. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
run buildall |
Contributor
FE UT Coverage ReportIncrement line coverage |
hello-stephen
approved these changes
Jul 23, 2026
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.
What this PR does
Two independent fixes for P0 regression failures on branch-4.0 (surfaced in internal CI build 203615).
1.
information_schema.routine_load_jobsreturns empty error columns on a non-master FE (product fix)FIRST_ERROR_MSG/ERROR_LOG_URLSof a routine load job are transient, in-memory fields maintained only on the master FE (set inRoutineLoadJob.executeTaskOnTxnStatusChangedon task-txn commit; the follower replay path never sets them).information_schema.routine_load_jobsis served by the local (coordinating) FE, so on a non-master FE these columns come back empty, whileSHOW ROUTINE LOAD(forwarded to the master) shows them. In a multi-FE cluster the two views are inconsistent, which madetest_routine_load_first_error_msgfail (~4/5 runs).Fix: route the
routine_load_jobsscan to the master FE, the same wayinformation_schema.tablesis already routed, gated by the existingenable_schema_scan_from_master_fesession variable (defaulttrue). No BE change, no test change needed.2. Flaky
ann_index_basic—sql_ip_ascempty result (test fix)Queries whose top-n cannot be evaluated by the ANN index (Asc
inner_product, Descl2, small-predicate top-n) fall back to a brute-force scan. Right after an INSERT the freshly written raw rows can be briefly invisible to that scan, so the ordered query intermittently returns nothing.Fix: add a scan-visibility gate after each INSERT that waits until a real row read (
select id, notcount(*)which may take a metadata shortcut) returns the expected number of rows..outandqt_tags are unchanged.Verification
🤖 Generated with Claude Code