Commit aee3f07
committed
fix(run-store): give a snapshot one identity and one instant across both stores
Three defects, all of which passed the existing suites because no test drove a
snapshot that actually carried waitpoints, and because the parity suite compared
createdAt against a value it had just read back from the row.
The decorator never passed a cycle to the append, so no wp:<cycleSeq> key was
written for any snapshot and the completed-waitpoint side of Redis was
permanently empty. It now mints a cycle when the id set differs from the current
head and carries the previous cycleSeq forward when it does not, so a resume
writes the record set once and the copy-forwards that follow write no key at
all.
The since-window hydration returned an empty completedWaitpointOrder. That
column is not the join: the engine reads it off the head row as the oracle that
gives each completed waitpoint its position in a batch, so an empty order
resumed every batched triggerAndWait with an undefined index.
Seven of the eight write sites stamped the entry from the app clock while
Postgres stamped its own column default, so the two stores held different
instants for one snapshot. The decorator now supplies createdAt, and an equal
updatedAt, at every site, and the standalone path supplies it too rather than
reading the row back. Beyond making the field comparable, this aligns the
since-window: the cursor is resolved from one store and applied in the other,
and two different instants misfilter that window.
The parity suite gains an independent clock-provenance guard, and a case proving
an absent instant still takes the database default, which is what keeps the
store's behaviour unchanged while the decorator is off.1 parent 8119466 commit aee3f07
16 files changed
Lines changed: 1269 additions & 175 deletions
File tree
- internal-packages
- run-engine/src/engine/tests
- run-store
- scripts
- src
- testFixtures
Lines changed: 400 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 43 additions & 37 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
91 | 96 | | |
92 | 97 | | |
93 | 98 | | |
| |||
186 | 191 | | |
187 | 192 | | |
188 | 193 | | |
189 | | - | |
190 | | - | |
191 | | - | |
| 194 | + | |
192 | 195 | | |
193 | 196 | | |
194 | 197 | | |
| |||
260 | 263 | | |
261 | 264 | | |
262 | 265 | | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
280 | 272 | | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
296 | 302 | | |
297 | | - | |
| 303 | + | |
298 | 304 | | |
Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
180 | 182 | | |
181 | | - | |
182 | | - | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
183 | 187 | | |
184 | 188 | | |
185 | 189 | | |
| |||
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
154 | 156 | | |
155 | 157 | | |
156 | 158 | | |
| |||
226 | 228 | | |
227 | 229 | | |
228 | 230 | | |
229 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
230 | 234 | | |
231 | 235 | | |
232 | 236 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
744 | 744 | | |
745 | 745 | | |
746 | 746 | | |
| 747 | + | |
| 748 | + | |
747 | 749 | | |
748 | 750 | | |
749 | 751 | | |
| |||
831 | 833 | | |
832 | 834 | | |
833 | 835 | | |
| 836 | + | |
| 837 | + | |
834 | 838 | | |
835 | 839 | | |
836 | 840 | | |
| |||
942 | 946 | | |
943 | 947 | | |
944 | 948 | | |
| 949 | + | |
| 950 | + | |
945 | 951 | | |
946 | 952 | | |
947 | 953 | | |
| |||
1147 | 1153 | | |
1148 | 1154 | | |
1149 | 1155 | | |
| 1156 | + | |
| 1157 | + | |
1150 | 1158 | | |
1151 | 1159 | | |
1152 | 1160 | | |
| |||
1277 | 1285 | | |
1278 | 1286 | | |
1279 | 1287 | | |
| 1288 | + | |
| 1289 | + | |
1280 | 1290 | | |
1281 | 1291 | | |
1282 | 1292 | | |
| |||
1382 | 1392 | | |
1383 | 1393 | | |
1384 | 1394 | | |
| 1395 | + | |
| 1396 | + | |
1385 | 1397 | | |
1386 | 1398 | | |
1387 | 1399 | | |
| |||
1454 | 1466 | | |
1455 | 1467 | | |
1456 | 1468 | | |
| 1469 | + | |
| 1470 | + | |
1457 | 1471 | | |
1458 | 1472 | | |
1459 | 1473 | | |
| |||
1984 | 1998 | | |
1985 | 1999 | | |
1986 | 2000 | | |
| 2001 | + | |
1987 | 2002 | | |
1988 | 2003 | | |
1989 | 2004 | | |
| |||
2014 | 2029 | | |
2015 | 2030 | | |
2016 | 2031 | | |
2017 | | - | |
| 2032 | + | |
2018 | 2033 | | |
2019 | 2034 | | |
2020 | 2035 | | |
| |||
2049 | 2064 | | |
2050 | 2065 | | |
2051 | 2066 | | |
| 2067 | + | |
| 2068 | + | |
2052 | 2069 | | |
2053 | 2070 | | |
2054 | 2071 | | |
| |||
Lines changed: 23 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
| 27 | + | |
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
| |||
42 | 41 | | |
43 | 42 | | |
44 | 43 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
63 | 65 | | |
64 | | - | |
| 66 | + | |
65 | 67 | | |
66 | 68 | | |
67 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
82 | | - | |
83 | | - | |
| 81 | + | |
0 commit comments