Skip to content

branch-4.1: [fix](publish) Avoid NPE for force-finished publish task #63069 - #63380

Merged
yiguolei merged 1 commit into
branch-4.1from
auto-pick-63069-branch-4.1
May 21, 2026
Merged

branch-4.1: [fix](publish) Avoid NPE for force-finished publish task #63069#63380
yiguolei merged 1 commit into
branch-4.1from
auto-pick-63069-branch-4.1

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Cherry-picked from #63069

FE publish can loop on:
java.lang.NullPointerException: Cannot invoke
"java.util.Map.containsKey(Object)" because the return value of
"PublishVersionTask.getSuccTablets()" is null
at DatabaseTransactionMgr.checkReplicaContinuousVersionSucc(...)
at DatabaseTransactionMgr.finishCheckQuorumReplicas(...)
at DatabaseTransactionMgr.finishTransaction(...)
PublishVersionTask starts with succTablets == null, but
AgentTaskCleanupDaemon.removeInactiveBeAgentTasks can force-finish an
in-flight task with setFinished(true) without ever calling
setSuccTablets.
That leaves a finished task whose getSuccTablets() still returns null.
MasterImpl.finishPublishVersion is only a theoretical source here:
BE task_worker_pool.cpp unconditionally sets succ_tablets on the finish
request, so that path currently receives at worst an empty map.
Fix this on both sides:
- default PublishVersionTask.succTablets to an empty map and coerce null
- guard the call site before containsKey(tabletId)
Add FE unit coverage and a regression suite for BE-down publish cleanup.
@github-actions
github-actionsBot requested a review from yiguolei as a code ownerMay 19, 2026 02:14
@yiguolei

Copy link
Copy Markdown
Contributor

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 4.29% (3/70) 🎉
Increment coverage report
Complete coverage report

@yiguoleiyiguolei reopened this May 21, 2026
@github-actions

Copy link
Copy Markdown
ContributorAuthor

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

@github-actionsgithub-actionsBot added approved Indicates a PR has been approved by one committer. reviewed labels May 21, 2026
@github-actions

Copy link
Copy Markdown
ContributorAuthor

PR approved by anyone and no changes requested.

@yiguolei
yiguolei merged commit 7e12dfd into branch-4.1May 21, 2026
30 of 34 checks passed
@morningman
morningman deleted the auto-pick-63069-branch-4.1 branch July 8, 2026 14:09
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.

3 participants

@yiguolei@hello-stephen@deardeng