Commit 6aef3c7
Prevent shape removal during restart (bug 6)
Bug 6 surfaced as a 409 (must-refetch) on a healthy subquery shape after a
StackSupervisor restart, with a deterministic regression test that fails
without the fix:
- consumer.ex: notify_materializer_of_new_changes/3 now catches the :exit
(:noproc / transient :normal/:shutdown) from its inline materializer call.
Previously, when the materializer died mid-call during shutdown the
consumer crashed with a non-shutdown reason, routed through
handle_writer_termination, and removed the shape from disk — leaving it
half-removed (the SLC was already gone) and 409ing after restart. The
pending :DOWN now drives a clean stop instead.
This is the part of the fix battle-tested in rob/restore-subqueries-bug-5.
The earlier speculative ArgumentError fallbacks in shape_status.ex and api.ex
turned out not to be needed and have been dropped.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 6a8b48c commit 6aef3c7
3 files changed
Lines changed: 77 additions & 0 deletions
File tree
- .changeset
- packages/sync-service
- lib/electric/shapes
- test/electric/shapes
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1063 | 1063 | | |
1064 | 1064 | | |
1065 | 1065 | | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
1066 | 1078 | | |
1067 | 1079 | | |
1068 | 1080 | | |
| |||
Lines changed: 56 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2760 | 2760 | | |
2761 | 2761 | | |
2762 | 2762 | | |
| 2763 | + | |
| 2764 | + | |
| 2765 | + | |
| 2766 | + | |
| 2767 | + | |
| 2768 | + | |
| 2769 | + | |
| 2770 | + | |
| 2771 | + | |
| 2772 | + | |
| 2773 | + | |
| 2774 | + | |
| 2775 | + | |
| 2776 | + | |
| 2777 | + | |
| 2778 | + | |
| 2779 | + | |
| 2780 | + | |
| 2781 | + | |
| 2782 | + | |
| 2783 | + | |
| 2784 | + | |
| 2785 | + | |
| 2786 | + | |
| 2787 | + | |
| 2788 | + | |
| 2789 | + | |
| 2790 | + | |
| 2791 | + | |
| 2792 | + | |
| 2793 | + | |
| 2794 | + | |
| 2795 | + | |
| 2796 | + | |
| 2797 | + | |
| 2798 | + | |
| 2799 | + | |
| 2800 | + | |
| 2801 | + | |
| 2802 | + | |
| 2803 | + | |
| 2804 | + | |
| 2805 | + | |
| 2806 | + | |
| 2807 | + | |
| 2808 | + | |
| 2809 | + | |
| 2810 | + | |
| 2811 | + | |
| 2812 | + | |
| 2813 | + | |
| 2814 | + | |
| 2815 | + | |
| 2816 | + | |
| 2817 | + | |
| 2818 | + | |
2763 | 2819 | | |
2764 | 2820 | | |
2765 | 2821 | | |
| |||
0 commit comments