-
Notifications
You must be signed in to change notification settings - Fork 148
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
Verify history is replayed up to StartedEventId #1916
Verify history is replayed up to StartedEventId #1916
Conversation
@@ -351,7 +348,7 @@ public void sendQueryTask( | |||
task.setPreviousStartedEventId(previousStaredEventId); | |||
// it's not a real workflow task and the server sends 0 for startedEventId for such a workflow | |||
// task | |||
task.setStartedEventId(startedEventId); | |||
task.setStartedEventId(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't say why this was done this way since the comment in the code acknowledges it should be zero
@@ -264,13 +268,29 @@ private void applyServerHistory(WorkflowHistoryIterator historyIterator) { | |||
timerStopped = true; | |||
} | |||
} | |||
if (!replayFailed) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can replayFailed
ever be true
on this line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're right that was an error
Verify history is replayed up to StartedEventId. Previously the Java SDK did not verify it repalyed up to StartedEventId sent on the poll request when processing a workflow task. This lead to the Java SDK not replaying the full workflow history if it was fetching history using GetWorkflowExecutionHistory after receiving a partial history with no cached execution and hitting a stale history node.
Go SDK also has a similar check: https://github.com/temporalio/sdk-go/blob/3cccbdd5f47d640fffe6651e4f49c236a4803a47/internal/internal_task_handlers.go#L383
closes #1915