Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
hehaifengcn committed Aug 24, 2023
1 parent b3a7ec4 commit 85ba995
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions service/worker/migration/activities.go
Expand Up @@ -61,10 +61,10 @@ type (
}

replicationTasksHeartbeatDetails struct {
NextIndex int
CheckPoint time.Time
LastNotFoundWorkflowExecution commonpb.WorkflowExecution
LastVerifiedIndex int
NextIndex int
CheckPoint time.Time
LastNotVerifiedWorkflowExecution commonpb.WorkflowExecution
LastVerifiedIndex int
}

verifyStatus int
Expand Down Expand Up @@ -683,7 +683,7 @@ func (a *activities) verifyReplicationTasks(
}

if !r.isVerified() {
details.LastNotFoundWorkflowExecution = request.Executions[details.NextIndex]
details.LastNotVerifiedWorkflowExecution = request.Executions[details.NextIndex]
break
}

Expand Down Expand Up @@ -786,7 +786,7 @@ func (a *activities) VerifyReplicationTasks(ctx context.Context, request *verify
return response, temporal.NewNonRetryableApplicationError(
fmt.Sprintf("verifyReplicationTasks was not able to make progress for more than %v minutes (not retryable). Not found WorkflowExecution: %v, Checkpoint: %v",
diff.Minutes(),
details.LastNotFoundWorkflowExecution, details.CheckPoint),
details.LastNotVerifiedWorkflowExecution, details.CheckPoint),
"", nil)
}
}
Expand Down
8 changes: 4 additions & 4 deletions service/worker/migration/activities_test.go
Expand Up @@ -211,7 +211,7 @@ func (s *activitiesSuite) TestVerifyReplicationTasks_Success() {
s.Greater(len(iceptor.replicationRecordedHeartbeats), 0)
lastHeartBeat := iceptor.replicationRecordedHeartbeats[len(iceptor.replicationRecordedHeartbeats)-1]
s.Equal(len(request.Executions), lastHeartBeat.NextIndex)
s.Equal(execution2, lastHeartBeat.LastNotFoundWorkflowExecution)
s.Equal(execution2, lastHeartBeat.LastNotVerifiedWorkflowExecution)
}

func (s *activitiesSuite) TestVerifyReplicationTasks_SkipWorkflowExecution() {
Expand Down Expand Up @@ -272,7 +272,7 @@ func (s *activitiesSuite) TestVerifyReplicationTasks_SkipWorkflowExecution() {
s.Equal(0, lastHeartBeat.NextIndex)
}

s.Equal(emptyExecutions, lastHeartBeat.LastNotFoundWorkflowExecution)
s.Equal(emptyExecutions, lastHeartBeat.LastNotVerifiedWorkflowExecution)
s.True(lastHeartBeat.CheckPoint.After(start))
}
}
Expand Down Expand Up @@ -310,7 +310,7 @@ func (s *activitiesSuite) TestVerifyReplicationTasks_FailedNotFound() {
s.Greater(len(iceptor.replicationRecordedHeartbeats), 0)
lastHeartBeat := iceptor.replicationRecordedHeartbeats[len(iceptor.replicationRecordedHeartbeats)-1]
s.Equal(0, lastHeartBeat.NextIndex)
s.Equal(execution1, lastHeartBeat.LastNotFoundWorkflowExecution)
s.Equal(execution1, lastHeartBeat.LastNotVerifiedWorkflowExecution)
}

func (s *activitiesSuite) TestVerifyReplicationTasks_AlreadyVerified() {
Expand Down Expand Up @@ -505,7 +505,7 @@ func (s *activitiesSuite) Test_verifyReplicationTasks() {
s.GreaterOrEqual(len(tc.remoteExecutionStates), details.NextIndex)
s.Equal(recorder.lastHeartBeat, details)
if details.NextIndex < len(tc.remoteExecutionStates) && tc.remoteExecutionStates[details.NextIndex] == executionNotfound {
s.Equal(execution1, details.LastNotFoundWorkflowExecution)
s.Equal(execution1, details.LastNotVerifiedWorkflowExecution)
}

if len(request.Executions) > 0 {
Expand Down

0 comments on commit 85ba995

Please sign in to comment.