Expand description
Driving an index peekโs walk away from the timely worker that owns it.
An offloaded walk steps its scan on the blocking pool, so neither the timely worker nor an
async one carries it. It returns to its async task only to write a batch or to answer, and
checks for cancellation every yield_granularity positions in between. The scan and the permit
that admitted it travel together, and every way the walk ends, a panic included, drops the two
together.
The permit bounds the walks that run, not the walks that exist: an unadmitted walk queues holding its scan, which pins the batches its cursors were opened over, so retained memory grows with offloaded walks rather than running ones.
This driver performs the only IO, so the scan stays free of async colouring. A walk whose rows outgrow an inline answer hands over a full batch, the driver writes it to the peek stash, and the walk carries on from where it stopped.
Structsยง
- Bound ๐
- How many permits the semaphore has issued, and how many it should have.
- Offload
Config ๐ - The parameters an offloaded walk reads, each as a handle rather than a value.
- Offloaded
Peek - An index peek whose walk is running away from the worker that owns it.
- Peek
Permits - The bound on how many offloaded peek walks run at once.
- Walk
Permit ๐ - The permit an offloaded walk holds while it runs, released on drop.
- Walk
State ๐ - What an offloaded walk carries between its async task and the blocking pool.
Functionsยง
- stashed_
answer ๐ - Writes
tail, the rows the walk still held when it ended, toupload, finishes it, and builds the response that names the stashed batch.