Public: anyone can read this; the crew can change it.
Sentinel: drill was degraded 1440 minutes today: The last restore drill passed with 3 min 10 s to spare; download took 13 min 35 s of it. #3115
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/3108-sentinel-drill-was-degraded-1440-minutes → main 1 commit fork
2 files
changed +13
−4
src/snapshot/restore.ts +9 −2
| @@ -37,7 +37,6 @@ import { runGit } from "../git/env.ts"; | ||
| 37 | 37 | import { installHooks } from "../git/hooks.ts"; |
| 38 | 38 | import { repoDir } from "../git/repos.ts"; |
| 39 | 39 | import { |
| 40 | IN_FLIGHT, | |
| 41 | 40 | IN_FLIGHT_BYTES, |
| 42 | 41 | isRunBundle, |
| 43 | 42 | keyOf, |
| @@ -108,6 +107,14 @@ async function sealedNames(dbFile: string): Promise<string[]> { | ||
| 108 | 107 | } |
| 109 | 108 | } |
| 110 | 109 | |
| 110 | /** | |
| 111 | * Gets in flight at once on a restore: three times the upload's. The | |
| 112 | * 2026-10-20 drill spent 13 min 35 s of its 16 on download (#3108); reads | |
| 113 | * hold nothing but their own bodies, so more of them may share the memory | |
| 114 | * cap below. | |
| 115 | */ | |
| 116 | export const RESTORE_IN_FLIGHT = 24; | |
| 117 | ||
| 111 | 118 | /** |
| 112 | 119 | * Every file the manifest lists, read with several gets in flight at once |
| 113 | 120 | * and checked against its size, each handed to `each` as it lands. Read |
| @@ -129,7 +136,7 @@ async function fetchAll( | ||
| 129 | 136 | let held = 0; |
| 130 | 137 | for (const [at, entry] of entries.entries()) { |
| 131 | 138 | while ( |
| 132 | (pending.size >= IN_FLIGHT || | |
| 139 | (pending.size >= RESTORE_IN_FLIGHT || | |
| 133 | 140 | (pending.size > 0 && held + entry.bytes > maxBytes)) && |
| 134 | 141 | failure === undefined |
| 135 | 142 | ) |
test/snapshot-restore-parallel.test.ts +4 −2
| @@ -12,7 +12,7 @@ import { rm } from "node:fs/promises"; | ||
| 12 | 12 | import { tmpdir } from "node:os"; |
| 13 | 13 | import { join } from "node:path"; |
| 14 | 14 | import type { runGit } from "../src/git/env.ts"; |
| 15 | import { restoreSnapshot } from "../src/snapshot/restore.ts"; | |
| 15 | import { restoreSnapshot, RESTORE_IN_FLIGHT } from "../src/snapshot/restore.ts"; | |
| 16 | 16 | import { IN_FLIGHT } from "../src/snapshot/snapshot.ts"; |
| 17 | 17 | import { dirStore, type Store } from "../src/snapshot/store.ts"; |
| 18 | 18 | |
| @@ -97,7 +97,9 @@ describe("a restore reads in parallel", () => { | ||
| 97 | 97 | const restored = await restoreSnapshot(store, NAME, dataDir); |
| 98 | 98 | expect(restored.files).toBe(FILES); |
| 99 | 99 | expect(store.most()).toBeGreaterThan(1); |
| 100 | expect(store.most()).toBeLessThanOrEqual(IN_FLIGHT); | |
| 100 | // Reads outrun the upload's eight (#3108) but keep to their own line. | |
| 101 | expect(store.most()).toBeGreaterThan(IN_FLIGHT); | |
| 102 | expect(store.most()).toBeLessThanOrEqual(RESTORE_IN_FLIGHT); | |
| 101 | 103 | for (let n = 0; n < FILES; n++) |
| 102 | 104 | expect(readFileSync(join(dataDir, "apps/a", `file-${n}.txt`), "utf8")).toBe(`file ${n}\n`); |
| 103 | 105 | }); |
new above
offline