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

Verify history is replayed up to StartedEventId #1916

Merged
merged 5 commits into from
Oct 30, 2023

Conversation

Quinn-With-Two-Ns
Copy link
Contributor

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

@Quinn-With-Two-Ns Quinn-With-Two-Ns marked this pull request as ready for review October 30, 2023 16:16
@Quinn-With-Two-Ns Quinn-With-Two-Ns requested a review from a team as a code owner October 30, 2023 16:16
@@ -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);
Copy link
Contributor Author

@Quinn-With-Two-Ns Quinn-With-Two-Ns Oct 30, 2023

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) {
Copy link
Member

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?

Copy link
Contributor Author

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

@Quinn-With-Two-Ns Quinn-With-Two-Ns merged commit 503cae7 into temporalio:master Oct 30, 2023
4 checks passed
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.

Java SDK should verify it replays up to StartedEventId when processing a workflow task
3 participants