Commit 4a67855
fix(run-store): compare the inherited cycle's id set as a set, not as a string
The inherit guard compared the two serialised id arrays. Both are derived from
Postgres reads with no ORDER BY -- the resume reads the run's block edges, the
copy-forward reads the snapshot's waitpoint rows -- so the same set of ids
arrives in an arbitrary order on each append. String equality therefore failed
for almost every wait holding two or more waitpoints, and the mint fell back to
writing a cycle with no records: the exact state the inherit exists to prevent,
missed for the batch fan-in it matters most for.
It now decodes both sides and compares membership, which is what the
decorator's own sameSet does and for the same reason.
The test that was meant to hold this used a single waitpoint, the one case
where string and set comparison agree, so it passed for the wrong reason. It
now uses two waitpoints and re-passes them in the opposite order, and fails
against the string comparison.
Also corrects the guard's comment. It is deliberately weaker than the carry
test the decorator applies on a successful probe, which additionally requires
the order to match: a pointer hands the reader the previous cycle's order,
whereas this mints a fresh cycle from the caller's own, so only the records
have to be right and records are keyed by waitpoint id.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent cf33505 commit 4a67855
3 files changed
Lines changed: 98 additions & 32 deletions
File tree
- internal-packages/run-store/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
456 | 456 | | |
457 | 457 | | |
458 | 458 | | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
463 | 463 | | |
464 | 464 | | |
465 | 465 | | |
| |||
806 | 806 | | |
807 | 807 | | |
808 | 808 | | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
809 | 835 | | |
810 | 836 | | |
811 | 837 | | |
| |||
831 | 857 | | |
832 | 858 | | |
833 | 859 | | |
834 | | - | |
835 | | - | |
836 | | - | |
837 | | - | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
838 | 868 | | |
839 | 869 | | |
840 | 870 | | |
841 | | - | |
| 871 | + | |
842 | 872 | | |
843 | 873 | | |
844 | 874 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
586 | 586 | | |
587 | 587 | | |
588 | 588 | | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
589 | 593 | | |
590 | 594 | | |
591 | 595 | | |
| |||
Lines changed: 55 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
292 | 324 | | |
293 | | - | |
| 325 | + | |
294 | 326 | | |
295 | 327 | | |
296 | 328 | | |
297 | 329 | | |
298 | 330 | | |
299 | 331 | | |
300 | 332 | | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
316 | 337 | | |
317 | 338 | | |
318 | 339 | | |
319 | | - | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
320 | 349 | | |
321 | 350 | | |
322 | | - | |
323 | | - | |
| 351 | + | |
324 | 352 | | |
325 | 353 | | |
326 | | - | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
327 | 360 | | |
328 | 361 | | |
329 | 362 | | |
| |||
332 | 365 | | |
333 | 366 | | |
334 | 367 | | |
335 | | - | |
| 368 | + | |
336 | 369 | | |
337 | | - | |
338 | | - | |
| 370 | + | |
339 | 371 | | |
340 | 372 | | |
341 | 373 | | |
| |||
0 commit comments