Commit 0164b45
committed
Delay version replay callback until marker match
Change VersionStateMachine replay semantics so getVersion no longer resumes workflow code when the fake RECORD_MARKER command is created. Replay now waits until the real MARKER_RECORDED event is matched before firing the version callback, which makes version-marker ordering consistent with replayed side effects.
This fixes the interleaved update replay bug reproduced by testGetVersionInterleavedUpdateReplayHistory.json. That history previously failed replay with [TMPRL1100] because the second getVersion callback ran ahead of update completion protocol handling. After this change, the same recorded history replays successfully through both WorkflowReplayer and the lower-level direct-query replay task handler.
The earlier flag-gated experiment showed that delaying the callback was already safe for histories with SKIP_YIELD_ON_VERSION. This commit removes that temporary gating and applies the same replay ordering to all histories.
Verified with:
./gradlew --offline :temporal-sdk:test --tests "io.temporal.workflow.versionTests.GetVersionMultithreadingRemoveTest" --tests "io.temporal.workflow.versionTests.GetVersionRemovedInReplayTest" --tests "io.temporal.workflow.versionTests.GetVersionWithoutCommandEventTest" --tests "io.temporal.workflow.versionTests.GetVersionAndTimerTest" --tests "io.temporal.workflow.versionTests.GetVersionMultipleCallsTest" --tests "io.temporal.workflow.versionTests.GetVersionInSignalTest" --tests "io.temporal.workflow.versionTests.GetVersionMultithreadingTest" --tests "io.temporal.workflow.versionTests.GetVersionInterleavedUpdateReplayTest" --tests "io.temporal.internal.replay.GetVersionInterleavedUpdateReplayTaskHandlerTest"
./gradlew --offline :temporal-sdk:test --tests "io.temporal.workflow.versionTests.GetVersionInterleavedUpdateReplayTest" --tests "io.temporal.internal.replay.GetVersionInterleavedUpdateReplayTaskHandlerTest"1 parent 3c8d82e commit 0164b45
File tree
4 files changed
+21
-112
lines changed- temporal-sdk/src
- main/java/io/temporal/internal/statemachines
- test/java/io/temporal
- internal/replay
- workflow/versionTests
4 files changed
+21
-112
lines changedLines changed: 8 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
| |||
265 | 264 | | |
266 | 265 | | |
267 | 266 | | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
| 267 | + | |
| 268 | + | |
282 | 269 | | |
283 | 270 | | |
284 | 271 | | |
| |||
301 | 288 | | |
302 | 289 | | |
303 | 290 | | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
311 | 296 | | |
312 | 297 | | |
313 | 298 | | |
| |||
380 | 365 | | |
381 | 366 | | |
382 | 367 | | |
383 | | - | |
384 | 368 | | |
385 | 369 | | |
386 | | - | |
387 | | - | |
| 370 | + | |
388 | 371 | | |
389 | 372 | | |
390 | 373 | | |
391 | 374 | | |
392 | 375 | | |
393 | | - | |
394 | 376 | | |
395 | 377 | | |
396 | 378 | | |
397 | 379 | | |
398 | | - | |
399 | 380 | | |
400 | 381 | | |
401 | 382 | | |
| |||
Lines changed: 2 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
660 | 660 | | |
661 | 661 | | |
662 | 662 | | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | | - | |
667 | | - | |
| 663 | + | |
668 | 664 | | |
669 | 665 | | |
670 | 666 | | |
| |||
1252 | 1248 | | |
1253 | 1249 | | |
1254 | 1250 | | |
1255 | | - | |
1256 | | - | |
1257 | | - | |
1258 | | - | |
1259 | | - | |
| 1251 | + | |
1260 | 1252 | | |
1261 | 1253 | | |
1262 | 1254 | | |
| |||
Lines changed: 8 additions & 60 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
| 4 | + | |
| 5 | + | |
7 | 6 | | |
8 | 7 | | |
9 | | - | |
10 | | - | |
11 | 8 | | |
12 | 9 | | |
13 | 10 | | |
| |||
30 | 27 | | |
31 | 28 | | |
32 | 29 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | 30 | | |
38 | 31 | | |
39 | 32 | | |
40 | 33 | | |
41 | 34 | | |
42 | | - | |
| 35 | + | |
43 | 36 | | |
44 | 37 | | |
45 | 38 | | |
| |||
62 | 55 | | |
63 | 56 | | |
64 | 57 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
86 | 63 | | |
87 | 64 | | |
88 | 65 | | |
| |||
139 | 116 | | |
140 | 117 | | |
141 | 118 | | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | 119 | | |
172 | 120 | | |
173 | 121 | | |
| |||
Lines changed: 3 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | 3 | | |
7 | 4 | | |
8 | 5 | | |
| |||
26 | 23 | | |
27 | 24 | | |
28 | 25 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | 26 | | |
34 | 27 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
43 | 31 | | |
44 | 32 | | |
45 | 33 | | |
| |||
0 commit comments