Commit 2262fc6
Drop redundant materializer replay-skip guard
The materializer had a `new_changes` clause that skipped ranges already applied
(<= applied_offset), guarding against the source consumer re-notifying it with
transactions the persistent slot replays after a restart. That dedup now happens
at the source: the consumer skips already-applied transactions (at/below its
restored latest_offset) before `apply_event`, so it never re-notifies the
materializer for them — the guard is unreachable.
Remove it and rely on the single source-level dedup. Confirmed by the
optimized_refetch restart repro (which previously triggered the materializer's
"Key already exists" crash) staying green across repeated runs, plus the
materializer/consumer/subquery suites and the other restore tests.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 24cdcdc commit 2262fc6
2 files changed
Lines changed: 4 additions & 18 deletions
File tree
- packages/sync-service
- lib/electric/shapes/consumer
- test/integration
Lines changed: 0 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
493 | 493 | | |
494 | 494 | | |
495 | 495 | | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | 496 | | |
511 | 497 | | |
512 | 498 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| |||
0 commit comments