@rocicorp/zero 1.11.0-canary.16 → 1.11.0-canary.18
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/out/replicache/src/replicache-impl.d.ts.map +1 -1
- package/out/replicache/src/replicache-impl.js +1 -1
- package/out/replicache/src/replicache-impl.js.map +1 -1
- package/out/zero/package.js +1 -1
- package/out/zero/package.js.map +1 -1
- package/out/zero-cache/src/config/normalize.d.ts.map +1 -1
- package/out/zero-cache/src/config/normalize.js +1 -1
- package/out/zero-cache/src/config/normalize.js.map +1 -1
- package/out/zero-cache/src/config/zero-config.d.ts +5 -0
- package/out/zero-cache/src/config/zero-config.d.ts.map +1 -1
- package/out/zero-cache/src/config/zero-config.js +13 -0
- package/out/zero-cache/src/config/zero-config.js.map +1 -1
- package/out/zero-cache/src/services/change-streamer/backup-cleanup-monitor-factory.d.ts.map +1 -1
- package/out/zero-cache/src/services/change-streamer/backup-cleanup-monitor-factory.js +2 -0
- package/out/zero-cache/src/services/change-streamer/backup-cleanup-monitor-factory.js.map +1 -1
- package/out/zero-cache/src/services/change-streamer/litestream-sync-requester.d.ts +51 -0
- package/out/zero-cache/src/services/change-streamer/litestream-sync-requester.d.ts.map +1 -0
- package/out/zero-cache/src/services/change-streamer/litestream-sync-requester.js +132 -0
- package/out/zero-cache/src/services/change-streamer/litestream-sync-requester.js.map +1 -0
- package/out/zero-cache/src/services/change-streamer/vfs-watermark-poller.d.ts +5 -0
- package/out/zero-cache/src/services/change-streamer/vfs-watermark-poller.d.ts.map +1 -1
- package/out/zero-cache/src/services/change-streamer/vfs-watermark-poller.js +34 -5
- package/out/zero-cache/src/services/change-streamer/vfs-watermark-poller.js.map +1 -1
- package/out/zero-cache/src/services/litestream/commands.d.ts +13 -0
- package/out/zero-cache/src/services/litestream/commands.d.ts.map +1 -1
- package/out/zero-cache/src/services/litestream/commands.js +17 -1
- package/out/zero-cache/src/services/litestream/commands.js.map +1 -1
- package/out/zero-cache/src/services/litestream/config-v5.yml +5 -2
- package/out/zero-cache/src/services/litestream/litestream-controller.d.ts +10 -2
- package/out/zero-cache/src/services/litestream/litestream-controller.d.ts.map +1 -1
- package/out/zero-cache/src/services/litestream/litestream-controller.js +3 -2
- package/out/zero-cache/src/services/litestream/litestream-controller.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/pipeline-driver.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/pipeline-driver.js +2 -2
- package/out/zero-cache/src/services/view-syncer/pipeline-driver.js.map +1 -1
- package/out/zero-client/src/client/active-clients-manager.d.ts.map +1 -1
- package/out/zero-client/src/client/active-clients-manager.js +4 -1
- package/out/zero-client/src/client/active-clients-manager.js.map +1 -1
- package/out/zero-client/src/client/version.js +1 -1
- package/out/zero-protocol/src/inspect-down.d.ts +81 -81
- package/package.json +1 -1
|
@@ -28,9 +28,17 @@ export type SyncOptions = {
|
|
|
28
28
|
* returning without waiting on the backup store. Use false on the write path
|
|
29
29
|
* where the goal is to keep the WAL small, not to durably back it up.
|
|
30
30
|
*/
|
|
31
|
-
wait?: boolean;
|
|
31
|
+
wait?: boolean | undefined;
|
|
32
32
|
/** Overall request timeout in milliseconds. Defaults to 30s. */
|
|
33
|
-
timeoutMs?: number;
|
|
33
|
+
timeoutMs?: number | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Server-side deadline in seconds, sent as litestream's `timeout`. When set,
|
|
36
|
+
* litestream ends the request itself (with an error response) once it
|
|
37
|
+
* elapses. Set it below {@link timeoutMs} so that litestream, rather than
|
|
38
|
+
* the client, ends a slow request. (litestream defaults to 30s when `wait`
|
|
39
|
+
* is set, and to no deadline otherwise.)
|
|
40
|
+
*/
|
|
41
|
+
serverTimeoutSeconds?: number | undefined;
|
|
34
42
|
};
|
|
35
43
|
/**
|
|
36
44
|
* IPC client for the litestream control server. litestream serves an HTTP API
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"litestream-controller.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/litestream/litestream-controller.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAEjD;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEhE;AAID,qEAAqE;AACrE,MAAM,MAAM,YAAY,GAAG;IACzB;;;;OAIG;IACH,MAAM,EAAE,QAAQ,GAAG,cAAc,GAAG,WAAW,CAAC;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"litestream-controller.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/litestream/litestream-controller.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAEjD;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEhE;AAID,qEAAqE;AACrE,MAAM,MAAM,YAAY,GAAG;IACzB;;;;OAIG;IACH,MAAM,EAAE,QAAQ,GAAG,cAAc,GAAG,WAAW,CAAC;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAE3B,gEAAgE;IAChE,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE/B;;;;;;OAMG;IACH,oBAAoB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3C,CAAC;AAEF;;;;;;;;;GASG;AACH,qBAAa,oBAAoB;;IAM/B;;;;;;OAMG;IACH,YACE,EAAE,EAAE,UAAU,EACd,WAAW,EAAE,MAAM,EACnB,UAAU,SAAoC,EAQ/C;IAED;;;;;;;;;;OAUG;IACG,IAAI,CACR,IAAI,GAAE,WAAgB,EACtB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,YAAY,CAAC,CAkBvB;IAED,iDAAiD;IACjD,KAAK,IAAI,IAAI,CAEZ;CA4DF"}
|
|
@@ -56,10 +56,11 @@ var LitestreamController = class {
|
|
|
56
56
|
* than blocking application progress on it.
|
|
57
57
|
*/
|
|
58
58
|
async sync(opts = {}, signal) {
|
|
59
|
-
const { wait = false, timeoutMs = DEFAULT_REQUEST_TIMEOUT_MS } = opts;
|
|
59
|
+
const { wait = false, timeoutMs = DEFAULT_REQUEST_TIMEOUT_MS, serverTimeoutSeconds } = opts;
|
|
60
60
|
const result = await this.#post("/sync", {
|
|
61
61
|
path: this.#replicaFile,
|
|
62
|
-
wait
|
|
62
|
+
wait,
|
|
63
|
+
...serverTimeoutSeconds ? { timeout: serverTimeoutSeconds } : {}
|
|
63
64
|
}, timeoutMs, signal);
|
|
64
65
|
this.#lc.debug?.("litestream sync", result);
|
|
65
66
|
return result;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"litestream-controller.js","names":["#lc","#replicaFile","#socketPath","#agent","#post"],"sources":["../../../../../../zero-cache/src/services/litestream/litestream-controller.ts"],"sourcesContent":["import type {IncomingMessage} from 'node:http';\nimport {Agent, request} from 'node:http';\nimport {json as readJSON} from 'node:stream/consumers';\nimport type {LogContext} from '@rocicorp/logger';\n\n/**\n * Path of the litestream control socket, derived from the replica file's\n * directory. The socket must live on a filesystem the (non-root) runtime user\n * can write — the replica directory is guaranteed writable since litestream\n * writes the replica there — so it must NOT default to a root-owned location\n * like /var/run. Kept in sync with config-v5.yml's `socket.path`, which is set\n * from `ZERO_LITESTREAM_SOCKET_PATH` (see getLitestream() in commands.ts).\n */\nexport function litestreamSocketPath(replicaFile: string): string {\n return `${replicaFile}.sock`;\n}\n\nconst DEFAULT_REQUEST_TIMEOUT_MS = 30_000;\n\n/** Response body from litestream's `POST /sync` control endpoint. */\nexport type SyncResponse = {\n /**\n * `synced` when `wait` was true and the upload completed, `synced_local`\n * when the WAL was sealed locally without waiting on the remote replica, or\n * `no_change` when there was nothing to sync.\n */\n status: 'synced' | 'synced_local' | 'no_change';\n path: string;\n txid: number;\n replicated_txid: number;\n};\n\nexport type SyncOptions = {\n /**\n * When true, block until the sealed WAL has been uploaded to the remote\n * replica (litestream's SyncAndWait). When false (the default), litestream\n * only seals the WAL into local LTX files and runs its checkpoint thresholds,\n * returning without waiting on the backup store. Use false on the write path\n * where the goal is to keep the WAL small, not to durably back it up.\n */\n wait?: boolean;\n\n /** Overall request timeout in milliseconds. Defaults to 30s. */\n timeoutMs?: number;\n};\n\n/**\n * IPC client for the litestream control server. litestream serves an HTTP API\n * over a Unix domain socket (enabled via the `socket:` block in config-v5.yml);\n * because zero-cache runs litestream as a subprocess in the same container, the\n * socket is reachable directly on the local filesystem.\n *\n * A single keep-alive connection is held open and reused across calls, so a\n * high-frequency caller (e.g. write-path backpressure) does not pay a\n * connect/handshake per request.\n */\nexport class LitestreamController {\n readonly #lc: LogContext;\n readonly #replicaFile: string;\n readonly #socketPath: string;\n readonly #agent: Agent;\n\n /**\n * @param replicaFile Path of the replica database litestream is managing —\n * the same value passed to litestream as `ZERO_REPLICA_FILE`. This is the\n * `path` litestream matches control requests against.\n * @param socketPath Path of the control socket; defaults to the path derived\n * from `replicaFile`, matching config-v5.yml's `socket.path`.\n */\n constructor(\n lc: LogContext,\n replicaFile: string,\n socketPath = litestreamSocketPath(replicaFile),\n ) {\n this.#lc = lc.withContext('component', 'litestream-controller');\n this.#replicaFile = replicaFile;\n this.#socketPath = socketPath;\n // keepAlive with a single socket keeps one warm connection to the control\n // socket that is reused across calls.\n this.#agent = new Agent({keepAlive: true, maxSockets: 1});\n }\n\n /**\n * Forces litestream to sync the WAL into LTX files immediately and run its\n * checkpoint thresholds, instead of waiting for the next monitor-interval\n * tick. The checkpoint itself is still litestream's usual (non-blocking)\n * PASSIVE attempt, so it is skipped if the database is busy — call this once\n * writes are quiesced.\n *\n * Best-effort: callers should tolerate rejection (e.g. ECONNREFUSED/ENOENT\n * while litestream is restarting or before it has created the socket) rather\n * than blocking application progress on it.\n */\n async sync(\n opts: SyncOptions = {},\n signal?: AbortSignal,\n ): Promise<SyncResponse> {\n const {wait = false
|
|
1
|
+
{"version":3,"file":"litestream-controller.js","names":["#lc","#replicaFile","#socketPath","#agent","#post"],"sources":["../../../../../../zero-cache/src/services/litestream/litestream-controller.ts"],"sourcesContent":["import type {IncomingMessage} from 'node:http';\nimport {Agent, request} from 'node:http';\nimport {json as readJSON} from 'node:stream/consumers';\nimport type {LogContext} from '@rocicorp/logger';\n\n/**\n * Path of the litestream control socket, derived from the replica file's\n * directory. The socket must live on a filesystem the (non-root) runtime user\n * can write — the replica directory is guaranteed writable since litestream\n * writes the replica there — so it must NOT default to a root-owned location\n * like /var/run. Kept in sync with config-v5.yml's `socket.path`, which is set\n * from `ZERO_LITESTREAM_SOCKET_PATH` (see getLitestream() in commands.ts).\n */\nexport function litestreamSocketPath(replicaFile: string): string {\n return `${replicaFile}.sock`;\n}\n\nconst DEFAULT_REQUEST_TIMEOUT_MS = 30_000;\n\n/** Response body from litestream's `POST /sync` control endpoint. */\nexport type SyncResponse = {\n /**\n * `synced` when `wait` was true and the upload completed, `synced_local`\n * when the WAL was sealed locally without waiting on the remote replica, or\n * `no_change` when there was nothing to sync.\n */\n status: 'synced' | 'synced_local' | 'no_change';\n path: string;\n txid: number;\n replicated_txid: number;\n};\n\nexport type SyncOptions = {\n /**\n * When true, block until the sealed WAL has been uploaded to the remote\n * replica (litestream's SyncAndWait). When false (the default), litestream\n * only seals the WAL into local LTX files and runs its checkpoint thresholds,\n * returning without waiting on the backup store. Use false on the write path\n * where the goal is to keep the WAL small, not to durably back it up.\n */\n wait?: boolean | undefined;\n\n /** Overall request timeout in milliseconds. Defaults to 30s. */\n timeoutMs?: number | undefined;\n\n /**\n * Server-side deadline in seconds, sent as litestream's `timeout`. When set,\n * litestream ends the request itself (with an error response) once it\n * elapses. Set it below {@link timeoutMs} so that litestream, rather than\n * the client, ends a slow request. (litestream defaults to 30s when `wait`\n * is set, and to no deadline otherwise.)\n */\n serverTimeoutSeconds?: number | undefined;\n};\n\n/**\n * IPC client for the litestream control server. litestream serves an HTTP API\n * over a Unix domain socket (enabled via the `socket:` block in config-v5.yml);\n * because zero-cache runs litestream as a subprocess in the same container, the\n * socket is reachable directly on the local filesystem.\n *\n * A single keep-alive connection is held open and reused across calls, so a\n * high-frequency caller (e.g. write-path backpressure) does not pay a\n * connect/handshake per request.\n */\nexport class LitestreamController {\n readonly #lc: LogContext;\n readonly #replicaFile: string;\n readonly #socketPath: string;\n readonly #agent: Agent;\n\n /**\n * @param replicaFile Path of the replica database litestream is managing —\n * the same value passed to litestream as `ZERO_REPLICA_FILE`. This is the\n * `path` litestream matches control requests against.\n * @param socketPath Path of the control socket; defaults to the path derived\n * from `replicaFile`, matching config-v5.yml's `socket.path`.\n */\n constructor(\n lc: LogContext,\n replicaFile: string,\n socketPath = litestreamSocketPath(replicaFile),\n ) {\n this.#lc = lc.withContext('component', 'litestream-controller');\n this.#replicaFile = replicaFile;\n this.#socketPath = socketPath;\n // keepAlive with a single socket keeps one warm connection to the control\n // socket that is reused across calls.\n this.#agent = new Agent({keepAlive: true, maxSockets: 1});\n }\n\n /**\n * Forces litestream to sync the WAL into LTX files immediately and run its\n * checkpoint thresholds, instead of waiting for the next monitor-interval\n * tick. The checkpoint itself is still litestream's usual (non-blocking)\n * PASSIVE attempt, so it is skipped if the database is busy — call this once\n * writes are quiesced.\n *\n * Best-effort: callers should tolerate rejection (e.g. ECONNREFUSED/ENOENT\n * while litestream is restarting or before it has created the socket) rather\n * than blocking application progress on it.\n */\n async sync(\n opts: SyncOptions = {},\n signal?: AbortSignal,\n ): Promise<SyncResponse> {\n const {\n wait = false,\n timeoutMs = DEFAULT_REQUEST_TIMEOUT_MS,\n serverTimeoutSeconds,\n } = opts;\n const result = await this.#post<SyncResponse>(\n '/sync',\n {\n path: this.#replicaFile,\n wait,\n ...(serverTimeoutSeconds ? {timeout: serverTimeoutSeconds} : {}),\n },\n timeoutMs,\n signal,\n );\n this.#lc.debug?.('litestream sync', result);\n return result;\n }\n\n /** Releases the pooled keep-alive connection. */\n close(): void {\n this.#agent.destroy();\n }\n\n // Note: Uses ye'old node:http for its unix socketPath support.\n // fetch() would have less boiler-plate, but it would require importing\n // the `unidici` package to provide a fetch Agent that supports sockets.\n #post<T>(\n path: string,\n body: unknown,\n timeoutMs: number,\n signal?: AbortSignal,\n ): Promise<T> {\n const payload = JSON.stringify(body);\n return new Promise<T>((resolve, reject) => {\n const req = request(\n {\n socketPath: this.#socketPath,\n method: 'POST',\n path,\n agent: this.#agent,\n timeout: timeoutMs,\n headers: {\n 'content-type': 'application/json',\n 'content-length': Buffer.byteLength(payload),\n },\n signal,\n },\n (res: IncomingMessage) => {\n const status = res.statusCode ?? 0;\n // litestream's success and error responses are both always JSON\n // (writeJSON / writeJSONError in server.go).\n readJSON(res).then(\n body => {\n if (status < 200 || status >= 300) {\n reject(\n new Error(\n `litestream ${path} failed: ${status} ${JSON.stringify(body)}`,\n ),\n );\n } else {\n resolve(body as T);\n }\n },\n (e: unknown) =>\n reject(\n new Error(`litestream ${path} returned invalid JSON`, {\n cause: e,\n }),\n ),\n );\n },\n );\n req.on('timeout', () =>\n req.destroy(\n new Error(`litestream ${path} timed out after ${timeoutMs}ms`),\n ),\n );\n req.on('error', reject);\n req.end(payload);\n });\n }\n}\n"],"mappings":";;;;;;;;;;;AAaA,SAAgB,qBAAqB,aAA6B;CAChE,OAAO,GAAG,YAAY;AACxB;AAEA,IAAM,6BAA6B;;;;;;;;;;;AAgDnC,IAAa,uBAAb,MAAkC;CAChC;CACA;CACA;CACA;;;;;;;;CASA,YACE,I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AAK,EACZ,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,EACpC,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,GACtC,QAAQ,CAAC,SAAS,GAAG,OAAO,CAAC,CAQ/B"}
|
|
@@ -56,7 +56,7 @@ function minProjectedAdvancementSampleChanges(numChanges) {
|
|
|
56
56
|
}
|
|
57
57
|
function shouldResetProjectedAdvancement(elapsedMs, projectedTotalTimeMs, processedChanges, numChanges, totalHydrationTimeMs) {
|
|
58
58
|
if (projectedTotalTimeMs === void 0 || numChanges < MIN_PROJECTED_ADVANCEMENT_CHANGES || processedChanges < minProjectedAdvancementSampleChanges(numChanges) || elapsedMs < MIN_PROJECTED_ADVANCEMENT_SAMPLE_MS) return false;
|
|
59
|
-
return projectedTotalTimeMs > advancementResetTimeLimitMs(totalHydrationTimeMs) * PROJECTED_ADVANCEMENT_RESET_MULTIPLIER;
|
|
59
|
+
return projectedTotalTimeMs - elapsedMs > advancementResetTimeLimitMs(totalHydrationTimeMs) * PROJECTED_ADVANCEMENT_RESET_MULTIPLIER;
|
|
60
60
|
}
|
|
61
61
|
function shouldFinishLateAdvancement(processedChanges, numChanges) {
|
|
62
62
|
return numChanges > 0 && processedChanges / numChanges >= LATE_ADVANCEMENT_FINISH_PROGRESS;
|
|
@@ -945,7 +945,7 @@ var PipelineDriver = class {
|
|
|
945
945
|
const projectedTotalTimeMs = projectedAdvancementTimeMs(elapsed, pos, numChanges);
|
|
946
946
|
const shouldFinish = shouldFinishLateAdvancement(pos, numChanges);
|
|
947
947
|
if (!shouldFinish && shouldResetProjectedAdvancement(elapsed, projectedTotalTimeMs, pos, numChanges, totalHydrationTimeMs)) this.#throwProjectedAdvancementReset(pos, numChanges, elapsed, projectedTotalTimeMs, totalHydrationTimeMs);
|
|
948
|
-
if (!shouldFinish && elapsed > MIN_ADVANCEMENT_TIME_LIMIT_MS &&
|
|
948
|
+
if (!shouldFinish && elapsed > MIN_ADVANCEMENT_TIME_LIMIT_MS && elapsed > totalHydrationTimeMs / 2 && (projectedTotalTimeMs === void 0 || projectedTotalTimeMs - elapsed > totalHydrationTimeMs)) throw new ResetPipelinesSignal(`Advancement exceeded timeout at ${pos} of ${numChanges} changes after ${elapsed} ms. Advancement time limited based on total hydration time of ${totalHydrationTimeMs} ms.`, "advancement-timeout");
|
|
949
949
|
return checkYield && advanceTimer.elapsedLap() > this.#yieldThresholdMs();
|
|
950
950
|
}
|
|
951
951
|
/**
|