Commit 26671bf
committed
mirror_worker: stream and incrementally commit add-entries uploads
Replace the whole-body buffer with a streaming decode: gunzip and parse
the body as it arrives through a small stream-buffer adapter (retry the
parse as chunks land, consume on success), so a large upload no longer
holds the entire body in memory.
Persist incrementally every `commit_packages` packages (default 32, config
capped at 1024) so a long or interrupted upload advances the frontier as
it streams rather than only at the end. Each flush commits from the last
persisted frontier and is resumable; the running frontier is threaded
locally across flushes so the DO is not re-queried between chunks. Tiles
are immutable and content-addressed and the DO advance is a monotone
compare-and-swap, so a repeated or concurrent flush of the same range is
harmless.1 parent 628f4c7 commit 26671bf
8 files changed
Lines changed: 811 additions & 204 deletions
File tree
- crates/mirror_worker
- config/src
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
33 | 40 | | |
34 | 41 | | |
35 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
65 | 72 | | |
66 | 73 | | |
67 | 74 | | |
| |||
118 | 125 | | |
119 | 126 | | |
120 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
121 | 139 | | |
122 | 140 | | |
123 | 141 | | |
| |||
141 | 159 | | |
142 | 160 | | |
143 | 161 | | |
144 | | - | |
145 | | - | |
146 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
147 | 165 | | |
148 | 166 | | |
149 | 167 | | |
| |||
340 | 358 | | |
341 | 359 | | |
342 | 360 | | |
| 361 | + | |
343 | 362 | | |
344 | 363 | | |
345 | 364 | | |
| |||
464 | 483 | | |
465 | 484 | | |
466 | 485 | | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
467 | 494 | | |
468 | 495 | | |
469 | 496 | | |
| |||
532 | 559 | | |
533 | 560 | | |
534 | 561 | | |
| 562 | + | |
535 | 563 | | |
536 | 564 | | |
537 | 565 | | |
| |||
0 commit comments