@substrat-run/control-plane-api 0.177.0 → 0.179.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/aggregate-reads.d.ts.map +1 -1
- package/dist/aggregate-reads.js +4 -3
- package/dist/aggregate-reads.js.map +1 -1
- package/dist/aggregate-source.d.ts +8 -1
- package/dist/aggregate-source.d.ts.map +1 -1
- package/dist/aggregate-source.js +2 -1
- package/dist/aggregate-source.js.map +1 -1
- package/dist/api.d.ts +4 -0
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +435 -296
- package/dist/api.js.map +1 -1
- package/dist/backups.d.ts +58 -13
- package/dist/backups.d.ts.map +1 -1
- package/dist/cf-observability.d.ts.map +1 -1
- package/dist/cf-observability.js +26 -16
- package/dist/cf-observability.js.map +1 -1
- package/dist/directory-backup.d.ts +4 -0
- package/dist/directory-backup.d.ts.map +1 -1
- package/dist/directory-backup.js +60 -7
- package/dist/directory-backup.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lake-gateway.d.ts +9 -0
- package/dist/lake-gateway.d.ts.map +1 -1
- package/dist/lake-gateway.js +18 -1
- package/dist/lake-gateway.js.map +1 -1
- package/dist/observability.d.ts +6 -1
- package/dist/observability.d.ts.map +1 -1
- package/dist/observability.js +8 -1
- package/dist/observability.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/platform-scope-stores.d.ts +20 -22
- package/dist/platform-scope-stores.d.ts.map +1 -1
- package/dist/platform-scope-stores.js +22 -17
- package/dist/platform-scope-stores.js.map +1 -1
- package/dist/r2-backups.d.ts.map +1 -1
- package/dist/r2-backups.js +173 -34
- package/dist/r2-backups.js.map +1 -1
- package/dist/store-entry.d.ts.map +1 -1
- package/dist/store-entry.generated.d.ts +2 -7
- package/dist/store-entry.generated.d.ts.map +1 -1
- package/dist/store-entry.generated.js +5 -10
- package/dist/store-entry.generated.js.map +1 -1
- package/dist/store-entry.js +3 -2
- package/dist/store-entry.js.map +1 -1
- package/dist/store-move-ends.d.ts +59 -0
- package/dist/store-move-ends.d.ts.map +1 -0
- package/dist/store-move-ends.js +114 -0
- package/dist/store-move-ends.js.map +1 -0
- package/dist/store-move.d.ts +65 -0
- package/dist/store-move.d.ts.map +1 -0
- package/dist/store-move.js +107 -0
- package/dist/store-move.js.map +1 -0
- package/dist/store-releases.d.ts +18 -4
- package/dist/store-releases.d.ts.map +1 -1
- package/dist/store-releases.js +74 -11
- package/dist/store-releases.js.map +1 -1
- package/dist/store-script.d.ts +12 -2
- package/dist/store-script.d.ts.map +1 -1
- package/dist/store-script.js +47 -9
- package/dist/store-script.js.map +1 -1
- package/dist/tenant-request-query.d.ts.map +1 -1
- package/dist/tenant-request-query.js +5 -0
- package/dist/tenant-request-query.js.map +1 -1
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store-entry.generated.js","sourceRoot":"","sources":["../src/store-entry.generated.ts"],"names":[],"mappings":"AAAA,oOAAoO;AACpO,mEAAmE;AAEnE;;;;;GAKG;AAEH,oFAAoF;AACpF,MAAM,CAAC,MAAM,qBAAqB,GAAG,4BAA4B,CAAC;AAElE
|
|
1
|
+
{"version":3,"file":"store-entry.generated.js","sourceRoot":"","sources":["../src/store-entry.generated.ts"],"names":[],"mappings":"AAAA,oOAAoO;AACpO,mEAAmE;AAEnE;;;;;GAKG;AAEH,oFAAoF;AACpF,MAAM,CAAC,MAAM,qBAAqB,GAAG,4BAA4B,CAAC;AAElE,2FAA2F;AAC3F,MAAM,CAAC,MAAM,uBAAuB,GAAG,0BAA0B,CAAC;AAElE,+EAA+E;AAC/E,MAAM,CAAC,MAAM,wBAAwB,GAAG,2BAA2B,CAAC;AAEpE,4GAA4G;AAC5G,MAAM,CAAC,MAAM,kBAAkB,GAAG,yBAAyB,CAAC;AAE5D;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,yBAAyB,CAAC;AAEnE,wDAAwD;AACxD,MAAM,CAAC,MAAM,oBAAoB,GAAG,gBAAgB,CAAC;AAErD,gGAAgG;AAChG,MAAM,CAAC,MAAM,kBAAkB,GAAG,qBAAqB,CAAC;AAExD,+DAA+D;AAC/D,MAAM,CAAC,MAAM,uBAAuB,GAAG,8BAA8B,CAAC;AAEtE;;;GAGG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,YAAY,CAAC;AAE5D,6GAA6G;AAC7G,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,gBAAgB,CAAC,CAAC;AAEnE;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,gBAAgB,CAAC;AAE9D,mGAAmG;AACnG,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,yBAAyB,EAAC,yBAAyB,EAAC,0BAA0B,CAAC,CAAC;AAEvH,8FAA8F;AAC9F,MAAM,CAAC,MAAM,gBAAgB,GAAG,uBAAuB,CAAC;AAExD;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,0BAA0B,CAAC;AAEhE,6CAA6C;AAC7C,MAAM,CAAC,MAAM,kBAAkB,GAAW,upcAAupc,CAAC;AAElsc;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAW,60MAA60M,CAAC;AAE/3M;;;GAGG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAW,u+XAAu+X,CAAC"}
|
package/dist/store-entry.js
CHANGED
|
@@ -145,7 +145,8 @@ export function withPythonStoreEntry(release, options) {
|
|
|
145
145
|
content: encode(STORE_ENTRY_PYTHON_VERIFIER_SOURCE),
|
|
146
146
|
contentType: 'application/javascript+module',
|
|
147
147
|
},
|
|
148
|
-
|
|
148
|
+
// The canary fixture is the canary's input (#2814), not something the script loads.
|
|
149
|
+
...release.modules.filter((module) => classes.get(module.name).kind !== 'canaryFixture').map((module) => ({
|
|
149
150
|
name: module.name,
|
|
150
151
|
content: module.content,
|
|
151
152
|
contentType: classes.get(module.name).kind === 'vendored' ? STORE_PYTHON_DATA_CONTENT_TYPE : 'text/x-python',
|
|
@@ -173,7 +174,7 @@ export function assertPythonDriverModules(release) {
|
|
|
173
174
|
if (classes.has(module.name))
|
|
174
175
|
throw new Error(`a store driver release ships '${module.name}' twice`);
|
|
175
176
|
classes.set(module.name, classified);
|
|
176
|
-
if (classified.kind
|
|
177
|
+
if (classified.kind !== 'vendored')
|
|
177
178
|
packages.add(classified.packageName);
|
|
178
179
|
}
|
|
179
180
|
if (packages.size > 1) {
|
package/dist/store-entry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store-entry.js","sourceRoot":"","sources":["../src/store-entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,wBAAwB,EAAqD,MAAM,yBAAyB,CAAC;AAEjJ,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,kBAAkB,EAClB,yBAAyB,EACzB,yBAAyB,EACzB,kCAAkC,EAClC,kBAAkB,EAClB,wBAAwB,EACxB,oBAAoB,EACpB,kBAAkB,EAClB,uBAAuB,EACvB,+BAA+B,EAC/B,gCAAgC,EAChC,6BAA6B,EAC7B,sBAAsB,EACtB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,yBAAyB,EACzB,yBAAyB,EACzB,kCAAkC,EAClC,kBAAkB,EAClB,wBAAwB,EACxB,oBAAoB,EACpB,kBAAkB,EAClB,+BAA+B,EAC/B,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,4BAA4B,CAAC;AAgBpC,oGAAoG;AACpG,MAAM,WAAW,GAAG,gDAAgD,CAAC;AAErE;;;;GAIG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,yBAA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AC;AACjB,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { type ScopeDumpPageTable, type ScopeDumpTable } from '@substrat-run/contracts';
|
|
2
|
+
import { ControlPlaneError } from '@substrat-run/control-plane-client';
|
|
3
|
+
import type { ScopeBackupWriter } from './backups.js';
|
|
4
|
+
import type { DeclaredScopeStore, PlatformScopeStores } from './platform-scope-stores.js';
|
|
5
|
+
import { type MovedStore, type StorePlanEnds } from './store-move.js';
|
|
6
|
+
/** Where a scope's stores are: the store of each binding is one object of this scope. */
|
|
7
|
+
export interface StorePlace {
|
|
8
|
+
tenantId: string;
|
|
9
|
+
scopeId: string;
|
|
10
|
+
vertical: string;
|
|
11
|
+
}
|
|
12
|
+
/** A snapshot's ends: the source's store, page by page, into a stage at the fork's. */
|
|
13
|
+
export declare const snapshotEnds: (caller: PlatformScopeStores, from: StorePlace, to: StorePlace) => StorePlanEnds;
|
|
14
|
+
/** A backup's ends: the store's chain into `store-page` entries of the backup being written, under the move's id. */
|
|
15
|
+
export declare const backupEnds: (caller: PlatformScopeStores, place: StorePlace, writer: ScopeBackupWriter) => StorePlanEnds;
|
|
16
|
+
/** A store's pages as a restore reads them: a backup's `store-page` entries, or an inline dump cut into pages. */
|
|
17
|
+
export interface StoreSource {
|
|
18
|
+
pages: number;
|
|
19
|
+
revision: string;
|
|
20
|
+
page(seq: number): Promise<ScopeDumpPageTable[]>;
|
|
21
|
+
}
|
|
22
|
+
/** One store a restore loads: its binding, its driver, and where its pages come from. */
|
|
23
|
+
export interface RestoreStore extends DeclaredScopeStore {
|
|
24
|
+
source: StoreSource;
|
|
25
|
+
}
|
|
26
|
+
/** An inline store (an older backup's, or an uploaded dump's) as a source: cut at its driver's page size. */
|
|
27
|
+
export declare const inlineStoreSource: (store: {
|
|
28
|
+
driver: string;
|
|
29
|
+
tables: readonly ScopeDumpTable[];
|
|
30
|
+
}) => StoreSource;
|
|
31
|
+
/**
|
|
32
|
+
* A restore's ends: each store's source into a stage at the destination. A page that cannot be read
|
|
33
|
+
* or parsed refuses before any commit, so the store stays as it was.
|
|
34
|
+
*/
|
|
35
|
+
export declare const restoreEnds: (caller: PlatformScopeStores, to: StorePlace, sourceOf: (binding: string) => StoreSource) => StorePlanEnds;
|
|
36
|
+
/**
|
|
37
|
+
* A store's landing that failed once a commit was attempted: which bindings were committed, and
|
|
38
|
+
* which were not. The commit of `failed` may have run with its answer lost, so the store under it is
|
|
39
|
+
* either. The route replays erasures even so, since a store replaced by an old copy holds subjects
|
|
40
|
+
* erased since, and running the restore again converges: every commit is a whole replace.
|
|
41
|
+
*/
|
|
42
|
+
export declare class StoreLandFailure extends ControlPlaneError {
|
|
43
|
+
readonly committed: readonly string[];
|
|
44
|
+
readonly uncommitted: readonly string[];
|
|
45
|
+
constructor(cause: unknown, committed: readonly string[], uncommitted: readonly string[]);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Commit each moved store's stage, comparing each count with what was sent. The contract makes a
|
|
49
|
+
* commit asked again answer the same count and change nothing, so a transient fault is retried. Any
|
|
50
|
+
* failure throws a `StoreLandFailure`, and the stages not committed are discarded, best effort.
|
|
51
|
+
*/
|
|
52
|
+
export declare function commitStages(caller: PlatformScopeStores, place: StorePlace, moved: readonly MovedStore[], retry: <T>(run: () => Promise<T>) => Promise<T>): Promise<string[]>;
|
|
53
|
+
/**
|
|
54
|
+
* Whether a store holds any row, read at the smallest page the contract allows and stopped at the
|
|
55
|
+
* first row, so a store of any size costs one call to answer yes. A write during the scan cannot make
|
|
56
|
+
* this wrong for the caller: it asks about a binding no running version writes.
|
|
57
|
+
*/
|
|
58
|
+
export declare function storeHoldsRows(caller: PlatformScopeStores, place: StorePlace, store: DeclaredScopeStore): Promise<boolean>;
|
|
59
|
+
//# sourceMappingURL=store-move-ends.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store-move-ends.d.ts","sourceRoot":"","sources":["../src/store-move-ends.ts"],"names":[],"mappings":"AAAA,O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AACH,qBAAa,gBAAiB,SAAQ,iBAAiB;IAGnD,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE;IACrC,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE;IAHzC,YACE,KAAK,EAAE,OAAO,EACL,SAAS,EAAE,SAAS,MAAM,EAAE,EAC5B,WAAW,EAAE,SAAS,MAAM,EAAE,EAQxC;CACF;AAED;;;;GAIG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,mBAAmB,EAC3B,KAAK,EAAE,UAAU,EACjB,KAAK,EAAE,SAAS,UAAU,EAAE,EAC5B,KAAK,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,GAC9C,OAAO,CAAC,MAAM,EAAE,CAAC,CAiBnB;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE,mBAAmB,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC,CAchI"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { storeDriverDumpPageBytes } from '@substrat-run/contracts';
|
|
2
|
+
import { storeDumpPages } from '@substrat-run/kernel';
|
|
3
|
+
import { ControlPlaneError } from '@substrat-run/control-plane-client';
|
|
4
|
+
import { STORE_MOVE_MAX_PAGES } from './store-move.js';
|
|
5
|
+
const callAt = (caller, place, store) => caller.callStore({ ...place, ...store });
|
|
6
|
+
/** A store's chain as a move reads it: the driver's declared page size, nothing else asked. */
|
|
7
|
+
const chainRead = (call, driver) => (cursor) => call('substrat.export-page', { cursor, maxBytes: storeDriverDumpPageBytes(driver) });
|
|
8
|
+
/** A store's stage as a move writes it. Each page goes once under a fresh id, so `staged: false` is the driver's fault. */
|
|
9
|
+
const stageEnds = (call, binding) => ({
|
|
10
|
+
write: async (moveId, seq, tables) => {
|
|
11
|
+
const { staged } = await call('substrat.stage-page', { stageId: moveId, seq, tables });
|
|
12
|
+
if (!staged)
|
|
13
|
+
throw new ControlPlaneError(502, `scope store '${binding}' held page ${seq} of a stage it was only just given`);
|
|
14
|
+
},
|
|
15
|
+
discard: async (moveId) => {
|
|
16
|
+
await call('substrat.discard-stage', { stageId: moveId });
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
/** A snapshot's ends: the source's store, page by page, into a stage at the fork's. */
|
|
20
|
+
export const snapshotEnds = (caller, from, to) => (store) => ({
|
|
21
|
+
read: chainRead(callAt(caller, from, store), store.driver),
|
|
22
|
+
...stageEnds(callAt(caller, to, store), store.binding),
|
|
23
|
+
});
|
|
24
|
+
/** A backup's ends: the store's chain into `store-page` entries of the backup being written, under the move's id. */
|
|
25
|
+
export const backupEnds = (caller, place, writer) => (store) => ({
|
|
26
|
+
read: chainRead(callAt(caller, place, store), store.driver),
|
|
27
|
+
write: (moveId, seq, tables) => writer.put(moveId, seq, { kind: 'store-page', tables }),
|
|
28
|
+
discard: (moveId) => writer.discard(moveId),
|
|
29
|
+
});
|
|
30
|
+
/** An inline store (an older backup's, or an uploaded dump's) as a source: cut at its driver's page size. */
|
|
31
|
+
export const inlineStoreSource = (store) => {
|
|
32
|
+
const pages = storeDumpPages(store.tables, storeDriverDumpPageBytes(store.driver));
|
|
33
|
+
return { pages: pages.length, revision: 'inline', page: async (seq) => pages[seq] };
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* A restore's ends: each store's source into a stage at the destination. A page that cannot be read
|
|
37
|
+
* or parsed refuses before any commit, so the store stays as it was.
|
|
38
|
+
*/
|
|
39
|
+
export const restoreEnds = (caller, to, sourceOf) => (store) => {
|
|
40
|
+
const source = sourceOf(store.binding);
|
|
41
|
+
return {
|
|
42
|
+
read: async (cursor) => {
|
|
43
|
+
const seq = cursor === null ? 0 : Number(cursor);
|
|
44
|
+
return { tables: await source.page(seq), next: seq + 1 < source.pages ? String(seq + 1) : null, revision: source.revision };
|
|
45
|
+
},
|
|
46
|
+
...stageEnds(callAt(caller, to, store), store.binding),
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* A store's landing that failed once a commit was attempted: which bindings were committed, and
|
|
51
|
+
* which were not. The commit of `failed` may have run with its answer lost, so the store under it is
|
|
52
|
+
* either. The route replays erasures even so, since a store replaced by an old copy holds subjects
|
|
53
|
+
* erased since, and running the restore again converges: every commit is a whole replace.
|
|
54
|
+
*/
|
|
55
|
+
export class StoreLandFailure extends ControlPlaneError {
|
|
56
|
+
committed;
|
|
57
|
+
uncommitted;
|
|
58
|
+
constructor(cause, committed, uncommitted) {
|
|
59
|
+
const message = cause instanceof Error ? cause.message : String(cause);
|
|
60
|
+
super(cause instanceof ControlPlaneError ? cause.status : 502, `${message}. The scope's stores were committed in part: ${committed.length ? committed.join(', ') : 'none'} committed, ` +
|
|
61
|
+
`${uncommitted.join(', ')} not known to be; restore again to finish`);
|
|
62
|
+
this.committed = committed;
|
|
63
|
+
this.uncommitted = uncommitted;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Commit each moved store's stage, comparing each count with what was sent. The contract makes a
|
|
68
|
+
* commit asked again answer the same count and change nothing, so a transient fault is retried. Any
|
|
69
|
+
* failure throws a `StoreLandFailure`, and the stages not committed are discarded, best effort.
|
|
70
|
+
*/
|
|
71
|
+
export async function commitStages(caller, place, moved, retry) {
|
|
72
|
+
const committed = [];
|
|
73
|
+
for (const [at, store] of moved.entries()) {
|
|
74
|
+
const call = callAt(caller, place, store);
|
|
75
|
+
try {
|
|
76
|
+
const answer = await retry(() => call('substrat.commit-stage', { stageId: store.moveId }));
|
|
77
|
+
if (answer.tables !== store.tables) {
|
|
78
|
+
throw new ControlPlaneError(502, `scope store '${store.binding}' committed ${answer.tables} tables of the ${store.tables} it was sent`);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
catch (e) {
|
|
82
|
+
const rest = moved.slice(at);
|
|
83
|
+
for (const left of rest.slice(1))
|
|
84
|
+
await callAt(caller, place, left)('substrat.discard-stage', { stageId: left.moveId }).catch(() => undefined);
|
|
85
|
+
throw new StoreLandFailure(e, committed, rest.map((s) => s.binding));
|
|
86
|
+
}
|
|
87
|
+
committed.push(store.binding);
|
|
88
|
+
}
|
|
89
|
+
return committed;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Whether a store holds any row, read at the smallest page the contract allows and stopped at the
|
|
93
|
+
* first row, so a store of any size costs one call to answer yes. A write during the scan cannot make
|
|
94
|
+
* this wrong for the caller: it asks about a binding no running version writes.
|
|
95
|
+
*/
|
|
96
|
+
export async function storeHoldsRows(caller, place, store) {
|
|
97
|
+
const call = callAt(caller, place, store);
|
|
98
|
+
const asked = new Set();
|
|
99
|
+
let cursor = null;
|
|
100
|
+
for (let pages = 1;; pages += 1) {
|
|
101
|
+
const page = await call('substrat.export-page', { cursor, maxBytes: 1 });
|
|
102
|
+
if (page.tables.some((table) => table.rows.length > 0))
|
|
103
|
+
return true;
|
|
104
|
+
if (page.next === null)
|
|
105
|
+
return false;
|
|
106
|
+
if (cursor !== null)
|
|
107
|
+
asked.add(cursor);
|
|
108
|
+
if (asked.has(page.next) || page.next === cursor || pages >= STORE_MOVE_MAX_PAGES) {
|
|
109
|
+
throw new ControlPlaneError(502, `scope store '${store.binding}' answered a chain that does not end`);
|
|
110
|
+
}
|
|
111
|
+
cursor = page.next;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=store-move-ends.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store-move-ends.js","sourceRoot":"","sources":["../src/store-move-ends.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAgD,MAAM,yBAAyB,CAAC;AACjH,OAAO,EAAE,cAAc,EAA0B,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAGvE,OAAO,EAAE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CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,MAA2B,EAAE,KAAiB,EAAE,KAAyB;IAC5G,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAC1C,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,IAAI,MAAM,GAAkB,IAAI,CAAC;IACjC,KAAK,IAAI,KAAK,GAAG,CAAC,GAAI,KAAK,IAAI,CAAC,EAAE,CAAC;QACjC,MAAM,IAAI,GAA2D,MAAM,IAAI,CAAC,sBAAsB,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC;QACjI,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;YAAE,OAAO,IAAI,CAAC;QACpE,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI;YAAE,OAAO,KAAK,CAAC;QACrC,IAAI,MAAM,KAAK,IAAI;YAAE,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACvC,IAAI,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,IAAI,KAAK,IAAI,oBAAoB,EAAE,CAAC;YAClF,MAAM,IAAI,iBAAiB,CAAC,GAAG,EAAE,gBAAgB,KAAK,CAAC,OAAO,sCAAsC,CAAC,CAAC;QACxG,CAAC;QACD,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { ScopeDumpPageTable } from '@substrat-run/contracts';
|
|
2
|
+
import type { DeclaredScopeStore } from './platform-scope-stores.js';
|
|
3
|
+
/**
|
|
4
|
+
* A store's data moved a page at a time (D-69): out of a store's chain or a backup's store pages,
|
|
5
|
+
* into a store's stage or a backup's store pages, holding one page.
|
|
6
|
+
*
|
|
7
|
+
* Its own stepper, not `transferStep` over `TransferEnds`: that one moves a scope, through a client
|
|
8
|
+
* that names scope ids, a capture to catch up on, a `_substrat_meta` to fold, and a lease. A store has
|
|
9
|
+
* one chain, an opaque revision and a driver's stage, so all that would be stubbed out. The shape is
|
|
10
|
+
* the same: read a page, write it, next; a revision that moved starts again under a new id; nothing
|
|
11
|
+
* changes the object until a commit.
|
|
12
|
+
*/
|
|
13
|
+
export interface PageMoveEnds {
|
|
14
|
+
read(cursor: string | null): Promise<{
|
|
15
|
+
tables: ScopeDumpPageTable[];
|
|
16
|
+
next: string | null;
|
|
17
|
+
revision: string;
|
|
18
|
+
}>;
|
|
19
|
+
write(moveId: string, seq: number, tables: ScopeDumpPageTable[]): Promise<void>;
|
|
20
|
+
/** Best effort: what a dropped move leaves goes with its stage's age, or with retention. */
|
|
21
|
+
discard(moveId: string): Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
/** How many chains a move reads before it refuses: four waits, of 1, 2, 4 and 8 s. */
|
|
24
|
+
export declare const STORE_MOVE_ATTEMPTS = 5;
|
|
25
|
+
/** The wait before the chain after attempt `attempt`, ms. */
|
|
26
|
+
export declare const storeMoveBackoffMs: (attempt: number) => number;
|
|
27
|
+
/** The most pages one chain may have, as the kernel's reader has it: a longer one does not end. */
|
|
28
|
+
export declare const STORE_MOVE_MAX_PAGES = 100000;
|
|
29
|
+
/** A store a move has finished: its stage or its store pages, as `moveId` names them. */
|
|
30
|
+
export interface MovedStore extends DeclaredScopeStore {
|
|
31
|
+
moveId: string;
|
|
32
|
+
revision: string;
|
|
33
|
+
/** Distinct tables: what a commit answers again. */
|
|
34
|
+
tables: number;
|
|
35
|
+
/** Pages written, in order from 0. */
|
|
36
|
+
pages: number;
|
|
37
|
+
}
|
|
38
|
+
export type StorePlanEnds = (store: DeclaredScopeStore) => PageMoveEnds;
|
|
39
|
+
/**
|
|
40
|
+
* How much of a store move one request does (D-69): every page costs a read and a write, so 300 stay
|
|
41
|
+
* well inside a Worker invocation's 1000 subrequests, and leave a restore room for its commits and its
|
|
42
|
+
* erasure replay. There is no job to hand the rest to, so past it the move refuses with nothing changed.
|
|
43
|
+
*/
|
|
44
|
+
export interface StoreRequestBudget {
|
|
45
|
+
pages: number;
|
|
46
|
+
/** How long a request moves pages, ms, backoff included. */
|
|
47
|
+
ms: number;
|
|
48
|
+
/** Default a real wait. A test injects none. */
|
|
49
|
+
sleep?: (ms: number) => Promise<void>;
|
|
50
|
+
}
|
|
51
|
+
export declare const STORE_REQUEST_BUDGET: StoreRequestBudget;
|
|
52
|
+
/**
|
|
53
|
+
* Move every store's chain, one after another, inside one request's budget. A chain starts again
|
|
54
|
+
* under a new id, its pages so far discarded, when the revision moved (the pages would be no one
|
|
55
|
+
* moment) or an end answers 409 (a driver refusing a read during writes, or a stage an erase, a wipe
|
|
56
|
+
* or another writer dropped), after a wait of 1, 2, 4 and then 8 s. After `STORE_MOVE_ATTEMPTS`
|
|
57
|
+
* chains, or past the budget, it refuses (409). On any refusal or fault every move it made is
|
|
58
|
+
* discarded, best effort, so the far ends hold nothing of it; on success the caller owns the moves.
|
|
59
|
+
*/
|
|
60
|
+
export declare function moveStores(endsOf: StorePlanEnds, stores: readonly DeclaredScopeStore[], what: string, budget?: StoreRequestBudget): Promise<MovedStore[]>;
|
|
61
|
+
/** Give up these moves at their far ends, best effort: a stage goes by its age, a store page with its backup's retention. */
|
|
62
|
+
export declare function discardMoves(endsOf: StorePlanEnds, moves: readonly (DeclaredScopeStore & {
|
|
63
|
+
moveId: string;
|
|
64
|
+
})[]): Promise<void>;
|
|
65
|
+
//# sourceMappingURL=store-move.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store-move.d.ts","sourceRoot":"","sources":["../src/store-move.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB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C;AAED,eAAO,MAAM,oBAAoB,EAAE,kBAA+C,CAAC;AAInF;;;;;;;GAOG;AACH,wBAAsB,UAAU,CAC9B,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,SAAS,kBAAkB,EAAE,EACrC,IAAI,EAAE,MAAM,EACZ,MAAM,GAAE,kBAAyC,GAChD,OAAO,CAAC,UAAU,EAAE,CAAC,CA4EvB;AAED,6HAA6H;AAC7H,wBAAsB,YAAY,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,CAAC,kBAAkB,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAIpI"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { ulid } from '@substrat-run/kernel';
|
|
2
|
+
import { ControlPlaneError } from '@substrat-run/control-plane-client';
|
|
3
|
+
const newPageMove = (attempt = 1) => ({
|
|
4
|
+
moveId: ulid(), seq: 0, cursor: null, revision: null, attempt, tableNames: new Set(),
|
|
5
|
+
});
|
|
6
|
+
/** How many chains a move reads before it refuses: four waits, of 1, 2, 4 and 8 s. */
|
|
7
|
+
export const STORE_MOVE_ATTEMPTS = 5;
|
|
8
|
+
/** The wait before the chain after attempt `attempt`, ms. */
|
|
9
|
+
export const storeMoveBackoffMs = (attempt) => 1_000 * 2 ** (attempt - 1);
|
|
10
|
+
/** The most pages one chain may have, as the kernel's reader has it: a longer one does not end. */
|
|
11
|
+
export const STORE_MOVE_MAX_PAGES = 100_000;
|
|
12
|
+
export const STORE_REQUEST_BUDGET = { pages: 300, ms: 20_000 };
|
|
13
|
+
const isConflict = (e) => e instanceof ControlPlaneError && e.status === 409;
|
|
14
|
+
/**
|
|
15
|
+
* Move every store's chain, one after another, inside one request's budget. A chain starts again
|
|
16
|
+
* under a new id, its pages so far discarded, when the revision moved (the pages would be no one
|
|
17
|
+
* moment) or an end answers 409 (a driver refusing a read during writes, or a stage an erase, a wipe
|
|
18
|
+
* or another writer dropped), after a wait of 1, 2, 4 and then 8 s. After `STORE_MOVE_ATTEMPTS`
|
|
19
|
+
* chains, or past the budget, it refuses (409). On any refusal or fault every move it made is
|
|
20
|
+
* discarded, best effort, so the far ends hold nothing of it; on success the caller owns the moves.
|
|
21
|
+
*/
|
|
22
|
+
export async function moveStores(endsOf, stores, what, budget = STORE_REQUEST_BUDGET) {
|
|
23
|
+
const sleep = budget.sleep ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
|
|
24
|
+
const startedAt = Date.now();
|
|
25
|
+
let pages = 0;
|
|
26
|
+
const moved = [];
|
|
27
|
+
let current;
|
|
28
|
+
const overBudget = (wait = 0) => pages >= budget.pages || Date.now() + wait - startedAt >= budget.ms
|
|
29
|
+
? new ControlPlaneError(409, `${what} take more than one request's budget of ${budget.pages} pages or ${budget.ms / 1000} s to move, so nothing was changed`)
|
|
30
|
+
: undefined;
|
|
31
|
+
try {
|
|
32
|
+
for (const store of stores) {
|
|
33
|
+
const ends = endsOf(store);
|
|
34
|
+
const label = `scope store '${store.binding}'`;
|
|
35
|
+
let state = newPageMove();
|
|
36
|
+
current = { store, moveId: state.moveId };
|
|
37
|
+
for (;;) {
|
|
38
|
+
const restart = async () => {
|
|
39
|
+
await ends.discard(state.moveId).catch(() => undefined);
|
|
40
|
+
if (state.attempt >= STORE_MOVE_ATTEMPTS) {
|
|
41
|
+
throw new ControlPlaneError(409, `${label} was written to throughout ${STORE_MOVE_ATTEMPTS} reads of it, so no copy was true at one moment and nothing was changed. Retry when it is quieter.`);
|
|
42
|
+
}
|
|
43
|
+
const wait = storeMoveBackoffMs(state.attempt);
|
|
44
|
+
const over = overBudget(wait);
|
|
45
|
+
if (over)
|
|
46
|
+
throw over;
|
|
47
|
+
await sleep(wait);
|
|
48
|
+
state = newPageMove(state.attempt + 1);
|
|
49
|
+
current = { store, moveId: state.moveId };
|
|
50
|
+
};
|
|
51
|
+
const at = state.cursor;
|
|
52
|
+
let page;
|
|
53
|
+
try {
|
|
54
|
+
page = await ends.read(at);
|
|
55
|
+
}
|
|
56
|
+
catch (e) {
|
|
57
|
+
if (!isConflict(e))
|
|
58
|
+
throw e;
|
|
59
|
+
await restart();
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
if (state.revision !== null && page.revision !== state.revision) {
|
|
63
|
+
await restart();
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
if (page.next !== null && page.next === at) {
|
|
67
|
+
throw new ControlPlaneError(502, `${label} answered the cursor it was asked with, so its chain does not move`);
|
|
68
|
+
}
|
|
69
|
+
if (page.next !== null && state.seq + 1 >= STORE_MOVE_MAX_PAGES) {
|
|
70
|
+
throw new ControlPlaneError(502, `${label} did not end in ${STORE_MOVE_MAX_PAGES} pages`);
|
|
71
|
+
}
|
|
72
|
+
try {
|
|
73
|
+
await ends.write(state.moveId, state.seq, page.tables);
|
|
74
|
+
}
|
|
75
|
+
catch (e) {
|
|
76
|
+
if (!isConflict(e))
|
|
77
|
+
throw e;
|
|
78
|
+
await restart();
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
pages += 1;
|
|
82
|
+
for (const table of page.tables)
|
|
83
|
+
state.tableNames.add(table.name);
|
|
84
|
+
state = { ...state, seq: state.seq + 1, cursor: page.next, revision: page.revision };
|
|
85
|
+
if (page.next === null)
|
|
86
|
+
break;
|
|
87
|
+
const over = overBudget();
|
|
88
|
+
if (over)
|
|
89
|
+
throw over;
|
|
90
|
+
}
|
|
91
|
+
moved.push({ ...store, moveId: state.moveId, revision: state.revision, tables: state.tableNames.size, pages: state.seq });
|
|
92
|
+
current = undefined;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
catch (e) {
|
|
96
|
+
await discardMoves(endsOf, [...moved, ...(current ? [{ ...current.store, moveId: current.moveId }] : [])]);
|
|
97
|
+
throw e;
|
|
98
|
+
}
|
|
99
|
+
return moved;
|
|
100
|
+
}
|
|
101
|
+
/** Give up these moves at their far ends, best effort: a stage goes by its age, a store page with its backup's retention. */
|
|
102
|
+
export async function discardMoves(endsOf, moves) {
|
|
103
|
+
for (const move of moves) {
|
|
104
|
+
await endsOf(move).discard(move.moveId).catch(() => undefined);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=store-move.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store-move.js","sourceRoot":"","sources":["../src/store-move.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AA+BvE,MAAM,WAAW,GAAG,CAAC,OAAO,GAAG,CAAC,EAAiB,EAAE,CAAC,CAAC;IACnD,MAAM,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,GAAG,EAAE;CACrF,CAAC,CAAC;AAEH,sFAAsF;AACtF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AACrC,6DAA6D;AAC7D,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,OAAe,EAAU,EAAE,CAAC,KAAK,GAAG,CAAC,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC;AAC1F,mGAAmG;AACnG,MAAM,CAAC,MAAM,oBAAoB,GAAG,OAAO,CAAC;AA2B5C,MAAM,CAAC,MAAM,oBAAoB,GAAuB,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC;AAEnF,MAAM,UAAU,GAAG,CAAC,CAAU,EAAW,EAAE,CAAC,CAAC,YAAY,iBAAiB,IAAI,CAAC,CAAC,MAAM,KAAK,GAAG,CAAC;AAE/F;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,MAAqB,EACrB,MAAqC,EACrC,IAAY,EACZ,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IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,YAAY,CAAC,MAAM,EAAE,CAAC,GAAG,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC3G,MAAM,CAAC,CAAC;IACV,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,6HAA6H;AAC7H,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,MAAqB,EAAE,KAA2D;IACnH,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IACjE,CAAC;AACH,CAAC"}
|
package/dist/store-releases.d.ts
CHANGED
|
@@ -120,7 +120,7 @@ export declare function approveStoredDriverRelease(input: {
|
|
|
120
120
|
sha256: string;
|
|
121
121
|
approval: Omit<Parameters<HostAdmin['approveStoreDriverRelease']>[1], 'driver' | 'sha256'>;
|
|
122
122
|
}): Promise<StoreDriverApprovalRecord>;
|
|
123
|
-
/**
|
|
123
|
+
/** One reserved call at the canary script, on the canary's object. */
|
|
124
124
|
export type CanaryCall = (target: {
|
|
125
125
|
scriptName: string;
|
|
126
126
|
objectName: string;
|
|
@@ -134,12 +134,25 @@ export declare const canaryObjectName: (binding: string) => string;
|
|
|
134
134
|
/**
|
|
135
135
|
* Every reserved operation, on a fresh object of the platform's own (D-63): its tenant and scope
|
|
136
136
|
* ids are new ulids, from the runtime's CSPRNG, never in the directory, and its vertical segment
|
|
137
|
-
* is no vertical's. Each answer is parsed by the call and asserted here; the first that is
|
|
138
|
-
*
|
|
137
|
+
* is no vertical's. Each answer is parsed by the call and asserted here; the first that is wrong
|
|
138
|
+
* fails the canary. The object starts empty, takes the release's own fixture (#2814) and must
|
|
139
|
+
* export it back unchanged, then builds its runtime over that data (`substrat.selfcheck`) and
|
|
140
|
+
* must serve exactly the catalog the release's approval records. The object is wiped at the end.
|
|
141
|
+
*
|
|
142
|
+
* The dump moves in pages (D-69) through the kernel's own `readStoreDump` and `writeStoreDumpPages`,
|
|
143
|
+
* the reader and the writer a backup and a restore use, at the smallest page the contract allows.
|
|
144
|
+
* The fixture is staged a row a page, between a first and a last page that carry only its table
|
|
145
|
+
* headings, so the stage is several pages whatever the fixture's size: a commit that keeps only its
|
|
146
|
+
* first or its last page loses the rows, and one that counts fragments miscounts. A dump is compared
|
|
147
|
+
* as its pages merge, so a driver that cuts its pages differently is not refused.
|
|
139
148
|
*/
|
|
140
149
|
export declare function canaryStoreRelease(input: {
|
|
141
150
|
call: CanaryCall;
|
|
142
151
|
scriptName: string;
|
|
152
|
+
/** The bytes of the release's `driver_<package>/substrat_canary.json`, if it ships one. */
|
|
153
|
+
fixture: Uint8Array | undefined;
|
|
154
|
+
/** The catalog the release's approval records. */
|
|
155
|
+
operations: readonly string[];
|
|
143
156
|
binding?: string;
|
|
144
157
|
}): Promise<void>;
|
|
145
158
|
export interface StoreDriverRolloutDeps {
|
|
@@ -159,9 +172,10 @@ export interface StoreDriverRolloutDeps {
|
|
|
159
172
|
to: string;
|
|
160
173
|
approvals: StoreDriverApprovals;
|
|
161
174
|
}) => Promise<boolean>;
|
|
162
|
-
/** Put `to` in the driver's canary script; answers its name. */
|
|
175
|
+
/** Put `to` in the driver's canary script; answers its name and the release's canary fixture. */
|
|
163
176
|
ensureCanary: (to: string, approvals: StoreDriverApprovals) => Promise<{
|
|
164
177
|
scriptName: string;
|
|
178
|
+
fixture?: Uint8Array;
|
|
165
179
|
}>;
|
|
166
180
|
callCanary: CanaryCall;
|
|
167
181
|
/** For a test: a smaller batch than {@link ROLLOUT_VERTICALS_PER_REQUEST}. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store-releases.d.ts","sourceRoot":"","sources":["../src/store-releases.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAOL,KAAK,eAAe,EACpB,KAAK,sBAAsB,
|
|
1
|
+
{"version":3,"file":"store-releases.d.ts","sourceRoot":"","sources":["../src/store-releases.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAOL,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAE3B,KAAK,cAAc,EACnB,KAAK,uBAAuB,EAC7B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAQL,KAAK,SAAS,EACd,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAE9B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAIL,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAChC,MAAM,mBAAmB,CAAC;AAE3B,oFAAoF;AACpF,MAAM,WAAW,iBAAiB;IAChC,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC;IAClD,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD,6DAA6D;IAC7D,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC,CAAC;IACzD,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,cAAc,CAAC,UAAU,CAAC,CAAA;KAAE,GAAG,SAAS,CAAC,CAAC;CAC5F;AAED,uFAAuF;AACvF,eAAO,MAAM,8BAA8B,QAA6D,CAAC;AAEzG,kDAAkD;AAClD,eAAO,MAAM,eAAe,WA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