Skip to content

branch-4.1: [fix](insert) fix INSERT job statistics lost in show load after FE restart #62331#62546

Merged
yiguolei merged 1 commit intobranch-4.1from
auto-pick-62331-branch-4.1
Apr 16, 2026
Merged

branch-4.1: [fix](insert) fix INSERT job statistics lost in show load after FE restart #62331#62546
yiguolei merged 1 commit intobranch-4.1from
auto-pick-62331-branch-4.1

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Cherry-picked from #62331

…start (#62331)

## Problem

After a FE restart, `SHOW LOAD` for finished INSERT jobs shows all-zero
`JobDetails` (`ScannedRows`, `LoadBytes`, etc.), even though the values
were correct before the restart.

## Fix

**`InsertLoadJob`**
- Add `@SerializedName("jdj") private String jobDetailsJson` to capture
a
  JSON snapshot of `loadStatistic` at the moment the job finishes.
- In `setJobProperties()` (called when the job transitions to
  FINISHED/CANCELLED), snapshot `loadStatistic.toJson()` into
  `jobDetailsJson`.
- Override `getJobDetailsJson()` to return the persisted snapshot when
  available, falling back to the live `loadStatistic` during execution.

**`LoadJob`**
- Extract `protected String getJobDetailsJson()` (defaults to
  `loadStatistic.toJson()`) so subclasses can override the stats source
  used by `getShowInfoUnderLock()`.

**`OlapInsertExecutor`**
- Remove the `!Config.enable_nereids_load` guard in `afterExec()` so
that
`recordFinishedLoadJob` is always called when `jobId != -1`. This
ensures
  the job is persisted to the edit log and its statistics are captured
  regardless of the config value.

## Test

Added `test_insert_statistic_after_fe_restart` docker regression test
that:
1. Inserts rows via `INSERT INTO ... SELECT`
2. Reads and records `JobDetails` from `SHOW LOAD`
3. Restarts FE
4. Asserts `ScannedRows`, `LoadBytes`, `FileNumber`, `FileSize` are
   unchanged after restart
@github-actions github-actions bot requested a review from yiguolei as a code owner April 16, 2026 03:34
@Thearas
Copy link
Copy Markdown
Contributor

Thearas commented Apr 16, 2026

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@dataroaring dataroaring reopened this Apr 16, 2026
@Thearas
Copy link
Copy Markdown
Contributor

Thearas commented Apr 16, 2026

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 57.14% (4/7) 🎉
Increment coverage report
Complete coverage report

@yiguolei
Copy link
Copy Markdown
Contributor

skip buildall

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Apr 16, 2026
@github-actions
Copy link
Copy Markdown
Contributor Author

PR approved by at least one committer and no changes requested.

@github-actions
Copy link
Copy Markdown
Contributor Author

PR approved by anyone and no changes requested.

@yiguolei yiguolei closed this Apr 16, 2026
@yiguolei yiguolei reopened this Apr 16, 2026
@yiguolei yiguolei merged commit 925840d into branch-4.1 Apr 16, 2026
47 of 52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants