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

Fix stream sender update ack level on empty task #7061

Closed
wants to merge 1 commit into from
Closed
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
9 changes: 5 additions & 4 deletions service/history/replication/stream_sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -489,10 +489,6 @@ Loop:
return fmt.Errorf("ReplicationServiceError StreamSender unable to get next replication task: %w", err)
}

if !s.shouldProcessTask(item) {
Copy link
Contributor

Choose a reason for hiding this comment

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

line 562 below https://github.com/temporalio/temporal/pull/7061/files#diff-3a5383e58f4357884dc90cd45cdc6b2650d1bf8e59c6dbb2d78ca561af96da57R562 , the code will send WorkflowReplicationMessages with endExclusiveWatermark. That is not enough to update Ack level?

continue
}

skipCount++
// To avoid a situation: we are skipping a lot of tasks and never send any task, receiver side will not have updated high watermark,
// so it will not ACK back to sender, sender will not update the ACK level.
Expand All @@ -510,10 +506,15 @@ Loop:
return err
}
}

Copy link
Contributor

Choose a reason for hiding this comment

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

should we reset skipCount after we send the watermark?

if !s.shouldProcessTask(item) {
continue Loop
}
if priority != enumsspb.TASK_PRIORITY_UNSPECIFIED && // case: skip priority check. When priority is unspecified, send all tasks
priority != s.getTaskPriority(item) { // case: skip task with different priority than this loop
continue Loop
}

operation := func() error {
task, err := s.taskConverter.Convert(item, s.clientShardKey.ClusterID)
if err != nil {
Expand Down
Loading