JNSimba opened a new pull request, #62270:
URL: https://github.com/apache/doris/pull/62270
### What problem does this PR solve?
Issue Number: close #xxx
Problem Summary:
Currently, StreamingInsertJob uses `PAUSED` state for both manual pause and
automatic retry scenarios. Users cannot distinguish between:
- A job that was manually paused (needs no action)
- A job that encountered a transient error and is auto-recovering
- A job that has been continuously failing and retrying
This PR introduces a new `RETRYING` state to purify the semantics:
- **PAUSED** = needs manual intervention (manual pause, non-resumable
errors, max retries exceeded)
- **RETRYING** = system is auto-recovering with exponential backoff
#### Key Changes
**New RETRYING State:**
- `RUNNING → RETRYING`: when task fails with a resumable error
- `RETRYING → RUNNING`: when backoff expires and createTask succeeds
- `RETRYING → PAUSED`: when max retry count exceeded or non-resumable error
- RETRYING is a runtime-only state, **not persisted to editlog** for
backward compatibility
**Max Retry Limit:**
- New config `streaming_job_max_auto_resume_count` (default 10, mutable)
- After exceeding the limit, job transitions to PAUSED with
`CANNOT_RESUME_ERR`
- Error message: "Auto resume failed after N attempts. Last error: ..."
**Backoff Interval:**
- Base time increased from 10s to 30s for better observability
- Progression: 30s → 60s → 120s → 240s → 300s (cap)
**New TVF Columns:**
- `LastTaskSuccessTime`: timestamp of the last successful task completion
- `RetryInfo`: JSON containing `retryCount` (e.g. `{"retryCount": 3}`),
empty when count is 0
**Compatibility:**
- RETRYING never appears in editlog, so old FE never encounters unknown enum
during rolling upgrade
- `gsonPostProcess` adds null fallback: if an unknown enum deserializes as
null, defaults to PENDING
- `replayOnUpdated` skips RETRYING (same as RUNNING) — FE restart goes
through PENDING for proper initialization
### Release note
Add RETRYING state to streaming insert job to distinguish auto-recovering
jobs from manually paused ones. New TVF columns `LastTaskSuccessTime` and
`RetryInfo` provide retry visibility. New config
`streaming_job_max_auto_resume_count` limits auto-resume attempts.
### Check List (For Author)
- Test
- [x] Regression test
- [x] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason
- Behavior changed:
- [x] Yes.
- Resumable task failures now transition to `RETRYING` instead of
`PAUSED`
- `PAUSED` state no longer triggers auto-resume; only `RETRYING` does
- Backoff base time changed from 10s to 30s
- Two new columns added to insert job TVF: `LastTaskSuccessTime`,
`RetryInfo`
- Does this need documentation?
- [x] Yes. <!-- TODO: add docs PR -->
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]