Skip to content

[Fix-18733][API] Use target task relations when switching versions - #18734

Open
zhuangchong wants to merge 5 commits into
apache:devfrom
zhuangchong:fix-workflow-version-task-relation-query
Open

zhuangchong wants to merge 5 commits into
apache:devfrom
zhuangchong:fix-workflow-version-task-relation-query

Conversation

@zhuangchong

Copy link
Copy Markdown
Contributor

Purpose of the pull request

Fixes #18733.

Switching to a non-current workflow version queried the main workflow-task relation table before the switch. Because that table only contains the current version, the empty relation result caused TaskDefinitionLogMapper.queryByTaskDefinitions to execute without task predicates and scan all task definition logs.

Brief change log

  • Query workflow-task relation logs for the target workflow version before permission validation.
  • Skip the task-definition query when the target version has no task relations.
  • Add regression coverage for target-version relation selection and empty relation lists.

Verify this pull request

  • Added and updated unit tests for the changed behavior.
  • Ran WorkflowDefinitionServiceTest with JDK 11.

@SbloodyS SbloodyS added the bug Something isn't working label Oct 23, 2026
@SbloodyS SbloodyS added this to the 3.5.0 milestone Oct 23, 2026
SbloodyS
SbloodyS previously approved these changes Oct 23, 2026

@SbloodyS SbloodyS left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Switching workflow versions can scan all task definition logs

2 participants