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

Update shard replication timestamp with max generated task #3158

Merged
merged 5 commits into from
Jul 28, 2022

Conversation

yux0
Copy link
Contributor

@yux0 yux0 commented Jul 27, 2022

What changed?
Update shard replication timestamp with max generated task

Why?
The namespace migration workflow use the task timestamp to calculate replication lag. We should use the timestamp from replication stack instead of real timestamp.

How did you test it?

Potential risks

Is hotfix candidate?

}

func (p *ackMgrImpl) GetMaxTaskID() int64 {
func (p *ackMgrImpl) GetMaxTaskInfo() (int64, time.Time) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: should we define a struct for return value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

don't think it is necessary here.

service/history/replication/ack_manager.go Outdated Show resolved Hide resolved
service/history/replication/ack_manager.go Outdated Show resolved Hide resolved
@@ -121,7 +121,7 @@ func (a *activities) checkReplicationOnce(ctx context.Context, waitRequest waitR
// Caught up to the last checked IDs, and within allowed lagging range
if clusterInfo.AckedTaskId >= waitRequest.WaitForTaskIds[shard.ShardId] &&
(shard.MaxReplicationTaskId-clusterInfo.AckedTaskId <= waitRequest.AllowedLaggingTasks ||
shard.ShardLocalTime.Sub(*clusterInfo.AckedTaskVisibilityTime) <= waitRequest.AllowedLagging) {
shard.MaxReplicationTaskVisibilityTime.Sub(*clusterInfo.AckedTaskVisibilityTime) <= waitRequest.AllowedLagging) {
Copy link
Contributor

Choose a reason for hiding this comment

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

do we have any integration tests which can validate the result here?

Copy link
Contributor Author

@yux0 yux0 Jul 27, 2022

Choose a reason for hiding this comment

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

Added a unit test in ack manager. The e2e is covered with int test.

@yux0 yux0 marked this pull request as ready for review July 27, 2022 22:58
@yux0 yux0 requested a review from a team as a code owner July 27, 2022 22:58
@yux0 yux0 merged commit e96d485 into temporalio:master Jul 28, 2022
@yux0 yux0 deleted the replication-ack-ts branch July 28, 2022 23:41
yux0 added a commit that referenced this pull request Jul 29, 2022
* Update shard replication timestamp with max generated task
yux0 added a commit to yux0/temporal that referenced this pull request Aug 3, 2022
…o#3158)

* Update shard replication timestamp with max generated task
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.

None yet

3 participants