Commit 652f314
committed
persist: fetch source parts concurrently
Hydrating a shard with many small parts is bound by the blob-store
round-trip rather than bandwidth. Let `shard_source_fetch` issue several
part fetches at once so the round-trips overlap.
The fetch operator stays an async timely operator. Two changes make it
safe to complete fetches out of order:
* Key the operator's capability bookkeeping by the time a part was minted
at rather than by arrival (FIFO) order. For each time we retain a data
and a completed-fetches capability and count the outstanding fetches at
that time; when the count reaches zero both capabilities drop, advancing
the data frontier and releasing that time's leases. Results can now
complete in any order without advancing the frontier past unproduced
data.
* Run up to `persist_source_fetch_concurrency` (default 1, i.e. the
previous serial behavior) fetches at once via a `FuturesUnordered`, each
on a cheap per-call `BatchFetcher` clone that shares the schema cache.
In-flight bytes stay bounded by the existing fetch semaphore inside
`fetch_leased_part`.
On a missing blob the operator reports the error and freezes (retains all
capabilities, stops draining results) exactly as before, so the frontier
never advances past a part we failed to emit. New tests cover data
fetching, mid-stream shutdown, the listing- and fetch-path freezes, and
the concurrent fetch and concurrent-freeze paths.
Recreates antiguru#181 on top of the async operators,
omitting that PR's deasync refactor of the shard_source operators (and
its dependent txn-wal and introspection-naming follow-ups).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MR6SwYEgWVmMJUGn4ZmLMX1 parent 5f2a19d commit 652f314
3 files changed
Lines changed: 783 additions & 60 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
| 315 | + | |
315 | 316 | | |
316 | 317 | | |
317 | 318 | | |
| |||
489 | 490 | | |
490 | 491 | | |
491 | 492 | | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
492 | 504 | | |
493 | 505 | | |
494 | 506 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
158 | 185 | | |
159 | 186 | | |
160 | 187 | | |
| |||
0 commit comments