Skip to content

Commit

Permalink
Remove task version and visibility timestamp override (#2789)
Browse files Browse the repository at this point in the history
  • Loading branch information
yycptt committed May 5, 2022
1 parent aa566f7 commit f62095d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 28 deletions.
4 changes: 0 additions & 4 deletions service/history/workflow/mutable_state_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -3744,8 +3744,6 @@ func (e *MutableStateImpl) CloseTransactionAsMutation(
}
}

setTaskInfo(e.GetCurrentVersion(), now, e.InsertTasks)

// update last update time
e.executionInfo.LastUpdateTime = &now
e.executionInfo.StateTransitionCount += 1
Expand Down Expand Up @@ -3830,8 +3828,6 @@ func (e *MutableStateImpl) CloseTransactionAsSnapshot(
}
}

setTaskInfo(e.GetCurrentVersion(), now, e.InsertTasks)

// update last update time
e.executionInfo.LastUpdateTime = &now
e.executionInfo.StateTransitionCount += 1
Expand Down
24 changes: 0 additions & 24 deletions service/history/workflow/mutable_state_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,27 +55,3 @@ func convertSyncActivityInfos(
}
return outputs
}

// TODO: can we deprecate this method and
// let task generator correctly set task version and
// visibility timestamp?
func setTaskInfo(
version int64,
timestamp time.Time,
insertTasks map[tasks.Category][]tasks.Task,
) {
// set the task version,
// as well as the Timestamp if not scheduled task
for category, tasksByCategory := range insertTasks {
if category == tasks.CategoryReplication {
continue
}

for _, task := range tasksByCategory {
task.SetVersion(version)
if category.Type() == tasks.CategoryTypeImmediate {
task.SetVisibilityTime(timestamp)
}
}
}
}

0 comments on commit f62095d

Please sign in to comment.