Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add activity / workflow task version check #4580

Merged
merged 3 commits into from
Jul 13, 2023
Merged

Add activity / workflow task version check #4580

merged 3 commits into from
Jul 13, 2023

Conversation

wxing1292
Copy link
Contributor

What changed?

  • Propagate activity / workflow task version
  • Add activity / workflow task version check

Why?
Make activity / workflow task check more accurate

How did you test it?
Existing tests

Potential risks
N/A

Is hotfix candidate?
N/A

@wxing1292 wxing1292 requested a review from a team as a code owner July 5, 2023 19:08
Copy link
Contributor

@yux0 yux0 left a comment

Choose a reason for hiding this comment

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

click the wrong approve

runID string,
scheduledEventID int64,
activityId string,
activityType string,
Copy link
Member

Choose a reason for hiding this comment

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

why do we need activityType in the token? for metrics?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"",
1,
nil,
common.EmptyVersion,
Copy link
Contributor

Choose a reason for hiding this comment

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

any future plan to use a real version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, the *ActivitybyID APIs are on the deprecation path, and the contract does not include clock or version

(token.StartedEventId != common.EmptyEventID && token.StartedEventId != currentWorkflowTask.StartedEventID) {
(token.StartedEventId != common.EmptyEventID && token.StartedEventId != currentWorkflowTask.StartedEventID) ||
currentWorkflowTask.Attempt != token.Attempt ||
(token.Version != common.EmptyVersion && token.Version != currentWorkflowTask.Version) {
Copy link
Contributor

Choose a reason for hiding this comment

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

is it possible token.Version > currentWorkflowTask.Version? I am not sure if a workflow task retry would update ms wt version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

token version comes from workflow task, so if workflow task is updated, then corresponding token version should be the newest value

@wxing1292 wxing1292 merged commit cc38a41 into temporalio:master Jul 13, 2023
@wxing1292 wxing1292 deleted the task-vesion branch July 13, 2023 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants