Commit d9d2f62
authored
Mutable state changes for workflow pause. (#8560)
## What changed?
**Note**: This depends on temporalio/api#653.
Sending it for some early feedback.
- Made changes to `WorkflowPauseInfo` (in WorkflowExecutionInfo).
Reusing unused proto fields.
- Added mutablestate.IsWorkflowExecutionPaused()
- Added mutablestate.AddWorkflowExecutionPausedEvent()
## Why?
- These changes are needed to implement pause/unpause features.
## How did you test it?
- [x] built
- [ ] run locally and tested manually
- [ ] covered by existing tests
- [x] added new unit test(s)
- [ ] added new functional test(s)
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Adds workflow-level pause/unpause with new `WorkflowPauseInfo` fields,
client endpoints, history event handling, state/status validation for
`PAUSED`, and tests; removes activity-level pause info.
>
> - **Protocol/API**:
> - Redefine `persistence.v1.WorkflowPauseInfo` to `{pause_time,
identity, reason, request_id}`; remove `ActivityPauseInfo` and related
helpers.
> - Bump dependency `go.temporal.io/api` and adjust generated code
indexes.
> - Update RPC metadata, redirection maps, quotas, and log tags for
`PauseWorkflowExecution`/`UnpauseWorkflowExecution`.
> - **Frontend Clients**:
> - Add `PauseWorkflowExecution` and `UnpauseWorkflowExecution` to
`client_impl`, `metric_client`, `retryable_client`, and mocks.
> - **History/State**:
> - Add `WorkflowExecutionPaused` event creation
(`Create/Add...PausedEvent`) with buffering rules (paused allowed to
buffer; unpaused not buffered).
> - Implement `ApplyWorkflowExecutionPausedEvent`: set status `PAUSED`,
populate `executionInfo.PauseInfo`, invalidate pending activities and
workflow task via stamps.
> - Rebuilder applies paused event; state transition validation supports
`PAUSED` across CREATED/RUNNING/ZOMBIE.
> - **Validation/Tests**:
> - Allow `WORKFLOW_EXECUTION_STATUS_PAUSED` in validators; expand unit
tests for create/update state/status and paused behavior.
> - **Tooling**:
> - `buf.yaml` breaking ignore for `executions.proto`.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
951c9c4. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 2c9211f commit d9d2f62
File tree
29 files changed
+922
-381
lines changed- api/persistence/v1
- client/frontend
- common
- api
- log/tag
- persistence
- rpc/interceptor
- logtags
- testing/mockapi/workflowservicemock/v1
- proto/internal
- temporal/server/api/persistence/v1
- service
- frontend/configs
- history
- historybuilder
- interfaces
- workflow
29 files changed
+922
-381
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| 165 | + | |
| 166 | + | |
165 | 167 | | |
166 | 168 | | |
167 | 169 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | | - | |
44 | | - | |
45 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
46 | 52 | | |
47 | 53 | | |
48 | 54 | | |
| |||
61 | 67 | | |
62 | 68 | | |
63 | 69 | | |
64 | | - | |
65 | | - | |
66 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
67 | 83 | | |
68 | 84 | | |
69 | 85 | | |
| |||
Lines changed: 22 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
| 50 | + | |
49 | 51 | | |
50 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
51 | 57 | | |
52 | 58 | | |
53 | 59 | | |
| |||
105 | 111 | | |
106 | 112 | | |
107 | 113 | | |
108 | | - | |
| 114 | + | |
109 | 115 | | |
110 | 116 | | |
111 | 117 | | |
112 | 118 | | |
113 | 119 | | |
114 | 120 | | |
| 121 | + | |
115 | 122 | | |
116 | 123 | | |
| 124 | + | |
117 | 125 | | |
118 | 126 | | |
119 | | - | |
| 127 | + | |
120 | 128 | | |
121 | 129 | | |
122 | 130 | | |
123 | 131 | | |
124 | 132 | | |
125 | | - | |
| 133 | + | |
126 | 134 | | |
127 | 135 | | |
128 | 136 | | |
| |||
131 | 139 | | |
132 | 140 | | |
133 | 141 | | |
| 142 | + | |
134 | 143 | | |
| 144 | + | |
135 | 145 | | |
136 | | - | |
| 146 | + | |
137 | 147 | | |
138 | 148 | | |
139 | 149 | | |
140 | 150 | | |
141 | 151 | | |
142 | | - | |
| 152 | + | |
143 | 153 | | |
144 | 154 | | |
145 | 155 | | |
| |||
148 | 158 | | |
149 | 159 | | |
150 | 160 | | |
| 161 | + | |
151 | 162 | | |
| 163 | + | |
152 | 164 | | |
153 | | - | |
| 165 | + | |
154 | 166 | | |
155 | 167 | | |
156 | 168 | | |
157 | 169 | | |
158 | 170 | | |
159 | | - | |
| 171 | + | |
160 | 172 | | |
161 | 173 | | |
162 | 174 | | |
| |||
165 | 177 | | |
166 | 178 | | |
167 | 179 | | |
| 180 | + | |
168 | 181 | | |
| 182 | + | |
169 | 183 | | |
170 | | - | |
| 184 | + | |
171 | 185 | | |
172 | 186 | | |
173 | 187 | | |
Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments