Skip to content

Commit

Permalink
Handle branch token update with long poll API (#4943)
Browse files Browse the repository at this point in the history
<!-- Describe what has changed in this PR -->
**What changed?**
Handle branch token update with long poll API

<!-- Tell your future self why have you made these changes -->
**Why?**
Simply compare branch token is not a good way to tell if the branch is
changed.

<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->
**How did you test it?**
release testing

<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->
**Potential risks**

<!-- Is this PR a hotfix candidate or require that a notification be
sent to the broader community? (Yes/No) -->
**Is hotfix candidate?**
Yes
  • Loading branch information
yux0 committed Nov 21, 2023
1 parent 98b5700 commit 6ba388c
Show file tree
Hide file tree
Showing 13 changed files with 831 additions and 576 deletions.
1,090 changes: 612 additions & 478 deletions api/historyservice/v1/request_response.pb.go

Large diffs are not rendered by default.

183 changes: 126 additions & 57 deletions api/token/v1/message.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions common/serviceerror/current_branch_changed.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ type (
)

// NewCurrentBranchChanged returns new CurrentBranchChanged error.
// TODO: Update CurrentBranchChanged with event id and event version. Do not use branch token bytes as branch identity.
func NewCurrentBranchChanged(currentBranchToken, requestBranchToken []byte) error {
return &CurrentBranchChanged{
Message: "Current branch token and request branch token doesn't match.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ message GetMutableStateRequest {
temporal.api.common.v1.WorkflowExecution execution = 2;
int64 expected_next_event_id = 3;
bytes current_branch_token = 4;
temporal.server.api.history.v1.VersionHistoryItem version_history_item = 5;
}

message GetMutableStateResponse {
Expand Down Expand Up @@ -115,6 +116,7 @@ message PollMutableStateRequest {
temporal.api.common.v1.WorkflowExecution execution = 2;
int64 expected_next_event_id = 3;
bytes current_branch_token = 4;
temporal.server.api.history.v1.VersionHistoryItem version_history_item = 5;
}

message PollMutableStateResponse {
Expand Down
1 change: 1 addition & 0 deletions proto/internal/temporal/server/api/token/v1/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ message HistoryContinuation {
temporal.server.api.history.v1.TransientWorkflowTaskInfo transient_workflow_task = 7;
bytes branch_token = 8;
reserved 9;
temporal.server.api.history.v1.VersionHistoryItem version_history_item = 10;
}

message RawHistoryContinuation{
Expand Down
Loading

0 comments on commit 6ba388c

Please sign in to comment.