Skip to content

branch-4.0: [fix](streamingjob) fix streaming insert job not refreshing TVF props after ALTER SQL #61451 - #61488

Merged
yiguolei merged 1 commit into
branch-4.0from
auto-pick-61451-branch-4.0
Mar 19, 2026
Merged

branch-4.0: [fix](streamingjob) fix streaming insert job not refreshing TVF props after ALTER SQL #61451#61488
yiguolei merged 1 commit into
branch-4.0from
auto-pick-61451-branch-4.0

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Cherry-picked from #61451

… after ALTER SQL (#61451)
### What problem does this PR solve?
When `ALTER JOB` is used to update the SQL of a streaming insert job
(e.g. to
rotate S3 access keys), `originTvfProps` was not updated along with the
new SQL.
As a result, both `fetchMeta()` and `createStreamingInsertTask()`
continued to
use the stale cached props from the original SQL, so the new credentials
never
took effect and the job kept failing with auth errors. #### Root Cause
`originTvfProps` is lazily initialized from the parsed TVF node and
cached for
reuse. `alterJob()` called `setExecuteSql()` + `initLogicalPlan(true)`
to
rebuild `baseCommand` from the new SQL, but never refreshed
`originTvfProps`.
Both consumers of `originTvfProps` check `if (originTvfProps == null)`
before
re-deriving it, so the stale value was never evicted. ####Test
Added test_streaming_insert_job_alter_aksk:
1. Create job with valid aksk, wait for at least one successful task.
2. Manually pause the job (with try-catch in case it is already paused).
3. ALTER job SQL to use wrong aksk.
4. Resume the job and assert it pauses again with "Failed to fetch
meta".
Without the fix, step 4 would never reach PAUSED because fetchMeta would
still pick up the original valid aksk from the stale cache.
@Thearas

Copy link
Copy Markdown
Contributor

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?

@Thearas

Copy link
Copy Markdown
Contributor

run buildall

@JNSimba

Copy link
Copy Markdown
Member

run p0

1 similar comment
@JNSimba

Copy link
Copy Markdown
Member

run p0

@yiguolei

Copy link
Copy Markdown
Contributor

skip buildall

@github-actionsgithub-actionsBot added the approved Indicates a PR has been approved by one committer. label Mar 19, 2026
@github-actions

Copy link
Copy Markdown
ContributorAuthor

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

@github-actions

Copy link
Copy Markdown
ContributorAuthor

PR approved by anyone and no changes requested.

@yiguolei
yiguolei merged commit 8b7ec6e into branch-4.0Mar 19, 2026
28 of 31 checks passed
@github-actions
github-actionsBot deleted the auto-pick-61451-branch-4.0 branch March 19, 2026 04:08
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approvedIndicates a PR has been approved by one committer.reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@Thearas@JNSimba@yiguolei@dataroaring