[fix](streaming) avoid infinite retry when cloud mode job progress is not found - #66561
[fix](streaming) avoid infinite retry when cloud mode job progress is not found#66561maks3201 wants to merge 1 commit into
Conversation
… not found In compute-storage-decoupled (cloud) mode, replayOnCloudMode() asks MetaService for a streaming job's persisted progress. When MetaService answers STREAMING_JOB_PROGRESS_NOT_FOUND, the method logs a warning and returns void. The caller cannot tell 'no progress exists' from 'progress loaded successfully', so it repeats the RPC on every scheduler tick indefinitely, flooding the log and leaving the job stuck in PENDING. Fix: - Change replayOnCloudMode() to return boolean (false on NOT_FOUND). - Add a transient cloudProgressMissing flag that short-circuits subsequent attempts so the pointless RPC is not re-issued on every tick or journal entry. - Clear the flag in afterCommitted() when the job actually persists progress, enabling recovery after MetaService later stores valid state. The flag is intentionally transient (not serialized): it resets on FE restart, which gives MetaService another chance if the issue was temporary. This is the correct behavior — a permanent NOT_FOUND is expected for newly created jobs that have not yet committed their first transaction.
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
This bug is present in released 4.1.x (confirmed on 4.1.2). If the fix is accepted, the |
|
Thank you for the detailed triage. You are right on the main point and I want to state that plainly. What I got wrong. The claim that I also want to correct a second thing before it spreads. I had thought this produced repeated warnings on every scheduler tick. That is also wrong. What actually holds up. Only one thing, and it is smaller than I described. What I am doing. Closing this PR and the issue. What is left is a minor replay deduplication and a log level change, and it does not match what the issue and PR describe. Reframing them would leave a misleading history. If I revisit it, I will open a fresh narrow PR for replay deduplication only, with startup timing numbers and entry counts to justify it, plus the unit tests you asked for. Thank you for looking at this carefully. Your review caught a real error on my side. |
What problem does this PR solve?
Issue Number: close #66560
Related PR: #66559 (independent fix in the same subsystem)
Problem Summary:
In compute-storage-decoupled (cloud) mode,
replayOnCloudMode()asks MetaService for a streaming job's persisted progress. When MetaService answersSTREAMING_JOB_PROGRESS_NOT_FOUND(expected for newly created jobs that have not yet committed a transaction), the method logs a warning and returnsvoid. The caller —handlePendingState()inStreamingJobSchedulerTask— cannot distinguish "no progress exists" from "progress loaded successfully", so it repeats the RPC on every scheduler tick indefinitely.Consequences:
UPDATE_JOBedit-log entry triggers a doomed RPCFix:
replayOnCloudMode()return type fromvoidtoboolean(returnsfalseon NOT_FOUND)transient volatile boolean cloudProgressMissingflag that short-circuits subsequent attemptsafterCommitted()when the job commits its first transaction (progress now exists in MetaService)!cloudProgressMissingto avoid repeated RPCs during startupThe flag is intentionally
transient(not serialized): it resets on FE restart, giving MetaService another chance if the issue was temporary. A permanent NOT_FOUND is the expected state for newly created jobs — the fix simply allows the job to proceed rather than spinning.Release note
Fix streaming insert job stuck in PENDING state with infinite MetaService retries in compute-storage-decoupled (cloud) mode. When MetaService returns STREAMING_JOB_PROGRESS_NOT_FOUND, the job now proceeds with its configured offset instead of retrying indefinitely.
Check List (For Author)
checkstyle)@NullablewarningsNote to Reviewers
A unit test mocking
MetaServiceProxyto returnSTREAMING_JOB_PROGRESS_NOT_FOUNDand asserting the method returnsfalse/ the flag suppresses a second call is feasible and straightforward. I have not included one in this PR — happy to add it if reviewers prefer. The behavioral correctness was verified on a live cluster.CC @JNSimba — as the streaming-job subsystem maintainer.
If this should be backported to 4.1, please apply the
dev/4.1.xlabel (I cannot as a non-committer).