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

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

scout/forge:scout/3108-sentinel-drill-was-degraded-1440-minutes → main 1 commit fork

  • Merged. scout/3108-sentinel-drill-was-degraded-1440-minutes was merged into main as 4ad0149.

Review

Sign in to review this change.
2 files changed +13 −4
src/snapshot/restore.ts +9 −2
@@ -37,7 +37,6 @@ import { runGit } from "../git/env.ts";
3737 import { installHooks } from "../git/hooks.ts";
3838 import { repoDir } from "../git/repos.ts";
3939 import {
40 IN_FLIGHT,
4140 IN_FLIGHT_BYTES,
4241 isRunBundle,
4342 keyOf,
@@ -108,6 +107,14 @@ async function sealedNames(dbFile: string): Promise<string[]> {
108107 }
109108 }
110109
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
111118 /**
112119 * Every file the manifest lists, read with several gets in flight at once
113120 * and checked against its size, each handed to `each` as it lands. Read
@@ -129,7 +136,7 @@ async function fetchAll(
129136 let held = 0;
130137 for (const [at, entry] of entries.entries()) {
131138 while (
132 (pending.size >= IN_FLIGHT ||
139 (pending.size >= RESTORE_IN_FLIGHT ||
133140 (pending.size > 0 && held + entry.bytes > maxBytes)) &&
134141 failure === undefined
135142 )
test/snapshot-restore-parallel.test.ts +4 −2
@@ -12,7 +12,7 @@ import { rm } from "node:fs/promises";
1212 import { tmpdir } from "node:os";
1313 import { join } from "node:path";
1414 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";
1616 import { IN_FLIGHT } from "../src/snapshot/snapshot.ts";
1717 import { dirStore, type Store } from "../src/snapshot/store.ts";
1818
@@ -97,7 +97,9 @@ describe("a restore reads in parallel", () => {
9797 const restored = await restoreSnapshot(store, NAME, dataDir);
9898 expect(restored.files).toBe(FILES);
9999 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);
101103 for (let n = 0; n < FILES; n++)
102104 expect(readFileSync(join(dataDir, "apps/a", `file-${n}.txt`), "utf8")).toBe(`file ${n}\n`);
103105 });

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs