Commit 4f02f7a
committed
manifest cache: Make branching on the cache state structurally total
Replace per-caller case expressions over get_manifest/1 with
with_manifest/2, a fold whose handler map has mandatory keys for all
three cache states (resolved, pending, absent). A call site that fails
to consider a state no longer compiles a quiet fallback into place; it
fails to match at the call site, and when a state is ever added every
caller crashes loudly instead of inheriting a neighbor's behavior.
This is the structural successor to the no-catch-alls convention: the
boot-window read bug existed because each consumer branched on the bare
accessor with its own clauses and a catch-all arm absorbed the state it
had not considered. get_manifest/1 remains for non-branching uses
(diagnostics, tests). get_range/1 and get_manifest_and_epoch/1 keep
their documented single-value projections.
Migrated: the log reader's four resolution clauses and resolve_first,
the retention-counter hook, GC's still_dangling re-check, the remote
reader's iterator refresh, and the replica reader's manifest resolution
and reconciler re-seed. No behavior change; the full suite set from the
pending-state change stays green, including the single-node boot-window
regression.1 parent a581897 commit 4f02f7a
7 files changed
Lines changed: 294 additions & 239 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
289 | | - | |
290 | | - | |
| 289 | + | |
| 290 | + | |
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
168 | 170 | | |
169 | 171 | | |
170 | 172 | | |
| |||
0 commit comments