@substrat-run/kernel 0.147.0 → 0.149.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/attachment-sweep.d.ts +208 -0
- package/dist/attachment-sweep.d.ts.map +1 -0
- package/dist/attachment-sweep.js +318 -0
- package/dist/attachment-sweep.js.map +1 -0
- package/dist/audit-outcome.d.ts +1 -1
- package/dist/audit-outcome.d.ts.map +1 -1
- package/dist/audit-outcome.js +4 -2
- package/dist/audit-outcome.js.map +1 -1
- package/dist/export-break.d.ts +137 -0
- package/dist/export-break.d.ts.map +1 -0
- package/dist/export-break.js +219 -0
- package/dist/export-break.js.map +1 -0
- package/dist/index.d.ts +24 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -7
- package/dist/index.js.map +1 -1
- package/dist/install-receipts.d.ts +116 -0
- package/dist/install-receipts.d.ts.map +1 -0
- package/dist/install-receipts.js +162 -0
- package/dist/install-receipts.js.map +1 -0
- package/dist/invocation-line.d.ts +85 -0
- package/dist/invocation-line.d.ts.map +1 -1
- package/dist/invocation-line.js +43 -0
- package/dist/invocation-line.js.map +1 -1
- package/dist/map-bounded.d.ts +8 -0
- package/dist/map-bounded.d.ts.map +1 -0
- package/dist/map-bounded.js +16 -0
- package/dist/map-bounded.js.map +1 -0
- package/dist/migration-digest.d.ts +56 -0
- package/dist/migration-digest.d.ts.map +1 -1
- package/dist/migration-digest.js +92 -0
- package/dist/migration-digest.js.map +1 -1
- package/dist/migration-fence.d.ts +14 -0
- package/dist/migration-fence.d.ts.map +1 -0
- package/dist/migration-fence.js +515 -0
- package/dist/migration-fence.js.map +1 -0
- package/dist/migration-replay.d.ts +52 -0
- package/dist/migration-replay.d.ts.map +1 -0
- package/dist/migration-replay.js +140 -0
- package/dist/migration-replay.js.map +1 -0
- package/dist/module-migrations.d.ts +3 -3
- package/dist/module-migrations.js +3 -3
- package/dist/peer.d.ts +32 -2
- package/dist/peer.d.ts.map +1 -1
- package/dist/peer.js +100 -4
- package/dist/peer.js.map +1 -1
- package/dist/permission-eval.d.ts +8 -0
- package/dist/permission-eval.d.ts.map +1 -1
- package/dist/permission-eval.js +14 -0
- package/dist/permission-eval.js.map +1 -1
- package/dist/platform-sweep.d.ts +114 -361
- package/dist/platform-sweep.d.ts.map +1 -1
- package/dist/platform-sweep.js +134 -561
- package/dist/platform-sweep.js.map +1 -1
- package/dist/promote-review.d.ts +125 -0
- package/dist/promote-review.d.ts.map +1 -0
- package/dist/promote-review.js +181 -0
- package/dist/promote-review.js.map +1 -0
- package/dist/schedule-state.d.ts +91 -0
- package/dist/schedule-state.d.ts.map +1 -0
- package/dist/schedule-state.js +118 -0
- package/dist/schedule-state.js.map +1 -0
- package/dist/scope-copy-ledger.d.ts +29 -0
- package/dist/scope-copy-ledger.d.ts.map +1 -1
- package/dist/scope-copy-ledger.js +23 -0
- package/dist/scope-copy-ledger.js.map +1 -1
- package/dist/scope-copy.d.ts.map +1 -1
- package/dist/scope-copy.js +3 -2
- package/dist/scope-copy.js.map +1 -1
- package/dist/scope-host.d.ts +303 -11
- package/dist/scope-host.d.ts.map +1 -1
- package/dist/scope-host.js.map +1 -1
- package/dist/scope-identity.d.ts +68 -0
- package/dist/scope-identity.d.ts.map +1 -0
- package/dist/scope-identity.js +75 -0
- package/dist/scope-identity.js.map +1 -0
- package/dist/scope-store.d.ts +9 -6
- package/dist/scope-store.d.ts.map +1 -1
- package/dist/scope-store.js.map +1 -1
- package/dist/spine-restore.d.ts +2 -0
- package/dist/spine-restore.d.ts.map +1 -1
- package/dist/spine-restore.js +6 -1
- package/dist/spine-restore.js.map +1 -1
- package/dist/store-driver-releases.d.ts +306 -0
- package/dist/store-driver-releases.d.ts.map +1 -0
- package/dist/store-driver-releases.js +581 -0
- package/dist/store-driver-releases.js.map +1 -0
- package/dist/table-ownership.d.ts +5 -2
- package/dist/table-ownership.d.ts.map +1 -1
- package/dist/table-ownership.js +19 -10
- package/dist/table-ownership.js.map +1 -1
- package/dist/testing.d.ts +2 -0
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +2 -0
- package/dist/testing.js.map +1 -1
- package/dist/upload-link.d.ts +142 -0
- package/dist/upload-link.d.ts.map +1 -0
- package/dist/upload-link.js +441 -0
- package/dist/upload-link.js.map +1 -0
- package/dist/version-migrations.d.ts +63 -1
- package/dist/version-migrations.d.ts.map +1 -1
- package/dist/version-migrations.js +174 -8
- package/dist/version-migrations.js.map +1 -1
- package/dist/vertical-scope-stores.d.ts +43 -0
- package/dist/vertical-scope-stores.d.ts.map +1 -0
- package/dist/vertical-scope-stores.js +195 -0
- package/dist/vertical-scope-stores.js.map +1 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spine-restore.d.ts","sourceRoot":"","sources":["../src/spine-restore.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"spine-restore.d.ts","sourceRoot":"","sources":["../src/spine-restore.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAIlD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,SAAS,EAAE,eAAe,GAAG,IAAI,CAGjG;AAED,iGAAiG;AACjG,MAAM,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;AA2C9E;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,EAAE,SAAS,EAAE,eAAe,GAAG,MAAM,CAEtH;AASD;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,EACnD,aAAa,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,GAC3C,MAAM,EAAE,CAmBV;AA4CD;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,EAAE,SAAS,MAAM,EAIvD,CAAC;AAsBF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,IAAI,EAAE,SAAS,CAAC,SAAS,OAAO,EAAE,CAAC,EAAE,CAAA;CAAE,EAAE,EACtG,IAAI,EAAE;IACJ,SAAS,EAAE,eAAe,CAAC;IAC3B,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC,SAAS,OAAO,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC;IACrE;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qGAAqG;IACrG,GAAG,EAAE,MAAM,MAAM,CAAC;CACnB,GACA,IAAI,CAaN"}
|
package/dist/spine-restore.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { SPINE_PREFIX, namesSpineTable, substratError } from '@substrat-run/contracts';
|
|
2
2
|
import { MIGRATION_DIGEST_LEGACY } from './migration-digest.js';
|
|
3
|
-
import { SCHEDULE_STATE_KIND_OF_OP } from './
|
|
3
|
+
import { SCHEDULE_STATE_KIND_OF_OP } from './schedule-state.js';
|
|
4
4
|
import { isSearchIndexTable } from './search-index.js';
|
|
5
5
|
import { SWITCH_KINDS, dumpCarriesSwitches, switchesBackfillSqlOf } from './system-switch-record.js';
|
|
6
6
|
import { dumpCarriesMembershipFences, membershipFencesBackfillSql } from './membership-fence.js';
|
|
7
|
+
import { mapLegacyStoreDriverDump } from './store-driver-releases.js';
|
|
7
8
|
/**
|
|
8
9
|
* How a restore, fork or carry loads a dump's `_substrat_*` spine tables (#1883). One
|
|
9
10
|
* definition for both adapters' loaders, so the DO and the pure host build the same tables
|
|
@@ -197,6 +198,8 @@ function assertWithinColumnCap(tables, columnsOf, max) {
|
|
|
197
198
|
* (#1912): the one sequence both adapters' directory restores run, inside their transaction,
|
|
198
199
|
* after dropping the old directory and running the schema pass.
|
|
199
200
|
*
|
|
201
|
+
* 0. map a pre-rename copy's `store_kind_*` tables and `kind` columns onto the driver names
|
|
202
|
+
* (`mapLegacyStoreDriverDump`);
|
|
200
203
|
* 1. refuse a table the directory does not build (`assertDirectoryTablesBuilt`), and one that
|
|
201
204
|
* would pass `maxColumns` once the dump's unknown columns join this code's own;
|
|
202
205
|
* 2. add each column the dump carries and this code does not know, bare and lowercased, and
|
|
@@ -213,6 +216,8 @@ function assertWithinColumnCap(tables, columnsOf, max) {
|
|
|
213
216
|
* A throw anywhere is the caller's transaction rolling back, so the directory keeps what it held.
|
|
214
217
|
*/
|
|
215
218
|
export function loadDirectoryDump(tables, host) {
|
|
219
|
+
// A copy from before the store driver rename names its tables and key column the old way.
|
|
220
|
+
tables = mapLegacyStoreDriverDump(tables);
|
|
216
221
|
assertDirectoryTablesBuilt(tables.map((t) => t.name), host.columnsOf);
|
|
217
222
|
if (host.maxColumns !== undefined)
|
|
218
223
|
assertWithinColumnCap(tables, host.columnsOf, host.maxColumns);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spine-restore.js","sourceRoot":"","sources":["../src/spine-restore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,kB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,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IACzF,CAAC;IACD,KAAK,MAAM,IAAI,IAAI,0BAA0B;QAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/D,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACxC,KAAK,MAAM,IAAI,IAAI,YAAY;QAAE,IAAI,CAAC,mBAAmB,CAAC,KAAK,EAAE,IAAI,CAAC;YAAE,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC;IAC/G,IAAI,CAAC,2BAA2B,CAAC,KAAK,CAAC;QAAE,IAAI,CAAC,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AAC9F,CAAC"}
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
import type { SwitchSql } from './system-switch.js';
|
|
2
|
+
/** Interpolated into both adapters' directory DDL, so `lint:spine-ddl` sees one spelling on each side. */
|
|
3
|
+
export declare const STORE_DRIVER_RELEASES_DDL = "\n CREATE TABLE IF NOT EXISTS store_driver_releases (\n driver TEXT NOT NULL,\n sha256 TEXT NOT NULL,\n source_commit TEXT NOT NULL,\n uploaded_by TEXT NOT NULL,\n uploaded_at TEXT NOT NULL,\n PRIMARY KEY (driver, sha256)\n );\n CREATE TABLE IF NOT EXISTS store_driver_rollouts (\n driver TEXT NOT NULL,\n seq INTEGER NOT NULL,\n sha256 TEXT NOT NULL,\n action TEXT NOT NULL,\n from_sha256 TEXT,\n previous_good_sha256 TEXT,\n state TEXT NOT NULL,\n actor TEXT NOT NULL,\n -- The hold the rollout runs under: a rolling row whose holder holds nothing has stopped.\n holder TEXT NOT NULL,\n started_at TEXT NOT NULL,\n ended_at TEXT,\n detail TEXT,\n PRIMARY KEY (driver, seq)\n );\n CREATE TABLE IF NOT EXISTS store_driver_current (\n driver TEXT PRIMARY KEY,\n sha256 TEXT NOT NULL,\n seq INTEGER NOT NULL\n );\n -- One declaration an attempt walked (#2312). The attempt is the seq of its first row; a row\n -- continues it while the rows before it are paused at the same release and action.\n CREATE TABLE IF NOT EXISTS store_driver_rollout_walks (\n driver TEXT NOT NULL,\n attempt INTEGER NOT NULL,\n vertical_slug TEXT NOT NULL,\n binding TEXT NOT NULL,\n first_version_id TEXT NOT NULL,\n PRIMARY KEY (driver, attempt, vertical_slug, binding, first_version_id)\n );\n CREATE TABLE IF NOT EXISTS store_driver_holds (\n driver TEXT NOT NULL,\n holder TEXT NOT NULL,\n mode TEXT NOT NULL,\n expires_at INTEGER NOT NULL,\n PRIMARY KEY (driver, holder)\n );\n CREATE TABLE IF NOT EXISTS store_driver_rebuilds (\n driver TEXT PRIMARY KEY,\n fingerprint TEXT NOT NULL,\n -- When this fingerprint was first walked towards: a restart keeps it, a new fingerprint resets it.\n fingerprint_since TEXT NOT NULL,\n cursor TEXT,\n failures TEXT NOT NULL,\n state TEXT NOT NULL,\n holder TEXT,\n lease_expires_at INTEGER NOT NULL,\n -- When this walk began from its first script: a restart or a new fingerprint sets it, a pass\n -- that continues the walk keeps it.\n started_at TEXT NOT NULL,\n -- The person who attested, when this walk began, that no control-plane deploy was rolling out.\n attested_by TEXT,\n -- When a walk towards this fingerprint last proved every script current; kept across a\n -- restart at the same fingerprint, cleared by a new one.\n verified_at TEXT,\n updated_at TEXT NOT NULL,\n finished_at TEXT\n );\n";
|
|
4
|
+
/**
|
|
5
|
+
* The statements that move a directory built before the rename onto its names, to run before
|
|
6
|
+
* the directory's DDL on every start: that DDL is all `IF NOT EXISTS`, so it would leave an old
|
|
7
|
+
* table as it is and create an empty one beside it. Renames keep every row, a release uploaded
|
|
8
|
+
* before its pin included. Empty once moved, so a later start does nothing.
|
|
9
|
+
*
|
|
10
|
+
* A directory can hold both names: code from before the rename, run again after it (a rollback),
|
|
11
|
+
* creates the old tables empty beside the moved ones, and writes to them while it runs. Then the
|
|
12
|
+
* name that holds no rows is dropped, and the one that holds them ends under the new name. When
|
|
13
|
+
* both hold rows, both are left where they are: nothing is merged, and nothing with rows is
|
|
14
|
+
* dropped.
|
|
15
|
+
*
|
|
16
|
+
* `tables` is every table the directory holds; `columnsOf` answers a table's columns, and
|
|
17
|
+
* `hasRows` whether it holds any.
|
|
18
|
+
*/
|
|
19
|
+
export declare function legacyStoreDriverRenames(tables: readonly string[], columnsOf: (table: string) => readonly string[] | undefined, hasRows: (table: string) => boolean): string[];
|
|
20
|
+
/**
|
|
21
|
+
* The tables that hold rows under both names, which {@link legacyStoreDriverRenames} leaves
|
|
22
|
+
* alone, as one line a start logs: until one is cleared, a directory dump carries both and a
|
|
23
|
+
* restore of it is refused. Undefined when there are none. Reachable only after a rollback to
|
|
24
|
+
* pre-rename code that wrote a release, rollout or hold, which no registered driver allowed yet.
|
|
25
|
+
*/
|
|
26
|
+
export declare function legacyStoreDriverConflict(tables: readonly string[], hasRows: (table: string) => boolean): string | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* A directory dump's tables with the pre-rename names mapped onto this code's (see
|
|
29
|
+
* {@link legacyStoreDriverRenames}), so a copy taken before the rename restores: the dump's rows
|
|
30
|
+
* go in by name, and a restore refuses a table it does not build. A dump that carries a table
|
|
31
|
+
* under both names keeps the one that holds rows, the way a start does; one where both hold rows
|
|
32
|
+
* is refused, since loading both would merge two histories.
|
|
33
|
+
*/
|
|
34
|
+
export declare function mapLegacyStoreDriverDump<T extends {
|
|
35
|
+
readonly name: string;
|
|
36
|
+
readonly columns: readonly string[];
|
|
37
|
+
readonly rows: readonly unknown[];
|
|
38
|
+
}>(tables: readonly T[]): T[];
|
|
39
|
+
/** A stored release: its bytes are kept elsewhere under `<driver>/<sha256>`. */
|
|
40
|
+
export interface StoreDriverReleaseRecord {
|
|
41
|
+
readonly driver: string;
|
|
42
|
+
readonly sha256: string;
|
|
43
|
+
readonly sourceCommit: string;
|
|
44
|
+
readonly uploadedBy: string;
|
|
45
|
+
readonly uploadedAt: string;
|
|
46
|
+
}
|
|
47
|
+
export type StoreDriverRolloutAction = 'rollout' | 'rollback';
|
|
48
|
+
/**
|
|
49
|
+
* `paused`: the request's batch ran out with verticals left to walk. Nothing failed; the fleet is
|
|
50
|
+
* part way, and posting the same rollout (or the same rollback) again continues it.
|
|
51
|
+
*/
|
|
52
|
+
export type StoreDriverRolloutState = 'rolling' | 'good' | 'failed' | 'diverged' | 'paused';
|
|
53
|
+
export interface StoreDriverRolloutRecord {
|
|
54
|
+
readonly driver: string;
|
|
55
|
+
readonly seq: number;
|
|
56
|
+
readonly sha256: string;
|
|
57
|
+
readonly action: StoreDriverRolloutAction;
|
|
58
|
+
/** The current good release when the rollout began; null for a driver's first. */
|
|
59
|
+
readonly fromSha256: string | null;
|
|
60
|
+
/** Where a rollback from this release, once it is good, returns to; null when nowhere. */
|
|
61
|
+
readonly previousGoodSha256: string | null;
|
|
62
|
+
readonly state: StoreDriverRolloutState;
|
|
63
|
+
readonly actor: string;
|
|
64
|
+
readonly startedAt: string;
|
|
65
|
+
readonly endedAt: string | null;
|
|
66
|
+
readonly detail: string | null;
|
|
67
|
+
}
|
|
68
|
+
export interface StoreDriverState {
|
|
69
|
+
/** The release the last good rollout reached, and that rollout. Null before any. */
|
|
70
|
+
readonly current: {
|
|
71
|
+
readonly sha256: string;
|
|
72
|
+
readonly seq: number;
|
|
73
|
+
readonly previousGoodSha256: string | null;
|
|
74
|
+
} | null;
|
|
75
|
+
/** Every rollout, oldest first. */
|
|
76
|
+
readonly rollouts: StoreDriverRolloutRecord[];
|
|
77
|
+
/** Where a rollback goes now (see `storeDriverStateIn`); null when nowhere. */
|
|
78
|
+
readonly rollbackTarget: string | null;
|
|
79
|
+
/** The target of a rollback that paused or diverged part way, until it ends good. Unless it is the current release, it blocks rollouts. */
|
|
80
|
+
readonly unfinishedRollback: string | null;
|
|
81
|
+
}
|
|
82
|
+
export type StoreDriverHoldMode = 'shared' | 'exclusive';
|
|
83
|
+
/** A stored release, or undefined. */
|
|
84
|
+
export declare function storeDriverReleaseIn(db: SwitchSql, driver: string, sha256: string): StoreDriverReleaseRecord | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* Record that a release's bytes are stored. The same sha256 again is the same release, and the
|
|
87
|
+
* row already written is returned as it stands (`created: false`). The same sha256 from another
|
|
88
|
+
* commit is refused (`conflict`): one bundle has one source the reviewer reads.
|
|
89
|
+
*/
|
|
90
|
+
export declare function recordStoreDriverReleaseIn(db: SwitchSql, input: {
|
|
91
|
+
driver: string;
|
|
92
|
+
sha256: string;
|
|
93
|
+
sourceCommit: string;
|
|
94
|
+
actor: string;
|
|
95
|
+
at: string;
|
|
96
|
+
}): {
|
|
97
|
+
record: StoreDriverReleaseRecord;
|
|
98
|
+
created: boolean;
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* The driver's current release, every rollout, and where a rollback goes now.
|
|
102
|
+
*
|
|
103
|
+
* With `nowMs`, a `rolling` row whose holder no longer holds the driver exclusively is reported as
|
|
104
|
+
* `diverged` (read-time only, nothing is written): its holder stopped, and its scripts may be on
|
|
105
|
+
* either release. The next rollout's begin writes that state.
|
|
106
|
+
*
|
|
107
|
+
* `rollbackTarget` is, in order:
|
|
108
|
+
* - the target of a rollback that is the newest attempt since the current release, a `failed` one
|
|
109
|
+
* aside, and ended `paused` or `diverged` (`unfinishedRollback`): posting the rollback again
|
|
110
|
+
* continues it, and never turns it around onto the release it is leaving. A `failed` request
|
|
111
|
+
* changes nothing here: it moved nothing, or returned what its attempt moved, or (a later page's
|
|
112
|
+
* canary) moved nothing in its own request while earlier pages' verticals stay on the new
|
|
113
|
+
* release; those pages' `paused` rows are still since the current release, so the fleet still
|
|
114
|
+
* reads as mixed below. No rollout may begin while a
|
|
115
|
+
* rollback to an earlier release is unfinished, `paused` or `diverged` (`beginStoreDriverRolloutIn`):
|
|
116
|
+
* it is finished first, by posting it again. A rollback onto the current release (undoing a
|
|
117
|
+
* diverged rollout) does not block a rollout. A rollback to an earlier release cannot meet the
|
|
118
|
+
* schema rule (the route refuses one below the current schema), but one onto the current release
|
|
119
|
+
* can, and then it never finishes, so going forward must stay open;
|
|
120
|
+
* - the current release itself, when a rollout since it ended `diverged` or `paused` on ANOTHER
|
|
121
|
+
* release: the fleet may be mixed, and undoing that rollout means converging every script back
|
|
122
|
+
* on the release it was healthy on, never going past it. A row that moves scripts to the current
|
|
123
|
+
* release itself (a re-post of it, paged over several requests, or a rollback onto it) leaves
|
|
124
|
+
* every script on the current release whatever it ended, so it never makes the fleet mixed:
|
|
125
|
+
* otherwise re-posting the current release past one request's walk would turn the rollback
|
|
126
|
+
* onto the release being escaped (#2312);
|
|
127
|
+
* - otherwise the immediately previous good release.
|
|
128
|
+
* An unfinished attempt never changes what "previous good" means.
|
|
129
|
+
*/
|
|
130
|
+
export declare function storeDriverStateIn(db: SwitchSql, driver: string, nowMs?: number): StoreDriverState;
|
|
131
|
+
/**
|
|
132
|
+
* Take, or renew, a hold on a driver. Answers false when another holder's live hold excludes it: an
|
|
133
|
+
* exclusive one for any request, or any one for an exclusive request. A lapsed hold is dropped
|
|
134
|
+
* first. Asking in the other mode than the one held is refused.
|
|
135
|
+
*
|
|
136
|
+
* `renew` only extends a hold the holder still holds: a holder whose lease lapsed gets false, even
|
|
137
|
+
* when nobody took the driver since, because a lapsed holder cannot know what happened meanwhile.
|
|
138
|
+
* With `rolloutSeq` it also answers false unless that rollout is still `rolling`, so a rollout
|
|
139
|
+
* whose row another holder ended stops instead of moving scripts the state no longer describes.
|
|
140
|
+
*/
|
|
141
|
+
export declare function holdStoreDriverIn(db: SwitchSql, input: {
|
|
142
|
+
driver: string;
|
|
143
|
+
holder: string;
|
|
144
|
+
mode: StoreDriverHoldMode;
|
|
145
|
+
nowMs: number;
|
|
146
|
+
ttlMs: number;
|
|
147
|
+
renew?: boolean;
|
|
148
|
+
rolloutSeq?: number;
|
|
149
|
+
}): boolean;
|
|
150
|
+
/** Drop a hold. Dropping one already gone is not an error. */
|
|
151
|
+
export declare function releaseStoreDriverHoldIn(db: SwitchSql, input: {
|
|
152
|
+
driver: string;
|
|
153
|
+
holder: string;
|
|
154
|
+
}): void;
|
|
155
|
+
/**
|
|
156
|
+
* Begin a rollout or a rollback of a stored release, as the exclusive holder. A rollout left
|
|
157
|
+
* `rolling` by an earlier holder ends `diverged` here: its scripts may be on either release, and
|
|
158
|
+
* this rollout reaches all of them. A rollback must name the current release's previous good one.
|
|
159
|
+
*/
|
|
160
|
+
export declare function beginStoreDriverRolloutIn(db: SwitchSql, input: {
|
|
161
|
+
driver: string;
|
|
162
|
+
sha256: string;
|
|
163
|
+
action: StoreDriverRolloutAction;
|
|
164
|
+
holder: string;
|
|
165
|
+
actor: string;
|
|
166
|
+
at: string;
|
|
167
|
+
nowMs: number;
|
|
168
|
+
}): StoreDriverRolloutRecord;
|
|
169
|
+
/**
|
|
170
|
+
* End a rollout the caller began, as the exclusive holder. A good one makes its release current.
|
|
171
|
+
*
|
|
172
|
+
* `walked` is what this request walked, and only a `paused` end takes it (#2312): it joins the
|
|
173
|
+
* attempt's ledger in the transaction that writes the state, so a request that stops before its
|
|
174
|
+
* end leaves no ledger rows, and the next attempt walks those verticals again rather than skip
|
|
175
|
+
* them. What keeps a dead ledger unread is the attempt key (`attemptOf`); the deletes here keep the
|
|
176
|
+
* table to the one attempt a driver can continue: any end drops every other attempt's rows, and any
|
|
177
|
+
* end but `paused` this attempt's too.
|
|
178
|
+
*/
|
|
179
|
+
export declare function finishStoreDriverRolloutIn(db: SwitchSql, input: {
|
|
180
|
+
driver: string;
|
|
181
|
+
seq: number;
|
|
182
|
+
holder: string;
|
|
183
|
+
state: Exclude<StoreDriverRolloutState, 'rolling'>;
|
|
184
|
+
detail: string | null;
|
|
185
|
+
walked?: readonly StoreDriverRolloutTarget[];
|
|
186
|
+
at: string;
|
|
187
|
+
nowMs: number;
|
|
188
|
+
}): StoreDriverRolloutRecord;
|
|
189
|
+
/** One vertical (or the driver's canary) the fleet rebuild could not rebuild, and why. */
|
|
190
|
+
export interface StoreDriverRebuildFailure {
|
|
191
|
+
readonly vertical: string;
|
|
192
|
+
readonly detail: string;
|
|
193
|
+
}
|
|
194
|
+
/** Where the platform's rebuild of every script of a driver stands (#2309). */
|
|
195
|
+
export interface StoreDriverRebuildRecord {
|
|
196
|
+
readonly driver: string;
|
|
197
|
+
/** What the platform builds every script from, as the walk converges every script on it. */
|
|
198
|
+
readonly fingerprint: string;
|
|
199
|
+
/** When a walk towards this fingerprint first began: about when the control plane building from it was deployed. */
|
|
200
|
+
readonly fingerprintSince: string;
|
|
201
|
+
/** The last vertical the walk reached, in slug order; null before the first. */
|
|
202
|
+
readonly cursor: string | null;
|
|
203
|
+
/** The verticals walked and not rebuilt. Retried on every pass until each is, or no longer declares the driver. */
|
|
204
|
+
readonly failures: readonly StoreDriverRebuildFailure[];
|
|
205
|
+
/** `done`: every vertical was walked and none failed. */
|
|
206
|
+
readonly state: 'running' | 'done';
|
|
207
|
+
/** When this walk began from its first script. */
|
|
208
|
+
readonly startedAt: string;
|
|
209
|
+
/** The person who attested, when this walk began, that no control-plane deploy was rolling out. */
|
|
210
|
+
readonly attestedBy: string | null;
|
|
211
|
+
/** When a walk towards this fingerprint last proved every script current; null before any. */
|
|
212
|
+
readonly verifiedAt: string | null;
|
|
213
|
+
readonly updatedAt: string;
|
|
214
|
+
readonly finishedAt: string | null;
|
|
215
|
+
}
|
|
216
|
+
/** The driver's fleet rebuild, or undefined before its first. */
|
|
217
|
+
export declare function storeDriverRebuildIn(db: SwitchSql, driver: string): StoreDriverRebuildRecord | undefined;
|
|
218
|
+
/**
|
|
219
|
+
* Take the lease on a driver's fleet rebuild, towards `fingerprint`, for `ttlMs`. Answers the
|
|
220
|
+
* rebuild as it stands, or null while another holder's lease is live. A rebuild towards another
|
|
221
|
+
* fingerprint (or none yet) starts over: no vertical is walked and none has failed, because every
|
|
222
|
+
* script may have been built from something else than what the platform builds from now. With
|
|
223
|
+
* `restart`, a rebuild already `done` at this fingerprint starts over too (a re-verification: a
|
|
224
|
+
* script uploaded since by a control plane still building from older inputs is found and rebuilt).
|
|
225
|
+
* With `attestedBy` (a person attesting no control-plane deploy is rolling out), the rebuild starts
|
|
226
|
+
* over and the new walk carries the attestation, unless a walk this attestation (any person's, at
|
|
227
|
+
* this fingerprint) already started is under way: that walk is continued, so repeating an attested
|
|
228
|
+
* run finishes a fleet larger than one run. Any other start clears it.
|
|
229
|
+
*/
|
|
230
|
+
export declare function claimStoreDriverRebuildIn(db: SwitchSql, input: {
|
|
231
|
+
driver: string;
|
|
232
|
+
fingerprint: string;
|
|
233
|
+
holder: string;
|
|
234
|
+
nowMs: number;
|
|
235
|
+
ttlMs: number;
|
|
236
|
+
at: string;
|
|
237
|
+
restart?: boolean;
|
|
238
|
+
attestedBy?: string;
|
|
239
|
+
}): StoreDriverRebuildRecord | null;
|
|
240
|
+
/**
|
|
241
|
+
* Record how far the lease holder's walk got, renewing the lease for `ttlMs`, or with `release`
|
|
242
|
+
* dropping it. `done` ends the rebuild; it needs no failure left. Refused (`conflict`) unless the
|
|
243
|
+
* caller is still the row's holder, towards `fingerprint`: once another pass claimed the row (a
|
|
244
|
+
* lapsed lease) or restarted it (a new fingerprint), the old holder writes nothing. A holder whose
|
|
245
|
+
* lease lapsed while nobody claimed the row still records what it did, which is then true. With
|
|
246
|
+
* `verified` (only with `done`), the walk proved every script current, and `verifiedAt` is set.
|
|
247
|
+
*/
|
|
248
|
+
export declare function advanceStoreDriverRebuildIn(db: SwitchSql, input: {
|
|
249
|
+
driver: string;
|
|
250
|
+
fingerprint: string;
|
|
251
|
+
holder: string;
|
|
252
|
+
cursor: string | null;
|
|
253
|
+
failures: readonly StoreDriverRebuildFailure[];
|
|
254
|
+
done: boolean;
|
|
255
|
+
verified?: boolean;
|
|
256
|
+
nowMs: number;
|
|
257
|
+
ttlMs: number;
|
|
258
|
+
release?: boolean;
|
|
259
|
+
at: string;
|
|
260
|
+
}): StoreDriverRebuildRecord;
|
|
261
|
+
/**
|
|
262
|
+
* One vertical's bindings of a driver as a rollout walks them (#2312). `firstVersionId` is the
|
|
263
|
+
* version that first declared the binding: a vertical deleted and registered again under the
|
|
264
|
+
* same slug declares it anew, under another id, so the ledger never counts the new one walked.
|
|
265
|
+
*/
|
|
266
|
+
export interface StoreDriverRolloutTarget {
|
|
267
|
+
readonly vertical: string;
|
|
268
|
+
readonly stores: readonly {
|
|
269
|
+
readonly binding: string;
|
|
270
|
+
readonly firstVersionId: string;
|
|
271
|
+
}[];
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* What the next request of a rollout of `sha256` (or a rollback to it) walks (#2312): the first
|
|
275
|
+
* `limit` verticals, in (vertical, binding) order, with a declaration of the driver that the attempt
|
|
276
|
+
* it would continue has not walked, and how many verticals are pending in all. Asked before the
|
|
277
|
+
* request's row begins, as the exclusive holder will begin it: a request that continues no attempt
|
|
278
|
+
* walks every declaration. `walked` counts the verticals the continued attempt walked that still
|
|
279
|
+
* declare the driver. `unreadable` is `driverDeclarationsOf`'s: a caller that must reach every script
|
|
280
|
+
* refuses while it is not empty.
|
|
281
|
+
*/
|
|
282
|
+
export declare function storeDriverRolloutPendingIn(db: SwitchSql, input: {
|
|
283
|
+
driver: string;
|
|
284
|
+
sha256: string;
|
|
285
|
+
action: StoreDriverRolloutAction;
|
|
286
|
+
limit: number;
|
|
287
|
+
}): {
|
|
288
|
+
verticals: StoreDriverRolloutTarget[];
|
|
289
|
+
pending: number;
|
|
290
|
+
walked: number;
|
|
291
|
+
unreadable: string[];
|
|
292
|
+
};
|
|
293
|
+
/**
|
|
294
|
+
* What the attempt of the rollout at `seq` walked in its EARLIER requests and still declares the
|
|
295
|
+
* driver, in (vertical, binding) order: the verticals a failure part way returns, besides the ones
|
|
296
|
+
* its own request reached (#2312). At most `limit`, and `walked` counts them all.
|
|
297
|
+
*/
|
|
298
|
+
export declare function storeDriverRolloutWalkedIn(db: SwitchSql, input: {
|
|
299
|
+
driver: string;
|
|
300
|
+
seq: number;
|
|
301
|
+
limit: number;
|
|
302
|
+
}): {
|
|
303
|
+
verticals: StoreDriverRolloutTarget[];
|
|
304
|
+
walked: number;
|
|
305
|
+
};
|
|
306
|
+
//# sourceMappingURL=store-driver-releases.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store-driver-releases.d.ts","sourceRoot":"","sources":["../src/store-driver-releases.ts"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGpD,0GAA0G;AAC1G,eAAO,MAAM,yBAAyB,6uFAoErC,CAAC;AAeF;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,SAAS,MAAM,EAAE,GAAG,SAAS,EAC3D,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,GAClC,MAAM,EAAE,CAyBV;AAOD;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,GAAG,MAAM,GAAG,SAAS,CAW5H;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,CAAC,SAAS;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,OAAO,EAAE,CAAA;CAAE,EAC3G,MAAM,EAAE,SAAS,CAAC,EAAE,GAAG,CAAC,EAAE,CAwB3B;AAED,gFAAgF;AAChF,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,EAAE,MAAM,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