A backup that finishes on a slow line
A snapshot sent over a home uplink that gives the backup 1 to 2 Mbit/s used to fail every time: each put got a deadline from a fixed 5 Mbit/s floor (66 s for a 4 MB chunk), eight puts shared the line, and the run retried from the top (#13743). Now:
- Deadline. A put's deadline is the longer of the floor's and three times its bytes at the
rate the line has actually landed puts at, over its share (src/snapshot/line.ts,
withRetries in src/snapshot/store.ts). It is the put's own, never what is left of the
run. A put that moves nothing still times out.
- Puts at once. One per megabit the line gives, between one and eight; two until the line
has been measured (putsAtOnce).
- A failed run keeps what it sent. Every run lists the chunks the lane holds (for the
sealed lane, under their hidden names) and sends only the rest, so a killed run resumes without re-sending; this was already true of the sealed lane and is now tested.
- Progress. The log line
in progress, the Backups page, the terminal's Resilience screen
and the backup.progress event say bytes sent, "N of M chunks already there", bytes to go
(estimated from the last snapshot's size), the rate and when it will be done.
Tests: test/snapshot-slow-line.test.ts.