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

Only generate replication task for updated which has history events #973

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions service/history/workflowExecutionContext.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,9 @@ func (c *workflowExecutionContext) updateHelper(builder *historyBuilder, transfe
}
executionInfo := c.msBuilder.GetExecutionInfo()

hasNewHistoryEvents := builder.history != nil && len(builder.history) > 0
// Some operations only update the mutable state. For example RecordActivityTaskHeartbeat.
if builder.history != nil && len(builder.history) > 0 {
if hasNewHistoryEvents {
firstEvent := builder.GetFirstEvent()
// Transient decision events need to be written as a separate batch
if builder.HasTransientEvents() {
Expand Down Expand Up @@ -259,7 +260,8 @@ func (c *workflowExecutionContext) updateHelper(builder *historyBuilder, transfe
}

var replicationTasks []persistence.Task
if createReplicationTask {
// Check if the update resulted in new history events before generating replication task
if hasNewHistoryEvents && createReplicationTask {
// Let's create a replication task as part of this update
replicationTasks = append(replicationTasks, c.msBuilder.CreateReplicationTask())
}
Expand Down