Skip to content

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

Merged
yiguolei merged 1 commit intobranch-4.1from
auto-pick-61451-branch-4.1
Mar 19, 2026
Merged

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

Conversation

@github-actions
Copy link
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.
@github-actions github-actions bot requested a review from yiguolei as a code owner March 18, 2026 10:54
@hello-stephen
Copy link
Contributor

run buildall

@JNSimba
Copy link
Member

JNSimba commented Mar 19, 2026

run p0

@yiguolei yiguolei closed this Mar 19, 2026
@yiguolei yiguolei reopened this Mar 19, 2026
@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Mar 19, 2026
@github-actions
Copy link
Contributor Author

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

@github-actions
Copy link
Contributor Author

PR approved by anyone and no changes requested.

@yiguolei yiguolei merged commit d462fae into branch-4.1 Mar 19, 2026
26 of 29 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.

3 participants