@substrat-run/control-plane-api 0.155.0 → 0.156.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.d.ts +8 -0
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +736 -93
- package/dist/api.js.map +1 -1
- package/dist/copy-job.d.ts +194 -0
- package/dist/copy-job.d.ts.map +1 -0
- package/dist/copy-job.js +237 -0
- package/dist/copy-job.js.map +1 -0
- package/dist/deploy.d.ts +1 -1
- package/dist/deploy.d.ts.map +1 -1
- package/dist/deploy.js +1 -1
- package/dist/deploy.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/platform-entry.generated.d.ts +1 -1
- package/dist/platform-entry.generated.d.ts.map +1 -1
- package/dist/platform-entry.generated.js +2 -2
- package/dist/platform-entry.generated.js.map +1 -1
- package/dist/vertical-client.d.ts +80 -7
- package/dist/vertical-client.d.ts.map +1 -1
- package/dist/vertical-client.js +118 -70
- package/dist/vertical-client.js.map +1 -1
- package/package.json +9 -9
|
@@ -24,6 +24,6 @@ export const PLATFORM_ENTRY_ALS_FALLBACK = "const AsyncLocalStorage = undefined;
|
|
|
24
24
|
* re-exports its class, when a vertical declares schedules and brings no sweeper of its own.
|
|
25
25
|
*/
|
|
26
26
|
export const PLATFORM_SWEEPER_MODULE = 'substrat-platform-sweeper.js';
|
|
27
|
-
/** The sweeper itself —
|
|
28
|
-
export const PLATFORM_SWEEPER_SOURCE = "// packages/adapter-cloudflare/src/scope-sweeper-do.ts\nimport { DurableObject } from \"cloudflare:workers\";\nvar SWEEPER_ID = /^[0-9A-HJKMNP-TV-Z]{26}$/;\nfunction parseId(value, what) {\n if (typeof value !== \"string\" || !SWEEPER_ID.test(value)) {\n throw new TypeError(`${what} must be a ULID, got ${JSON.stringify(value)}`);\n }\n return value;\n}\nvar ROSTER_PREFIX = \"scope:\";\nvar JOB_START_PREFIX = \"job-start:\";\nfunction defineScopeSweeperDO(config) {\n return class ScopeSweeperDO extends DurableObject {\n /** The in-flight pass, when one is running — the overlap guard. */\n #pass = null;\n async noteScope(tenantId, scopeId) {\n const t = parseId(tenantId, \"tenantId\");\n const s = parseId(scopeId, \"scopeId\");\n await this.ctx.storage.put(`${ROSTER_PREFIX}${s}`, t);\n await this.ensureArmed();\n return { scopes: await this.#rosterSize() };\n }\n async forgetScope(scopeId) {\n const s = parseId(scopeId, \"scopeId\");\n await this.ctx.storage.delete([`${ROSTER_PREFIX}${s}`, `${JOB_START_PREFIX}${s}`]);\n return { scopes: await this.#rosterSize() };\n }\n /**\n * Arm the loop if it is not armed. Idempotent: an already-set alarm is left\n * exactly where it is, so this is safe to call on every request.\n */\n async ensureArmed() {\n const existing = await this.ctx.storage.getAlarm();\n if (existing !== null) return { armed: false, alarmAt: existing };\n const alarmAt = Date.now() + config.intervalMs;\n await this.ctx.storage.setAlarm(alarmAt);\n return { armed: true, alarmAt };\n }\n /**\n * Run a pass NOW (a manual kick, a just-provisioned scope's first tick, a\n * test). Joins the in-flight pass if one is running — never a second one —\n * and re-arms afterwards while scopes remain.\n */\n async sweepNow() {\n return this.#run();\n }\n /** The loop: one pass, then re-arm. Never throws (see the class doc). */\n async alarm() {\n await this.#run();\n }\n async #rosterSize() {\n return (await this.ctx.storage.list({ prefix: ROSTER_PREFIX })).size;\n }\n async #run() {\n if (this.#pass) return this.#pass;\n this.#pass = (async () => {\n try {\n const report = await this.#sweep();\n config.onPass?.(report, this.env);\n return report;\n } catch (err) {\n const outcome = { error: err instanceof Error ? err.message : String(err) };\n config.onPass?.(outcome, this.env);\n return outcome;\n }\n })();\n try {\n return await this.#pass;\n } finally {\n this.#pass = null;\n if (await this.#rosterSize() > 0) {\n await this.ctx.storage.setAlarm(Date.now() + config.intervalMs);\n }\n }\n }\n /** One pass over the roster: drain + due schedules per scope, errors contained. */\n async #sweep() {\n const host = config.host(this.env);\n const roster = await this.ctx.storage.list({ prefix: ROSTER_PREFIX });\n const report = {\n scopes: roster.size,\n drainTotals: { attempted: 0, delivered: 0, retrying: 0, deadLettered: 0 },\n schedules: { scopes: 0, fired: 0, skipped: 0, failed: 0 },\n ...config.runJobs ? { jobs: { attempted: 0, advanced: 0, completed: 0, retrying: 0, failed: 0 } } : {},\n errors: []\n };\n const registrations = host.registeredSchedules().filter((r) => r.schedules.length > 0);\n const entries = [...roster].map(([key, tenant]) => ({\n scopeId: key.slice(ROSTER_PREFIX.length),\n tenantId: tenant\n }));\n const concurrency = config.concurrency ?? 8;\n let next = 0;\n const worker = async () => {\n while (next < entries.length) {\n const { tenantId, scopeId } = entries[next++];\n if (host.lifecycleHeld) {\n try {\n if (await host.lifecycleHeld(scopeId)) {\n report.held = (report.held ?? 0) + 1;\n continue;\n }\n } catch (err) {\n report.errors.push({ kind: \"lifecycle\", id: scopeId, error: message(err) });\n continue;\n }\n }\n if (config.drainRetries !== false) {\n try {\n const r = await host.drainDue(tenantId, scopeId);\n report.drainTotals.attempted += r.attempted;\n report.drainTotals.delivered += r.delivered;\n report.drainTotals.retrying += r.retrying;\n report.drainTotals.deadLettered += r.deadLettered;\n } catch (err) {\n report.errors.push({ kind: \"drain\", id: scopeId, error: message(err) });\n }\n }\n if (config.runJobs) {\n if (config.startJobs) {\n try {\n const key = `${JOB_START_PREFIX}${scopeId}`;\n const last = await this.ctx.storage.get(key);\n const now = Date.now();\n if (last === void 0 || now - last >= (config.jobStartIntervalMs ?? config.intervalMs)) {\n await config.startJobs(host, tenantId, scopeId);\n await this.ctx.storage.put(key, now);\n }\n } catch (err) {\n report.errors.push({ kind: \"job\", id: `${scopeId}:start`, error: message(err) });\n }\n }\n try {\n const r = await host.runDueJobs(tenantId, scopeId);\n const totals = report.jobs;\n totals.attempted += r.attempted;\n totals.advanced += r.advanced;\n totals.completed += r.completed;\n totals.retrying += r.retrying;\n totals.failed += r.failed;\n for (const error of r.errors) {\n report.errors.push({ kind: \"job\", id: `${scopeId}:${error.runId}`, error: error.error });\n }\n } catch (err) {\n report.errors.push({ kind: \"job\", id: scopeId, error: message(err) });\n }\n }\n let touched = false;\n const passAt = (/* @__PURE__ */ new Date()).toISOString();\n const passRuns = [];\n for (const reg of registrations) {\n try {\n const r = await host.runDueSchedules(reg.moduleId, tenantId, scopeId);\n if (r.fired > 0 || r.failed > 0) touched = true;\n report.schedules.fired += r.fired;\n report.schedules.skipped += r.skipped;\n report.schedules.failed += r.failed;\n if (r.platformRequests) {\n report.schedules.platformRequests = (report.schedules.platformRequests ?? 0) + r.platformRequests;\n }\n for (const e of r.errors) {\n report.errors.push({\n kind: \"schedule\",\n id: `${scopeId}:${e.operation}`,\n error: e.error\n });\n }\n for (const run of r.runs ?? []) {\n passRuns.push({\n kind: \"schedule\",\n operation: run.operation,\n outcome: run.outcome,\n at: passAt,\n ...run.outcome === \"failed\" ? { error: r.errors.find((e) => e.operation === run.operation)?.error ?? null } : {}\n });\n }\n } catch (err) {\n report.errors.push({\n kind: \"schedule\",\n id: `${scopeId}:${reg.moduleId}`,\n error: message(err)\n });\n }\n }\n if (touched) report.schedules.scopes += 1;\n if (host.registeredFreshness && host.checkFreshness) {\n const freshRegs = host.registeredFreshness().filter((r) => r.freshness.length > 0);\n if (freshRegs.length > 0) {\n try {\n const r = await host.checkFreshness(freshRegs[0].moduleId, tenantId, scopeId);\n for (const check of r.checks) {\n passRuns.push({\n kind: \"freshness\",\n eventType: check.eventType,\n outcome: check.outcome,\n at: passAt,\n observedAt: check.observedAt\n });\n }\n } catch (err) {\n report.errors.push({ kind: \"freshness\", id: scopeId, error: message(err) });\n }\n }\n }\n if (passRuns.length > 0 && host.enqueueSweepRuns) {\n try {\n await host.enqueueSweepRuns(scopeId, {\n version: config.versionId?.(this.env) ?? null,\n // The payload caps its batch; a pathological schedule count truncates\n // rather than refusing the whole report.\n entries: passRuns.slice(0, 64)\n });\n } catch {\n }\n }\n }\n };\n await Promise.all(\n Array.from({ length: Math.max(1, Math.min(concurrency, entries.length)) }, worker)\n );\n return report;\n }\n };\n}\nvar message = (err) => err instanceof Error ? err.message : String(err);\n\n// packages/vertical-host/src/scope-sweep-host.ts\nvar SCOPE_SWEEP_HOST_KEY = \"substrat.scope-sweep-host\";\nfunction slot() {\n return globalThis;\n}\nfunction registeredScopeSweepHost() {\n return slot()[Symbol.for(SCOPE_SWEEP_HOST_KEY)];\n}\n\n// substrat-platform-sweeper.ts\nvar SweeperDO = defineScopeSweeperDO({\n intervalMs: 12e4,\n versionId: (env) => env.SUBSTRAT_VERSION_ID ?? null,\n host(env) {\n const hostFor = registeredScopeSweepHost();\n if (!hostFor) {\n throw new Error(\"this bundle registered no scope host for the platform sweeper: mount mountPlatformSurface from a current @substrat-run/vertical-host\");\n }\n return hostFor(env);\n },\n onPass(outcome) {\n if (\"error\" in outcome || outcome.errors.length > 0) {\n console.error(JSON.stringify({ substrat: \"scope-sweep\", ...outcome }));\n }\n }\n});\nexport {\n SweeperDO\n};\n";
|
|
27
|
+
/** The sweeper itself — 10803 bytes of ESM. */
|
|
28
|
+
export const PLATFORM_SWEEPER_SOURCE = "// packages/adapter-cloudflare/src/scope-sweeper-do.ts\nimport { DurableObject } from \"cloudflare:workers\";\n\n// packages/contracts/dist/wire-headers.js\nvar PLATFORM_SECRET_HEADER = \"x-substrat-platform\";\n\n// packages/adapter-cloudflare/src/scope-sweeper-do.ts\nvar SWEEPER_ID = /^[0-9A-HJKMNP-TV-Z]{26}$/;\nfunction parseId(value, what) {\n if (typeof value !== \"string\" || !SWEEPER_ID.test(value)) {\n throw new TypeError(`${what} must be a ULID, got ${JSON.stringify(value)}`);\n }\n return value;\n}\nvar ROSTER_PREFIX = \"scope:\";\nvar JOB_START_PREFIX = \"job-start:\";\nfunction defineScopeSweeperDO(config) {\n return class ScopeSweeperDO extends DurableObject {\n /** The in-flight pass, when one is running — the overlap guard. */\n #pass = null;\n async noteScope(tenantId, scopeId) {\n const t = parseId(tenantId, \"tenantId\");\n const s = parseId(scopeId, \"scopeId\");\n await this.ctx.storage.put(`${ROSTER_PREFIX}${s}`, t);\n await this.ensureArmed();\n return { scopes: await this.#rosterSize() };\n }\n async forgetScope(scopeId) {\n const s = parseId(scopeId, \"scopeId\");\n await this.ctx.storage.delete([`${ROSTER_PREFIX}${s}`, `${JOB_START_PREFIX}${s}`]);\n return { scopes: await this.#rosterSize() };\n }\n /**\n * Arm the loop if it is not armed. Idempotent: an already-set alarm is left\n * exactly where it is, so this is safe to call on every request.\n */\n async ensureArmed() {\n const existing = await this.ctx.storage.getAlarm();\n if (existing !== null) return { armed: false, alarmAt: existing };\n const alarmAt = Date.now() + config.intervalMs;\n await this.ctx.storage.setAlarm(alarmAt);\n return { armed: true, alarmAt };\n }\n /**\n * Run a pass NOW (a manual kick, a just-provisioned scope's first tick, a\n * test). Joins the in-flight pass if one is running — never a second one —\n * and re-arms afterwards while scopes remain.\n */\n async sweepNow() {\n return this.#run();\n }\n /** The loop: one pass, then re-arm. Never throws (see the class doc). */\n async alarm() {\n await this.#run();\n }\n async #rosterSize() {\n return (await this.ctx.storage.list({ prefix: ROSTER_PREFIX })).size;\n }\n async #run() {\n if (this.#pass) return this.#pass;\n this.#pass = (async () => {\n try {\n const report = await this.#sweep();\n config.onPass?.(report, this.env);\n return report;\n } catch (err) {\n const outcome = { error: err instanceof Error ? err.message : String(err) };\n config.onPass?.(outcome, this.env);\n return outcome;\n }\n })();\n try {\n return await this.#pass;\n } finally {\n this.#pass = null;\n if (await this.#rosterSize() > 0) {\n await this.ctx.storage.setAlarm(Date.now() + config.intervalMs);\n }\n }\n }\n /** One pass over the roster: drain + due schedules per scope, errors contained. */\n async #sweep() {\n const host = config.host(this.env);\n const roster = await this.ctx.storage.list({ prefix: ROSTER_PREFIX });\n const report = {\n scopes: roster.size,\n drainTotals: { attempted: 0, delivered: 0, retrying: 0, deadLettered: 0 },\n schedules: { scopes: 0, fired: 0, skipped: 0, failed: 0 },\n ...config.runJobs ? { jobs: { attempted: 0, advanced: 0, completed: 0, retrying: 0, failed: 0 } } : {},\n errors: []\n };\n const registrations = host.registeredSchedules().filter((r) => r.schedules.length > 0);\n const entries = [...roster].map(([key, tenant]) => ({\n scopeId: key.slice(ROSTER_PREFIX.length),\n tenantId: tenant\n }));\n const concurrency = config.concurrency ?? 8;\n let next = 0;\n const worker = async () => {\n while (next < entries.length) {\n const { tenantId, scopeId } = entries[next++];\n if (host.lifecycleHeld) {\n try {\n if (await host.lifecycleHeld(scopeId)) {\n report.held = (report.held ?? 0) + 1;\n continue;\n }\n } catch (err) {\n report.errors.push({ kind: \"lifecycle\", id: scopeId, error: message(err) });\n continue;\n }\n }\n if (config.drainRetries !== false) {\n try {\n const r = await host.drainDue(tenantId, scopeId);\n report.drainTotals.attempted += r.attempted;\n report.drainTotals.delivered += r.delivered;\n report.drainTotals.retrying += r.retrying;\n report.drainTotals.deadLettered += r.deadLettered;\n } catch (err) {\n report.errors.push({ kind: \"drain\", id: scopeId, error: message(err) });\n }\n }\n if (config.runJobs) {\n if (config.startJobs) {\n try {\n const key = `${JOB_START_PREFIX}${scopeId}`;\n const last = await this.ctx.storage.get(key);\n const now = Date.now();\n if (last === void 0 || now - last >= (config.jobStartIntervalMs ?? config.intervalMs)) {\n await config.startJobs(host, tenantId, scopeId);\n await this.ctx.storage.put(key, now);\n }\n } catch (err) {\n report.errors.push({ kind: \"job\", id: `${scopeId}:start`, error: message(err) });\n }\n }\n try {\n const r = await host.runDueJobs(tenantId, scopeId);\n const totals = report.jobs;\n totals.attempted += r.attempted;\n totals.advanced += r.advanced;\n totals.completed += r.completed;\n totals.retrying += r.retrying;\n totals.failed += r.failed;\n for (const error of r.errors) {\n report.errors.push({ kind: \"job\", id: `${scopeId}:${error.runId}`, error: error.error });\n }\n } catch (err) {\n report.errors.push({ kind: \"job\", id: scopeId, error: message(err) });\n }\n }\n let touched = false;\n let needsPlatformDrain = false;\n const passAt = (/* @__PURE__ */ new Date()).toISOString();\n const passRuns = [];\n for (const reg of registrations) {\n try {\n const r = await host.runDueSchedules(reg.moduleId, tenantId, scopeId);\n if (r.fired > 0 || r.failed > 0) touched = true;\n report.schedules.fired += r.fired;\n report.schedules.skipped += r.skipped;\n report.schedules.failed += r.failed;\n if (r.platformRequests) {\n report.schedules.platformRequests = (report.schedules.platformRequests ?? 0) + r.platformRequests;\n needsPlatformDrain = true;\n }\n for (const e of r.errors) {\n report.errors.push({\n kind: \"schedule\",\n id: `${scopeId}:${e.operation}`,\n error: e.error\n });\n }\n for (const run of r.runs ?? []) {\n passRuns.push({\n kind: \"schedule\",\n operation: run.operation,\n outcome: run.outcome,\n at: passAt,\n ...run.outcome === \"failed\" ? { error: r.errors.find((e) => e.operation === run.operation)?.error ?? null } : {}\n });\n }\n } catch (err) {\n report.errors.push({\n kind: \"schedule\",\n id: `${scopeId}:${reg.moduleId}`,\n error: message(err)\n });\n }\n }\n if (touched) report.schedules.scopes += 1;\n if (host.registeredFreshness && host.checkFreshness) {\n const freshRegs = host.registeredFreshness().filter((r) => r.freshness.length > 0);\n if (freshRegs.length > 0) {\n try {\n const r = await host.checkFreshness(freshRegs[0].moduleId, tenantId, scopeId);\n for (const check of r.checks) {\n passRuns.push({\n kind: \"freshness\",\n eventType: check.eventType,\n outcome: check.outcome,\n at: passAt,\n observedAt: check.observedAt\n });\n }\n } catch (err) {\n report.errors.push({ kind: \"freshness\", id: scopeId, error: message(err) });\n }\n }\n }\n if (passRuns.length > 0 && host.enqueueSweepRuns) {\n try {\n await host.enqueueSweepRuns(scopeId, {\n version: config.versionId?.(this.env) ?? null,\n // The payload caps its batch; a pathological schedule count truncates\n // rather than refusing the whole report.\n entries: passRuns.slice(0, 64)\n });\n } catch {\n }\n }\n if (needsPlatformDrain) {\n this.ctx.waitUntil(Promise.resolve().then(() => kickPlatformDrain(this.env, tenantId, scopeId)).catch(() => {\n }));\n }\n }\n };\n await Promise.all(\n Array.from({ length: Math.max(1, Math.min(concurrency, entries.length)) }, worker)\n );\n return report;\n }\n };\n}\nvar message = (err) => err instanceof Error ? err.message : String(err);\nasync function kickPlatformDrain(env, tenantId, scopeId) {\n const platform = env;\n if (!platform.CONTROL_PLANE_URL || !platform.PLATFORM_SECRET) return;\n await fetch(new URL(\"/internal/drain-scope\", platform.CONTROL_PLANE_URL), {\n method: \"POST\",\n headers: { \"content-type\": \"application/json\", [PLATFORM_SECRET_HEADER]: platform.PLATFORM_SECRET },\n body: JSON.stringify({ tenantId, scopeId, platformRequests: true, exports: false })\n });\n}\n\n// packages/vertical-host/src/scope-sweep-host.ts\nvar SCOPE_SWEEP_HOST_KEY = \"substrat.scope-sweep-host\";\nfunction slot() {\n return globalThis;\n}\nfunction registeredScopeSweepHost() {\n return slot()[Symbol.for(SCOPE_SWEEP_HOST_KEY)];\n}\n\n// substrat-platform-sweeper.ts\nvar SweeperDO = defineScopeSweeperDO({\n intervalMs: 12e4,\n versionId: (env) => env.SUBSTRAT_VERSION_ID ?? null,\n host(env) {\n const hostFor = registeredScopeSweepHost();\n if (!hostFor) {\n throw new Error(\"this bundle registered no scope host for the platform sweeper: mount mountPlatformSurface from a current @substrat-run/vertical-host\");\n }\n return hostFor(env);\n },\n onPass(outcome) {\n if (\"error\" in outcome || outcome.errors.length > 0) {\n console.error(JSON.stringify({ substrat: \"scope-sweep\", ...outcome }));\n }\n }\n});\nexport {\n SweeperDO\n};\n";
|
|
29
29
|
//# sourceMappingURL=platform-entry.generated.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-entry.generated.js","sourceRoot":"","sources":["../src/platform-entry.generated.ts"],"names":[],"mappings":"AAAA,8KAA8K;AAC9K,sEAAsE;AAEtE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,4BAA4B,CAAC;AAElE,gFAAgF;AAChF,MAAM,CAAC,MAAM,0BAA0B,GAAG,6BAA6B,CAAC;AAExE,6CAA6C;AAC7C,MAAM,CAAC,MAAM,qBAAqB,GAAW,81sBAA81sB,CAAC;AAE54sB;;;;;GAKG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,yDAAyD,CAAC;AACnG,MAAM,CAAC,MAAM,2BAA2B,GAAG,sCAAsC,CAAC;AAElF;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,8BAA8B,CAAC;AAEtE
|
|
1
|
+
{"version":3,"file":"platform-entry.generated.js","sourceRoot":"","sources":["../src/platform-entry.generated.ts"],"names":[],"mappings":"AAAA,8KAA8K;AAC9K,sEAAsE;AAEtE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,4BAA4B,CAAC;AAElE,gFAAgF;AAChF,MAAM,CAAC,MAAM,0BAA0B,GAAG,6BAA6B,CAAC;AAExE,6CAA6C;AAC7C,MAAM,CAAC,MAAM,qBAAqB,GAAW,81sBAA81sB,CAAC;AAE54sB;;;;;GAKG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,yDAAyD,CAAC;AACnG,MAAM,CAAC,MAAM,2BAA2B,GAAG,sCAAsC,CAAC;AAElF;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,8BAA8B,CAAC;AAEtE,+CAA+C;AAC/C,MAAM,CAAC,MAAM,uBAAuB,GAAW,83VAA83V,CAAC"}
|
|
@@ -40,6 +40,13 @@ export declare function isRouteMiss(err: ControlPlaneError): boolean;
|
|
|
40
40
|
* which means what `failed` always means: it may have stopped part-way.
|
|
41
41
|
*/
|
|
42
42
|
export declare const AUDITED_CALL_DEADLINE_MS = 60000;
|
|
43
|
+
/**
|
|
44
|
+
* How long one call of a paged copy may run (#2450): a page read, a page staged, a stage dropped.
|
|
45
|
+
* A page is at most `SCOPE_DUMP_PAGE_MAX_BYTES`, seconds of work, so a call past this has stalled.
|
|
46
|
+
* Answered 504, it ends the job step it held up as a transient fault: a cancel or forget, which
|
|
47
|
+
* waits for the step in flight, then waits this long at most past the step's own budget.
|
|
48
|
+
*/
|
|
49
|
+
export declare const PAGE_CALL_DEADLINE_MS = 60000;
|
|
43
50
|
export interface VerticalClientOptions {
|
|
44
51
|
/**
|
|
45
52
|
* How to reach the vertical. A Worker service binding's `fetch` when deployed —
|
|
@@ -1040,6 +1047,51 @@ export interface TransferredScope {
|
|
|
1040
1047
|
}
|
|
1041
1048
|
/** How many times a copy is restarted because the source took a write while it was read (#2450). */
|
|
1042
1049
|
export declare const TRANSFER_ATTEMPTS = 3;
|
|
1050
|
+
/**
|
|
1051
|
+
* A paged copy in flight (#2450): everything needed to resume it from another request or from a
|
|
1052
|
+
* background job, and nothing that is the scope's data. JSON, so a job can store it.
|
|
1053
|
+
*
|
|
1054
|
+
* `cursor` is the source's next page, `null` once every page is staged. `seq` is the last page the
|
|
1055
|
+
* destination staged under `stageId`. `revision` is the source's write revision as the first page
|
|
1056
|
+
* read it: the copy is one copy only while every later page reads the same.
|
|
1057
|
+
*/
|
|
1058
|
+
export interface TransferState {
|
|
1059
|
+
from: ScopeId;
|
|
1060
|
+
into: ScopeId;
|
|
1061
|
+
stamp: boolean;
|
|
1062
|
+
stageId: string;
|
|
1063
|
+
seq: number;
|
|
1064
|
+
cursor: string | null;
|
|
1065
|
+
revision: string | null;
|
|
1066
|
+
loadStamp: string | null;
|
|
1067
|
+
attempt: number;
|
|
1068
|
+
pages: number;
|
|
1069
|
+
rows: number;
|
|
1070
|
+
/** The `_substrat_meta` rows read so far, for `dumpMetaValue` once the copy is done. */
|
|
1071
|
+
meta: ScopeDumpTable[];
|
|
1072
|
+
}
|
|
1073
|
+
/** A copy finished (`done`), or one still to move (`state`). */
|
|
1074
|
+
export type TransferProgress = {
|
|
1075
|
+
done: TransferredScope;
|
|
1076
|
+
} | {
|
|
1077
|
+
state: TransferState;
|
|
1078
|
+
};
|
|
1079
|
+
/** The two ends a copy reads and writes, as `transferScope` and the job use them. */
|
|
1080
|
+
export type TransferEnds = {
|
|
1081
|
+
source: Pick<VerticalClient, 'exportScope' | 'exportScopeStamped' | 'exportScopePage'>;
|
|
1082
|
+
dest: Pick<VerticalClient, 'stageScopePage' | 'discardStagedScope'>;
|
|
1083
|
+
};
|
|
1084
|
+
export interface TransferOptions {
|
|
1085
|
+
retry?: <T>(run: () => Promise<T>) => Promise<T>;
|
|
1086
|
+
attempts?: number;
|
|
1087
|
+
/** A carry's export: the source mints its load stamp (`exportScopeStamped`). A fork's is not. */
|
|
1088
|
+
stamp?: boolean;
|
|
1089
|
+
/**
|
|
1090
|
+
* Stage even a scope that fits one page (#2450). A copy that a job finishes in another isolate
|
|
1091
|
+
* must leave its data at the destination, never in this one's memory.
|
|
1092
|
+
*/
|
|
1093
|
+
alwaysStage?: boolean;
|
|
1094
|
+
}
|
|
1043
1095
|
/**
|
|
1044
1096
|
* Move a scope's data out of `source` and into `dest`'s stage, a page at a time (#2450), so no
|
|
1045
1097
|
* single call carries the whole scope: a Durable Object RPC message holds 32 MiB, and an isolate
|
|
@@ -1054,16 +1106,37 @@ export declare const TRANSFER_ATTEMPTS = 3;
|
|
|
1054
1106
|
* consistent read only while the source's write revision stays where the first page read it. When
|
|
1055
1107
|
* it moves the copy starts again, up to `TRANSFER_ATTEMPTS` times, and is then refused (409) with
|
|
1056
1108
|
* nothing moved: a carry's later fences assume a copy that was true at one moment.
|
|
1109
|
+
*
|
|
1110
|
+
* `beginTransfer` and `transferStep` are the same copy in resumable steps, for one that outlasts a
|
|
1111
|
+
* request; this runs them to the end.
|
|
1057
1112
|
*/
|
|
1058
|
-
export declare function transferScope(source:
|
|
1113
|
+
export declare function transferScope(source: TransferEnds['source'], dest: TransferEnds['dest'],
|
|
1059
1114
|
/** The scope read at `source`, and (a fork, #2450) the scope `dest` stages into, when another. */
|
|
1060
1115
|
scope: {
|
|
1061
1116
|
from: ScopeId;
|
|
1062
1117
|
to?: ScopeId;
|
|
1063
|
-
}, opts?:
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1118
|
+
}, opts?: TransferOptions): Promise<TransferredScope>;
|
|
1119
|
+
/**
|
|
1120
|
+
* Start a copy (#2450): read the source's first page and stage it. Finished at once when the scope
|
|
1121
|
+
* fits that page (unless `alwaysStage`), when the source predates the paged verbs, or when the
|
|
1122
|
+
* destination does (its pages are then merged here, as the whole dump it takes).
|
|
1123
|
+
*/
|
|
1124
|
+
export declare function beginTransfer({ source, dest }: TransferEnds, scope: {
|
|
1125
|
+
from: ScopeId;
|
|
1126
|
+
to?: ScopeId;
|
|
1127
|
+
}, opts?: TransferOptions & {
|
|
1128
|
+
attempt?: number;
|
|
1129
|
+
}): Promise<TransferProgress>;
|
|
1130
|
+
/**
|
|
1131
|
+
* Move the next pages of a copy (#2450), until it is staged whole or `until` says to stop (a job's
|
|
1132
|
+
* time budget); always at least one page. A source written since the first page starts the copy
|
|
1133
|
+
* again under a new stage, the old one discarded.
|
|
1134
|
+
*
|
|
1135
|
+
* `stopped` (a job being cancelled or forgotten): the copy starts nothing new. A torn copy then
|
|
1136
|
+
* discards its stage and answers where it was, opening no other: whoever stopped it settles it.
|
|
1137
|
+
*/
|
|
1138
|
+
export declare function transferStep({ source, dest }: TransferEnds, state: TransferState, opts?: TransferOptions & {
|
|
1139
|
+
until?: () => boolean;
|
|
1140
|
+
stopped?: () => boolean;
|
|
1141
|
+
}): Promise<TransferProgress>;
|
|
1069
1142
|
//# sourceMappingURL=vertical-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vertical-client.d.ts","sourceRoot":"","sources":["../src/vertical-client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,YAAY,EAEZ,SAAS,EACT,gBAAgB,EAChB,QAAQ,EACR,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,qBAAqB,EACrB,eAAe,EACf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cG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,IAAI,CAAC,cAAc,EAAE,aAAa,GAAG,oBAAoB,GAAG,iBAAiB,CAAC,EACtF,IAAI,EAAE,IAAI,CAAC,cAAc,EAAE,gBAAgB,GAAG,oBAAoB,CAAC;AACnE,kGAAkG;AAClG,KAAK,EAAE;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,EAAE,CAAC,EAAE,OAAO,CAAA;CAAE,EACtC,IAAI,GAAE;IACJ,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iGAAiG;IACjG,KAAK,CAAC,EAAE,OAAO,CAAC;CACZ,GACL,OAAO,CAAC,gBAAgB,CAAC,CA6E3B"}
|
|
1
|
+
{"version":3,"file":"vertical-client.d.ts","sourceRoot":"","sources":["../src/vertical-client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,YAAY,EAEZ,SAAS,EACT,gBAAgB,EAChB,QAAQ,EACR,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,qBAAqB,EACrB,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,EACrB,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,WAAW,EACX,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EACh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M,EAAE,IAAI,EAAE,EAAE,YAAY,EAC9B,KAAK,EAAE;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,EAAE,CAAC,EAAE,OAAO,CAAA;CAAE,EACtC,IAAI,GAAE,eAAe,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAO,GAChD,OAAO,CAAC,gBAAgB,CAAC,CA0C3B;AAED;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAChC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,YAAY,EAC9B,KAAK,EAAE,aAAa,EACpB,IAAI,GAAE,eAAe,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,OAAO,CAAA;CAAO,GAC9E,OAAO,CAAC,gBAAgB,CAAC,CAwB3B"}
|
package/dist/vertical-client.js
CHANGED
|
@@ -91,6 +91,13 @@ function denialParams(scopeId, filter) {
|
|
|
91
91
|
* which means what `failed` always means: it may have stopped part-way.
|
|
92
92
|
*/
|
|
93
93
|
export const AUDITED_CALL_DEADLINE_MS = 60_000;
|
|
94
|
+
/**
|
|
95
|
+
* How long one call of a paged copy may run (#2450): a page read, a page staged, a stage dropped.
|
|
96
|
+
* A page is at most `SCOPE_DUMP_PAGE_MAX_BYTES`, seconds of work, so a call past this has stalled.
|
|
97
|
+
* Answered 504, it ends the job step it held up as a transient fault: a cancel or forget, which
|
|
98
|
+
* waits for the step in flight, then waits this long at most past the step's own budget.
|
|
99
|
+
*/
|
|
100
|
+
export const PAGE_CALL_DEADLINE_MS = 60_000;
|
|
94
101
|
/**
|
|
95
102
|
* Run the WHOLE exchange `run` under one deadline (#2064): the request, its status, and the
|
|
96
103
|
* body, whether that body is the answer or a refusal. A vertical that answers its headers in
|
|
@@ -824,9 +831,10 @@ export class VerticalClient {
|
|
|
824
831
|
const base = this.options.baseUrl ?? 'https://vertical.invalid';
|
|
825
832
|
const query = `scopeId=${encodeURIComponent(scopeId)}${opts.stamp ? '&stamp=1' : ''}` +
|
|
826
833
|
(cursor === null ? '' : `&cursor=${encodeURIComponent(cursor)}`);
|
|
827
|
-
const answer = await this.routeAnswer('export-page', FENCED, () => this.options.fetch(`${base}/internal/export-page?${query}`, {
|
|
834
|
+
const answer = await withDeadline('export-page', PAGE_CALL_DEADLINE_MS, (signal) => this.routeAnswer('export-page', FENCED, () => this.options.fetch(`${base}/internal/export-page?${query}`, {
|
|
828
835
|
headers: { [PLATFORM_SECRET_HEADER]: this.options.platformSecret },
|
|
829
|
-
|
|
836
|
+
signal,
|
|
837
|
+
})));
|
|
830
838
|
if (answer === PREDATES)
|
|
831
839
|
return 'predates';
|
|
832
840
|
const page = scopeDumpPage.safeParse(answer);
|
|
@@ -840,22 +848,23 @@ export class VerticalClient {
|
|
|
840
848
|
* `staged: false`, so a retry is harmless.
|
|
841
849
|
*/
|
|
842
850
|
async stageScopePage(scopeId, stageId, seq, tables) {
|
|
843
|
-
const answer = await this.routeAnswer('stage', FENCED, () => this.postRaw('/internal/stage', { scopeId, stageId, seq, tables }));
|
|
851
|
+
const answer = await withDeadline('stage', PAGE_CALL_DEADLINE_MS, (signal) => this.routeAnswer('stage', FENCED, () => this.postRaw('/internal/stage', { scopeId, stageId, seq, tables }, signal)));
|
|
844
852
|
if (answer === PREDATES)
|
|
845
853
|
return 'predates';
|
|
846
854
|
return { staged: answer?.staged === true };
|
|
847
855
|
}
|
|
848
856
|
/** Drop a stage a carry gave up on (#2450). Best effort: the next stage replaces it anyway. */
|
|
849
857
|
async discardStagedScope(scopeId, stageId) {
|
|
850
|
-
await this.routeAnswer('stage-discard', FENCED, () => this.postRaw('/internal/stage/discard', { scopeId, stageId }));
|
|
858
|
+
await withDeadline('stage-discard', PAGE_CALL_DEADLINE_MS, (signal) => this.routeAnswer('stage-discard', FENCED, () => this.postRaw('/internal/stage/discard', { scopeId, stageId }, signal)));
|
|
851
859
|
}
|
|
852
860
|
/** A platform-authenticated JSON POST, its response unread, for `routeAnswer`. */
|
|
853
|
-
postRaw(path, body) {
|
|
861
|
+
postRaw(path, body, signal) {
|
|
854
862
|
const base = this.options.baseUrl ?? 'https://vertical.invalid';
|
|
855
863
|
return this.options.fetch(`${base}${path}`, {
|
|
856
864
|
method: 'POST',
|
|
857
865
|
headers: { 'content-type': 'application/json', [PLATFORM_SECRET_HEADER]: this.options.platformSecret },
|
|
858
866
|
body: JSON.stringify(body),
|
|
867
|
+
...(signal ? { signal } : {}),
|
|
859
868
|
});
|
|
860
869
|
}
|
|
861
870
|
/**
|
|
@@ -1408,84 +1417,123 @@ export const TRANSFER_ATTEMPTS = 3;
|
|
|
1408
1417
|
* consistent read only while the source's write revision stays where the first page read it. When
|
|
1409
1418
|
* it moves the copy starts again, up to `TRANSFER_ATTEMPTS` times, and is then refused (409) with
|
|
1410
1419
|
* nothing moved: a carry's later fences assume a copy that was true at one moment.
|
|
1420
|
+
*
|
|
1421
|
+
* `beginTransfer` and `transferStep` are the same copy in resumable steps, for one that outlasts a
|
|
1422
|
+
* request; this runs them to the end.
|
|
1411
1423
|
*/
|
|
1412
1424
|
export async function transferScope(source, dest,
|
|
1413
1425
|
/** The scope read at `source`, and (a fork, #2450) the scope `dest` stages into, when another. */
|
|
1414
1426
|
scope, opts = {}) {
|
|
1427
|
+
let progress = await beginTransfer({ source, dest }, scope, opts);
|
|
1428
|
+
while ('state' in progress)
|
|
1429
|
+
progress = await transferStep({ source, dest }, progress.state, opts);
|
|
1430
|
+
return progress.done;
|
|
1431
|
+
}
|
|
1432
|
+
/**
|
|
1433
|
+
* Start a copy (#2450): read the source's first page and stage it. Finished at once when the scope
|
|
1434
|
+
* fits that page (unless `alwaysStage`), when the source predates the paged verbs, or when the
|
|
1435
|
+
* destination does (its pages are then merged here, as the whole dump it takes).
|
|
1436
|
+
*/
|
|
1437
|
+
export async function beginTransfer({ source, dest }, scope, opts = {}) {
|
|
1415
1438
|
const retry = opts.retry ?? ((run) => run());
|
|
1416
|
-
const attempts = opts.attempts ?? TRANSFER_ATTEMPTS;
|
|
1417
1439
|
const stamp = opts.stamp ?? true;
|
|
1418
|
-
const
|
|
1440
|
+
const from = scope.from;
|
|
1419
1441
|
const into = scope.to ?? scope.from;
|
|
1420
1442
|
// A client without the paged verbs (one a caller assembled from part of this one) is read as a
|
|
1421
1443
|
// deployment that predates them.
|
|
1422
|
-
const
|
|
1423
|
-
? retry(() => source.exportScopePage(
|
|
1424
|
-
:
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
for (let attempt = 1;; attempt++) {
|
|
1430
|
-
const first = await pageAt(null);
|
|
1431
|
-
if (first === 'predates') {
|
|
1432
|
-
if (!stamp) {
|
|
1433
|
-
const tables = await retry(() => source.exportScope(scopeId));
|
|
1434
|
-
return { dump: tables, loadStamp: null, revision: null, meta: metaOf([tables]) };
|
|
1435
|
-
}
|
|
1436
|
-
const whole = await retry(() => source.exportScopeStamped(scopeId));
|
|
1437
|
-
return { dump: whole.tables, loadStamp: whole.loadStamp, revision: whole.revision, meta: metaOf([whole.tables]) };
|
|
1438
|
-
}
|
|
1439
|
-
if (first.next === null) {
|
|
1440
|
-
return { dump: first.tables, loadStamp: first.loadStamp, revision: first.revision, meta: metaOf([first.tables]) };
|
|
1441
|
-
}
|
|
1442
|
-
stageId = ulid();
|
|
1443
|
-
const opened = await stagePage(0, first.tables);
|
|
1444
|
-
// A destination that cannot stage takes the dump whole, so the pages are held here instead.
|
|
1445
|
-
const held = opened === 'predates' ? [first.tables] : null;
|
|
1446
|
-
const meta = [first.tables];
|
|
1447
|
-
let cursor = first.next;
|
|
1448
|
-
let seq = 0;
|
|
1449
|
-
let torn = false;
|
|
1450
|
-
while (cursor !== null) {
|
|
1451
|
-
const at = cursor;
|
|
1452
|
-
const page = await pageAt(at);
|
|
1453
|
-
if (page === 'predates') {
|
|
1454
|
-
throw new ControlPlaneError(502, `the source of scope ${scopeId} stopped answering dump pages part way; nothing was moved`);
|
|
1455
|
-
}
|
|
1456
|
-
if (page.revision !== first.revision) {
|
|
1457
|
-
torn = true;
|
|
1458
|
-
break;
|
|
1459
|
-
}
|
|
1460
|
-
meta.push(page.tables);
|
|
1461
|
-
if (held) {
|
|
1462
|
-
held.push(page.tables);
|
|
1463
|
-
}
|
|
1464
|
-
else {
|
|
1465
|
-
const staged = await stagePage(++seq, page.tables);
|
|
1466
|
-
if (staged === 'predates') {
|
|
1467
|
-
throw new ControlPlaneError(502, `the destination of scope ${scopeId} stopped staging part way; nothing was moved`);
|
|
1468
|
-
}
|
|
1469
|
-
}
|
|
1470
|
-
cursor = page.next;
|
|
1471
|
-
}
|
|
1472
|
-
if (!torn) {
|
|
1473
|
-
return {
|
|
1474
|
-
dump: held ? mergeDumpPages(held) : { stageId },
|
|
1475
|
-
loadStamp: first.loadStamp,
|
|
1476
|
-
revision: first.revision,
|
|
1477
|
-
meta: metaOf(meta),
|
|
1478
|
-
};
|
|
1444
|
+
const first = typeof source.exportScopePage === 'function'
|
|
1445
|
+
? await retry(() => source.exportScopePage(from, null, { stamp }))
|
|
1446
|
+
: 'predates';
|
|
1447
|
+
if (first === 'predates') {
|
|
1448
|
+
if (!stamp) {
|
|
1449
|
+
const tables = await retry(() => source.exportScope(from));
|
|
1450
|
+
return { done: { dump: tables, loadStamp: null, revision: null, meta: metaOf([tables]) } };
|
|
1479
1451
|
}
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1452
|
+
const whole = await retry(() => source.exportScopeStamped(from));
|
|
1453
|
+
return { done: { dump: whole.tables, loadStamp: whole.loadStamp, revision: whole.revision, meta: metaOf([whole.tables]) } };
|
|
1454
|
+
}
|
|
1455
|
+
if (first.next === null && !opts.alwaysStage) {
|
|
1456
|
+
return { done: { dump: first.tables, loadStamp: first.loadStamp, revision: first.revision, meta: metaOf([first.tables]) } };
|
|
1457
|
+
}
|
|
1458
|
+
const stageId = ulid();
|
|
1459
|
+
const opened = typeof dest.stageScopePage === 'function'
|
|
1460
|
+
? await retry(() => dest.stageScopePage(into, stageId, 0, first.tables))
|
|
1461
|
+
: 'predates';
|
|
1462
|
+
const state = {
|
|
1463
|
+
from, into, stamp, stageId, seq: 0, cursor: first.next,
|
|
1464
|
+
revision: first.revision, loadStamp: first.loadStamp,
|
|
1465
|
+
attempt: opts.attempt ?? 1, pages: 1, rows: rowsIn(first.tables), meta: metaOf([first.tables]),
|
|
1466
|
+
};
|
|
1467
|
+
if (opened !== 'predates')
|
|
1468
|
+
return state.cursor === null ? { done: doneOf(state) } : { state };
|
|
1469
|
+
// A destination that cannot stage takes the dump whole, so the pages are held here instead.
|
|
1470
|
+
const held = [first.tables];
|
|
1471
|
+
for (let cursor = first.next; cursor !== null;) {
|
|
1472
|
+
const at = cursor;
|
|
1473
|
+
const page = await retry(() => source.exportScopePage(from, at, { stamp }));
|
|
1474
|
+
if (page === 'predates')
|
|
1475
|
+
throw stoppedPaging(from);
|
|
1476
|
+
if (page.revision !== first.revision)
|
|
1477
|
+
return restart({ source, dest }, state, opts, false);
|
|
1478
|
+
held.push(page.tables);
|
|
1479
|
+
cursor = page.next;
|
|
1480
|
+
}
|
|
1481
|
+
return { done: { dump: mergeDumpPages(held), loadStamp: first.loadStamp, revision: first.revision, meta: metaOf(held) } };
|
|
1482
|
+
}
|
|
1483
|
+
/**
|
|
1484
|
+
* Move the next pages of a copy (#2450), until it is staged whole or `until` says to stop (a job's
|
|
1485
|
+
* time budget); always at least one page. A source written since the first page starts the copy
|
|
1486
|
+
* again under a new stage, the old one discarded.
|
|
1487
|
+
*
|
|
1488
|
+
* `stopped` (a job being cancelled or forgotten): the copy starts nothing new. A torn copy then
|
|
1489
|
+
* discards its stage and answers where it was, opening no other: whoever stopped it settles it.
|
|
1490
|
+
*/
|
|
1491
|
+
export async function transferStep({ source, dest }, state, opts = {}) {
|
|
1492
|
+
const retry = opts.retry ?? ((run) => run());
|
|
1493
|
+
let next = state;
|
|
1494
|
+
while (next.cursor !== null) {
|
|
1495
|
+
const at = next.cursor;
|
|
1496
|
+
const page = await retry(() => source.exportScopePage(next.from, at, { stamp: next.stamp }));
|
|
1497
|
+
if (page === 'predates')
|
|
1498
|
+
throw stoppedPaging(next.from);
|
|
1499
|
+
if (page.revision !== next.revision)
|
|
1500
|
+
return restart({ source, dest }, next, opts, true);
|
|
1501
|
+
const seq = next.seq + 1;
|
|
1502
|
+
const staged = await retry(() => dest.stageScopePage(next.into, next.stageId, seq, page.tables));
|
|
1503
|
+
if (staged === 'predates') {
|
|
1504
|
+
throw new ControlPlaneError(502, `the destination of scope ${next.into} stopped staging part way; nothing was moved`);
|
|
1486
1505
|
}
|
|
1506
|
+
next = {
|
|
1507
|
+
...next,
|
|
1508
|
+
seq,
|
|
1509
|
+
cursor: page.next,
|
|
1510
|
+
pages: next.pages + 1,
|
|
1511
|
+
rows: next.rows + rowsIn(page.tables),
|
|
1512
|
+
meta: mergeDumpPages([next.meta, metaOf([page.tables])]),
|
|
1513
|
+
};
|
|
1514
|
+
if (next.cursor !== null && opts.until?.())
|
|
1515
|
+
return { state: next };
|
|
1516
|
+
}
|
|
1517
|
+
return { done: doneOf(next) };
|
|
1518
|
+
}
|
|
1519
|
+
/** A torn copy: discard its stage and begin again, or refuse once the attempts are spent. */
|
|
1520
|
+
async function restart(ends, state, opts, staged) {
|
|
1521
|
+
// Best effort: a stage nothing commits is replaced by the next one, and goes with a wipe.
|
|
1522
|
+
if (staged)
|
|
1523
|
+
await ends.dest.discardStagedScope(state.into, state.stageId).catch(() => undefined);
|
|
1524
|
+
// Stopped: a new stage would outlast whoever stopped this copy, so none is opened.
|
|
1525
|
+
if (opts.stopped?.())
|
|
1526
|
+
return { state };
|
|
1527
|
+
const attempts = opts.attempts ?? TRANSFER_ATTEMPTS;
|
|
1528
|
+
if (state.attempt >= attempts) {
|
|
1529
|
+
throw new ControlPlaneError(409, `scope ${state.from} took writes while each of ${attempts} attempts was copying it, so no copy was true at ` +
|
|
1530
|
+
'one moment and nothing was moved (#2450). Retry when it is quieter.');
|
|
1487
1531
|
}
|
|
1532
|
+
return beginTransfer(ends, { from: state.from, to: state.into }, { ...opts, stamp: state.stamp, attempt: state.attempt + 1 });
|
|
1488
1533
|
}
|
|
1534
|
+
const doneOf = (state) => ({ dump: { stageId: state.stageId }, loadStamp: state.loadStamp, revision: state.revision, meta: state.meta });
|
|
1535
|
+
const rowsIn = (tables) => tables.reduce((n, t) => n + t.rows.length, 0);
|
|
1536
|
+
const stoppedPaging = (scopeId) => new ControlPlaneError(502, `the source of scope ${scopeId} stopped answering dump pages part way; nothing was moved`);
|
|
1489
1537
|
/** The `_substrat_meta` fragments of some dump pages, merged. */
|
|
1490
1538
|
const metaOf = (pages) => mergeDumpPages(pages.map((page) => page.filter((t) => t.name === '_substrat_meta')));
|
|
1491
1539
|
//# sourceMappingURL=vertical-client.js.map
|