@serfab/cadre-core 1.22.0 → 1.24.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/README.md +216 -294
- package/dist/arachnode-stub.d.ts +12 -4
- package/dist/arachnode-stub.js +15 -8
- package/dist/arachnode-stub.js.map +1 -1
- package/dist/cadre-invite-protocol.js +5 -4
- package/dist/cadre-invite-protocol.js.map +1 -1
- package/dist/cadre-node.d.ts +159 -53
- package/dist/cadre-node.js +276 -89
- package/dist/cadre-node.js.map +1 -1
- package/dist/control-authorization.d.ts +14 -2
- package/dist/control-authorization.js +8 -3
- package/dist/control-authorization.js.map +1 -1
- package/dist/control-cohort.d.ts +27 -13
- package/dist/control-cohort.js +21 -14
- package/dist/control-cohort.js.map +1 -1
- package/dist/control-database.d.ts +18 -16
- package/dist/control-database.js +57 -22
- package/dist/control-database.js.map +1 -1
- package/dist/control-protocol-guard.d.ts +1 -1
- package/dist/control-protocol-guard.js +7 -3
- package/dist/control-protocol-guard.js.map +1 -1
- package/dist/control-read-retry.d.ts +49 -11
- package/dist/control-read-retry.js +56 -15
- package/dist/control-read-retry.js.map +1 -1
- package/dist/control-retry.d.ts +32 -3
- package/dist/control-retry.js +35 -4
- package/dist/control-retry.js.map +1 -1
- package/dist/control-schema-version.d.ts +5 -5
- package/dist/control-schema-version.js +5 -5
- package/dist/control-schema-version.js.map +1 -1
- package/dist/control-schema.d.ts +5 -5
- package/dist/control-schema.js +1032 -1011
- package/dist/control-schema.js.map +1 -1
- package/dist/control-write-retry.d.ts +54 -65
- package/dist/control-write-retry.js +134 -158
- package/dist/control-write-retry.js.map +1 -1
- package/dist/delegate-admission.d.ts +1 -1
- package/dist/delegate-admission.js +1 -1
- package/dist/edge-node/config.d.ts +4 -3
- package/dist/edge-node/config.js +11 -9
- package/dist/edge-node/config.js.map +1 -1
- package/dist/edge-node/dissolve.d.ts +4 -4
- package/dist/edge-node/dissolve.js +4 -4
- package/dist/edge-node/edge-join.d.ts +1 -1
- package/dist/edge-node/edge-join.js +1 -1
- package/dist/edge-node/edge-node.js +2 -2
- package/dist/edge-node/edge-node.js.map +1 -1
- package/dist/edge-node/index.d.ts +1 -0
- package/dist/edge-node/index.js +1 -0
- package/dist/edge-node/index.js.map +1 -1
- package/dist/edge-node/join-credential.d.ts +1 -1
- package/dist/edge-node/join-credential.js +1 -1
- package/dist/edge-node/lazy-raw-storage.js +12 -0
- package/dist/edge-node/lazy-raw-storage.js.map +1 -1
- package/dist/edge-node/listen-addrs.d.ts +21 -0
- package/dist/edge-node/listen-addrs.js +25 -0
- package/dist/edge-node/listen-addrs.js.map +1 -0
- package/dist/edge-node/owner-grant.d.ts +1 -1
- package/dist/edge-node/owner-grant.js +1 -1
- package/dist/edge-node/platform.d.ts +5 -4
- package/dist/edge-node/platform.js.map +1 -1
- package/dist/edge-node/strand-move.d.ts +1 -1
- package/dist/edge-node/strand-move.js +1 -1
- package/dist/edge-node/strands.js +27 -11
- package/dist/edge-node/strands.js.map +1 -1
- package/dist/index.d.ts +7 -5
- package/dist/index.js +18 -7
- package/dist/index.js.map +1 -1
- package/dist/invitation-bootstrap.d.ts +28 -5
- package/dist/invitation-bootstrap.js +41 -8
- package/dist/invitation-bootstrap.js.map +1 -1
- package/dist/link-budget.d.ts +53 -4
- package/dist/link-budget.js +58 -5
- package/dist/link-budget.js.map +1 -1
- package/dist/machine-removal.d.ts +2 -2
- package/dist/machine-removal.js +4 -3
- package/dist/machine-removal.js.map +1 -1
- package/dist/membership-connection-gater.d.ts +2 -2
- package/dist/membership-connection-gater.js +2 -2
- package/dist/membership-view.d.ts +2 -2
- package/dist/membership-view.js +6 -3
- package/dist/membership-view.js.map +1 -1
- package/dist/node-claim-payload.d.ts +15 -7
- package/dist/node-claim-payload.js +25 -9
- package/dist/node-claim-payload.js.map +1 -1
- package/dist/node-class.d.ts +36 -0
- package/dist/node-class.js +26 -0
- package/dist/node-class.js.map +1 -0
- package/dist/node-default-transports.d.ts +50 -3
- package/dist/node-default-transports.js +48 -3
- package/dist/node-default-transports.js.map +1 -1
- package/dist/node-roles.d.ts +118 -0
- package/dist/node-roles.js +142 -0
- package/dist/node-roles.js.map +1 -0
- package/dist/node-transports.d.ts +6 -2
- package/dist/node-transports.js +39 -7
- package/dist/node-transports.js.map +1 -1
- package/dist/owner-anchor-sync.js +1 -1
- package/dist/owner-key-export.js +1 -1
- package/dist/owner-key-flows.d.ts +1 -1
- package/dist/owner-key-store.js +1 -1
- package/dist/owner-signer.js +1 -1
- package/dist/peer-authorization.d.ts +3 -1
- package/dist/peer-authorization.js +3 -1
- package/dist/peer-authorization.js.map +1 -1
- package/dist/peer-dial.d.ts +74 -10
- package/dist/peer-dial.js +89 -17
- package/dist/peer-dial.js.map +1 -1
- package/dist/peer-join-backfill.js +4 -4
- package/dist/peer-join-backfill.js.map +1 -1
- package/dist/peer-record.d.ts +34 -9
- package/dist/peer-record.js +66 -13
- package/dist/peer-record.js.map +1 -1
- package/dist/pending-join-runner.d.ts +1 -1
- package/dist/pending-join-runner.js +1 -1
- package/dist/provider/client.d.ts +6 -5
- package/dist/provider/client.js +3 -3
- package/dist/provider/client.js.map +1 -1
- package/dist/provider/descriptor.d.ts +1 -1
- package/dist/provider/descriptor.js +1 -1
- package/dist/provider/oauth.d.ts +1 -1
- package/dist/provider/oauth.js +1 -1
- package/dist/provider/rent-node.d.ts +4 -3
- package/dist/provider/rent-node.js +3 -3
- package/dist/provider/rent-node.js.map +1 -1
- package/dist/relay-addrs.d.ts +62 -7
- package/dist/relay-addrs.js +74 -11
- package/dist/relay-addrs.js.map +1 -1
- package/dist/relay-reservation.d.ts +1 -1
- package/dist/relay-reservation.js +1 -1
- package/dist/relay-server.d.ts +6 -5
- package/dist/relay-server.js +5 -5
- package/dist/relay-server.js.map +1 -1
- package/dist/schema-verification.d.ts +13 -10
- package/dist/schema-verification.js +32 -24
- package/dist/schema-verification.js.map +1 -1
- package/dist/sealed-party-key.js +1 -1
- package/dist/seed-bootstrap.d.ts +4 -3
- package/dist/seed-bootstrap.js +6 -7
- package/dist/seed-bootstrap.js.map +1 -1
- package/dist/strand-addr-protocol.d.ts +8 -6
- package/dist/strand-addr-protocol.js +12 -10
- package/dist/strand-addr-protocol.js.map +1 -1
- package/dist/strand-app-schema-report.d.ts +16 -2
- package/dist/strand-app-schema-report.js +15 -0
- package/dist/strand-app-schema-report.js.map +1 -1
- package/dist/strand-cohort.d.ts +1 -4
- package/dist/strand-cohort.js.map +1 -1
- package/dist/strand-commit-durability.d.ts +1 -1
- package/dist/strand-database.d.ts +13 -6
- package/dist/strand-database.js +17 -9
- package/dist/strand-database.js.map +1 -1
- package/dist/strand-first-sync-gate.d.ts +3 -2
- package/dist/strand-first-sync-gate.js +3 -2
- package/dist/strand-first-sync-gate.js.map +1 -1
- package/dist/strand-formation-deadlines.d.ts +2 -2
- package/dist/strand-formation-deadlines.js +2 -2
- package/dist/strand-formation-protocol.d.ts +1 -1
- package/dist/strand-formation-protocol.js +51 -16
- package/dist/strand-formation-protocol.js.map +1 -1
- package/dist/strand-instance-manager.d.ts +134 -42
- package/dist/strand-instance-manager.js +331 -76
- package/dist/strand-instance-manager.js.map +1 -1
- package/dist/strand-membership-reconciler.d.ts +8 -3
- package/dist/strand-membership-reconciler.js +8 -3
- package/dist/strand-membership-reconciler.js.map +1 -1
- package/dist/strand-membership-writer.d.ts +2 -2
- package/dist/strand-membership-writer.js +41 -39
- package/dist/strand-membership-writer.js.map +1 -1
- package/dist/strand-move.js +1 -1
- package/dist/strand-network-config.d.ts +15 -5
- package/dist/strand-network-config.js +7 -6
- package/dist/strand-network-config.js.map +1 -1
- package/dist/strand-party-key-rotation.d.ts +7 -3
- package/dist/strand-party-key-rotation.js +7 -3
- package/dist/strand-party-key-rotation.js.map +1 -1
- package/dist/strand-party-machines.d.ts +19 -8
- package/dist/strand-party-machines.js +26 -11
- package/dist/strand-party-machines.js.map +1 -1
- package/dist/strand-party-peers.d.ts +36 -14
- package/dist/strand-party-peers.js +24 -15
- package/dist/strand-party-peers.js.map +1 -1
- package/dist/strand-peer-redial.d.ts +1 -1
- package/dist/strand-peer-redial.js +1 -1
- package/dist/strand-reactivity.d.ts +20 -17
- package/dist/strand-reactivity.js +31 -18
- package/dist/strand-reactivity.js.map +1 -1
- package/dist/strand-revocation-enforcer.d.ts +3 -3
- package/dist/strand-revocation-enforcer.js +3 -3
- package/dist/strand-wake-protocol.d.ts +19 -7
- package/dist/strand-wake-protocol.js +22 -10
- package/dist/strand-wake-protocol.js.map +1 -1
- package/dist/strand-watcher.d.ts +1 -1
- package/dist/strand-watcher.js +1 -1
- package/dist/table-change-watch.js +1 -1
- package/dist/types.d.ts +127 -57
- package/dist/types.js.map +1 -1
- package/dist/webrtc-upgrade.d.ts +254 -0
- package/dist/webrtc-upgrade.js +355 -0
- package/dist/webrtc-upgrade.js.map +1 -0
- package/package.json +9 -9
- package/src/announce-addrs.ts +93 -93
- package/src/arachnode-stub.ts +18 -10
- package/src/bootstrap-peer-store-file.ts +44 -44
- package/src/bootstrap-peer-store.ts +214 -214
- package/src/cadre-invite-protocol.ts +741 -740
- package/src/cadre-node.ts +12462 -12252
- package/src/claim-proof.ts +147 -147
- package/src/control-authorization.ts +290 -276
- package/src/control-cohort.ts +223 -204
- package/src/control-database.ts +72 -28
- package/src/control-formation-recorder.ts +359 -359
- package/src/control-protocol-guard.ts +370 -366
- package/src/control-read-retry.ts +222 -180
- package/src/control-retry.ts +36 -4
- package/src/control-schema-version.ts +301 -301
- package/src/control-schema.ts +1108 -1087
- package/src/control-write-retry.ts +639 -669
- package/src/delegate-admission.ts +351 -351
- package/src/describe-thrown.ts +60 -60
- package/src/ed25519-key.ts +185 -185
- package/src/edge-node/config.ts +13 -10
- package/src/edge-node/dissolve.ts +252 -252
- package/src/edge-node/edge-join.ts +320 -320
- package/src/edge-node/edge-node.ts +1095 -1095
- package/src/edge-node/index.ts +60 -59
- package/src/edge-node/join-credential.ts +16 -16
- package/src/edge-node/lazy-raw-storage.ts +194 -178
- package/src/edge-node/listen-addrs.ts +26 -0
- package/src/edge-node/node-local.ts +84 -84
- package/src/edge-node/options.ts +195 -195
- package/src/edge-node/owner-grant.ts +63 -63
- package/src/edge-node/platform.ts +5 -4
- package/src/edge-node/strand-move.ts +266 -266
- package/src/edge-node/strands.ts +27 -12
- package/src/enrolled-machine-store-file.ts +43 -43
- package/src/enrolled-machine-store.ts +280 -280
- package/src/fetch-impl.ts +23 -23
- package/src/file-durable-slot.ts +64 -64
- package/src/file-safe-name.ts +32 -32
- package/src/formation-approval.ts +604 -604
- package/src/formation-token.ts +63 -63
- package/src/fs-atomic.ts +92 -92
- package/src/index.ts +987 -957
- package/src/invitation-bootstrap.ts +152 -118
- package/src/joined-strand-store.ts +553 -553
- package/src/key-store-file.ts +142 -142
- package/src/link-budget.ts +61 -5
- package/src/machine-removal.ts +211 -210
- package/src/member-redemption.ts +643 -643
- package/src/membership-connection-gater.ts +650 -650
- package/src/membership-view.ts +147 -144
- package/src/node-claim-payload.ts +34 -12
- package/src/node-class.ts +47 -0
- package/src/node-default-transports.ts +65 -3
- package/src/node-roles.ts +220 -0
- package/src/node-transports.ts +86 -49
- package/src/owner-anchor-sync.ts +172 -172
- package/src/owner-grant-protocol.ts +547 -547
- package/src/owner-key-export.ts +348 -348
- package/src/owner-key-flows.ts +109 -109
- package/src/owner-key-store.ts +1 -1
- package/src/owner-keys.ts +179 -179
- package/src/owner-signer.ts +92 -92
- package/src/peer-addr-book.ts +252 -252
- package/src/peer-authorization.ts +584 -582
- package/src/peer-dial.ts +698 -605
- package/src/peer-join-backfill.ts +961 -961
- package/src/peer-record.ts +71 -16
- package/src/pending-join-runner.ts +798 -798
- package/src/primary-lan-address.ts +47 -47
- package/src/provider/client.ts +327 -326
- package/src/provider/descriptor.ts +129 -129
- package/src/provider/index.ts +59 -59
- package/src/provider/oauth.ts +285 -285
- package/src/provider/rent-node.ts +276 -275
- package/src/relay-addrs.ts +90 -12
- package/src/relay-reservation.ts +1 -1
- package/src/relay-server.ts +99 -98
- package/src/schema-verification.ts +38 -23
- package/src/sealed-party-key.ts +190 -190
- package/src/seed-bootstrap.ts +8 -11
- package/src/seed-trust-policy.ts +353 -353
- package/src/self-address-update.ts +19 -19
- package/src/strand-addr-protocol.ts +17 -14
- package/src/strand-app-schema-report.ts +147 -122
- package/src/strand-cohort.ts +1 -5
- package/src/strand-commit-durability.ts +165 -165
- package/src/strand-database.ts +522 -510
- package/src/strand-first-sync-gate.ts +3 -2
- package/src/strand-formation-deadlines.ts +227 -227
- package/src/strand-formation-manager.ts +731 -731
- package/src/strand-formation-protocol.ts +1174 -1138
- package/src/strand-fret-addrs.ts +179 -179
- package/src/strand-instance-manager.ts +381 -85
- package/src/strand-membership-reconciler.ts +1315 -1310
- package/src/strand-membership-writer.ts +2152 -2150
- package/src/strand-move.ts +1 -1
- package/src/strand-network-config.ts +16 -6
- package/src/strand-offline.ts +178 -178
- package/src/strand-party-key-rotation.ts +440 -436
- package/src/strand-party-machines.ts +308 -293
- package/src/strand-party-peers.ts +151 -129
- package/src/strand-peer-redial.ts +1 -1
- package/src/strand-reactivity.ts +36 -19
- package/src/strand-revocation-enforcer.ts +758 -758
- package/src/strand-wake-protocol.ts +406 -394
- package/src/strand-watcher.ts +1 -1
- package/src/table-change-watch.ts +285 -285
- package/src/timed-step.ts +28 -28
- package/src/timeout-scheduler.ts +29 -29
- package/src/trusted-owner-store.ts +242 -242
- package/src/types.ts +3182 -3112
- package/src/webrtc-upgrade.ts +439 -0
|
@@ -22,8 +22,8 @@ import type { ControlRetryOptions } from './control-retry.js';
|
|
|
22
22
|
* (`quereus-plugin-optimystic/src/optimystic-module.ts`), which keeps the typed
|
|
23
23
|
* `BlockUnavailableError` on `cause`, and Quereus wraps that as
|
|
24
24
|
* `Error during query on table '<T>': …`, again preserving `cause`
|
|
25
|
-
* (`quereus/src/runtime/emit/scan.ts`). The transactor's aggregate is matched by
|
|
26
|
-
*
|
|
25
|
+
* (`quereus/src/runtime/emit/scan.ts`). The transactor's aggregate is matched by type too — it
|
|
26
|
+
* arrives as a `PeersIncompleteError` naming the phase it came from. Both matchers fail CLOSED:
|
|
27
27
|
* a lost `cause` stops the retry engaging, it never makes it unsafe.
|
|
28
28
|
*/
|
|
29
29
|
/**
|
|
@@ -69,7 +69,7 @@ export declare const CONTROL_READ_RETRY_DELAYS_MS: readonly number[];
|
|
|
69
69
|
* the budget still buys is the fast failures it was built for: the ~25 ms transactor read-phase
|
|
70
70
|
* aggregate off a stream still forming, and a `cohort-unreachable` read during bring-up, which
|
|
71
71
|
* fails fast because there is no connection to ask. Both retry twice well inside 1500 ms. See
|
|
72
|
-
* `docs/
|
|
72
|
+
* `docs/network/deadlines.md` → "Deadlines over Optimystic's reads and commits".
|
|
73
73
|
*/
|
|
74
74
|
export declare const CONTROL_READ_RETRY_BUDGET_MS = 1500;
|
|
75
75
|
/**
|
|
@@ -85,18 +85,18 @@ export type ControlReadRetryOptions = ControlRetryOptions;
|
|
|
85
85
|
*
|
|
86
86
|
* Two classes, both meaning "the cluster could not be ASKED properly just now":
|
|
87
87
|
*
|
|
88
|
-
* - the transactor's read-phase aggregate (
|
|
89
|
-
* reused verbatim from the write classifier —
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
88
|
+
* - the transactor's read-phase aggregate ({@link isUncommittedTransactorAggregate}),
|
|
89
|
+
* reused verbatim from the write classifier — including its `pend` arm, which a read
|
|
90
|
+
* cannot produce at all because it presents no transaction, so claiming that phase here
|
|
91
|
+
* is unreachable rather than unsafe and one shared predicate is one thing to keep
|
|
92
|
+
* correct. The write side's indeterminate-commit veto likewise has nothing to veto here
|
|
93
|
+
* (a read commits nothing and re-running it is always safe);
|
|
93
94
|
* - a block read the cohort could not answer ({@link reportsUnreachableCohort}, the
|
|
94
95
|
* predicate the write classifier shares — see it for the reasons and the measured
|
|
95
96
|
* exclusions).
|
|
96
97
|
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
* retried, and anything unmatched is not retried either.
|
|
98
|
+
* Both are matched by TYPE, over one walk of the `cause` chain. Anything that is not an
|
|
99
|
+
* `Error` is never retried, and anything unmatched is not retried either.
|
|
100
100
|
*/
|
|
101
101
|
export declare function isRetriableControlReadFailure(error: unknown): boolean;
|
|
102
102
|
/**
|
|
@@ -122,6 +122,44 @@ export declare function isRetriableControlReadFailure(error: unknown): boolean;
|
|
|
122
122
|
* answer false, and the reader throws as it did before this existed.
|
|
123
123
|
*/
|
|
124
124
|
export declare function isCohortUnreachableRead(error: unknown): boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Did this failure mean no coordinator could be resolved for a block AT ALL — a
|
|
127
|
+
* `FindCoordinatorError` anywhere on the `cause` chain?
|
|
128
|
+
*
|
|
129
|
+
* The sibling of {@link isCohortUnreachableRead} for the failure shape a machine that stores
|
|
130
|
+
* none of a strand's blocks produces. Such a node's `findCluster` returns an EMPTY cohort, so
|
|
131
|
+
* every block falls through to `findCoordinator`, which waits out its bounded retry window and
|
|
132
|
+
* throws `FindCoordinatorError` — code `NO_NETWORK_COORDINATOR` when the only peers it saw were
|
|
133
|
+
* unconfirmed or serve another network, `NO_COORDINATOR_AVAILABLE` otherwise.
|
|
134
|
+
*
|
|
135
|
+
* Matched by CLASS, so all four of `FIND_COORDINATOR_ERROR_CODES` match, not only the two a
|
|
136
|
+
* client produces. That is the intent, not laxity: every code means "no coordinator was
|
|
137
|
+
* resolved", NONE of them means "the block does not exist", and the one reader
|
|
138
|
+
* (`StrandInstanceManager.buildStrandDatabase`) waits for a machine that can answer in every
|
|
139
|
+
* case. The two self-coordination codes reach a Sereus node only from a detected partition or
|
|
140
|
+
* suspicious cohort shrinkage — Sereus never switches self-coordination off by config — and
|
|
141
|
+
* waiting is the right answer there too.
|
|
142
|
+
*
|
|
143
|
+
* Not a retry classifier, and deliberately NOT folded into {@link isCohortUnreachableRead}:
|
|
144
|
+
* that predicate's other reader, `ControlDatabase.queryRevokedStamps`, reads an unmatched block
|
|
145
|
+
* as "no revocations known", so admitting a new class of failure there would widen a
|
|
146
|
+
* security-relevant default. One predicate per reader is what keeps that default where it was.
|
|
147
|
+
*
|
|
148
|
+
* The walk is over the same {@link causeChain}, because `StrandDatabase.initialize` runs the
|
|
149
|
+
* failure through Quereus's `db.exec`, which may wrap it. Fails CLOSED the same way: a
|
|
150
|
+
* non-`Error`, a text-only copy of the message, and an error built by a second loaded copy of
|
|
151
|
+
* `@optimystic/db-p2p` (which `instanceof` cannot recognise) all answer false, and the caller
|
|
152
|
+
* throws as it did before this existed.
|
|
153
|
+
*
|
|
154
|
+
* NOTE: matching the class rather than `.code` is the deliberate call, and the one code it
|
|
155
|
+
* admits against its own upstream advice is `SELF_COORDINATION_BLOCKED`, whose comment says
|
|
156
|
+
* retrying is unlikely to help. It costs a launch that hits it a `'syncing'` runtime retrying
|
|
157
|
+
* every 5 s instead of a watcher rebuild on a doubling delay, and only a SERVING node can hit
|
|
158
|
+
* it at all (a client is never a candidate coordinator, so it gets `NO_COORDINATOR_AVAILABLE`).
|
|
159
|
+
* Narrow this to `.code` if a config switch for self-coordination is ever passed from Sereus, or
|
|
160
|
+
* if a partition verdict is ever made from something that does not heal on its own.
|
|
161
|
+
*/
|
|
162
|
+
export declare function isNoCoordinatorResolved(error: unknown): boolean;
|
|
125
163
|
/**
|
|
126
164
|
* Run `attempt` — a full drain of one control read — up to
|
|
127
165
|
* {@link CONTROL_READ_ATTEMPTS} times, retrying only failures
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BlockUnavailableError } from '@optimystic/db-core';
|
|
2
|
-
import {
|
|
2
|
+
import { FindCoordinatorError } from '@optimystic/db-p2p';
|
|
3
|
+
import { causeChain, reportsUnreachableCohort, retryControlOperation } from './control-retry.js';
|
|
3
4
|
import { isUncommittedTransactorAggregate } from './control-write-retry.js';
|
|
4
5
|
/**
|
|
5
6
|
* Bounded retry for TRANSIENT control-read failures — the classifier and policy behind
|
|
@@ -24,8 +25,8 @@ import { isUncommittedTransactorAggregate } from './control-write-retry.js';
|
|
|
24
25
|
* (`quereus-plugin-optimystic/src/optimystic-module.ts`), which keeps the typed
|
|
25
26
|
* `BlockUnavailableError` on `cause`, and Quereus wraps that as
|
|
26
27
|
* `Error during query on table '<T>': …`, again preserving `cause`
|
|
27
|
-
* (`quereus/src/runtime/emit/scan.ts`). The transactor's aggregate is matched by
|
|
28
|
-
*
|
|
28
|
+
* (`quereus/src/runtime/emit/scan.ts`). The transactor's aggregate is matched by type too — it
|
|
29
|
+
* arrives as a `PeersIncompleteError` naming the phase it came from. Both matchers fail CLOSED:
|
|
29
30
|
* a lost `cause` stops the retry engaging, it never makes it unsafe.
|
|
30
31
|
*/
|
|
31
32
|
/**
|
|
@@ -71,34 +72,34 @@ export const CONTROL_READ_RETRY_DELAYS_MS = [100, 400];
|
|
|
71
72
|
* the budget still buys is the fast failures it was built for: the ~25 ms transactor read-phase
|
|
72
73
|
* aggregate off a stream still forming, and a `cohort-unreachable` read during bring-up, which
|
|
73
74
|
* fails fast because there is no connection to ask. Both retry twice well inside 1500 ms. See
|
|
74
|
-
* `docs/
|
|
75
|
+
* `docs/network/deadlines.md` → "Deadlines over Optimystic's reads and commits".
|
|
75
76
|
*/
|
|
76
|
-
// eslint-disable-next-line no-restricted-syntax -- cuts off by design: a slow attempt is not retried, because the admission gate this budget is sized for has already failed open by then; see docs/
|
|
77
|
+
// eslint-disable-next-line no-restricted-syntax -- cuts off by design: a slow attempt is not retried, because the admission gate this budget is sized for has already failed open by then; see docs/network/deadlines.md → "Deadlines over Optimystic's reads and commits"
|
|
77
78
|
export const CONTROL_READ_RETRY_BUDGET_MS = 1500;
|
|
78
79
|
/**
|
|
79
80
|
* Did this control read fail in a way a repeat read can improve on?
|
|
80
81
|
*
|
|
81
82
|
* Two classes, both meaning "the cluster could not be ASKED properly just now":
|
|
82
83
|
*
|
|
83
|
-
* - the transactor's read-phase aggregate (
|
|
84
|
-
* reused verbatim from the write classifier —
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
84
|
+
* - the transactor's read-phase aggregate ({@link isUncommittedTransactorAggregate}),
|
|
85
|
+
* reused verbatim from the write classifier — including its `pend` arm, which a read
|
|
86
|
+
* cannot produce at all because it presents no transaction, so claiming that phase here
|
|
87
|
+
* is unreachable rather than unsafe and one shared predicate is one thing to keep
|
|
88
|
+
* correct. The write side's indeterminate-commit veto likewise has nothing to veto here
|
|
89
|
+
* (a read commits nothing and re-running it is always safe);
|
|
88
90
|
* - a block read the cohort could not answer ({@link reportsUnreachableCohort}, the
|
|
89
91
|
* predicate the write classifier shares — see it for the reasons and the measured
|
|
90
92
|
* exclusions).
|
|
91
93
|
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
* retried, and anything unmatched is not retried either.
|
|
94
|
+
* Both are matched by TYPE, over one walk of the `cause` chain. Anything that is not an
|
|
95
|
+
* `Error` is never retried, and anything unmatched is not retried either.
|
|
95
96
|
*/
|
|
96
97
|
export function isRetriableControlReadFailure(error) {
|
|
97
98
|
if (!(error instanceof Error)) {
|
|
98
99
|
return false;
|
|
99
100
|
}
|
|
100
|
-
|
|
101
|
-
|
|
101
|
+
const links = causeChain(error);
|
|
102
|
+
return reportsUnreachableCohort(links) || isUncommittedTransactorAggregate(links);
|
|
102
103
|
}
|
|
103
104
|
/**
|
|
104
105
|
* Did this control read fail because no cohort member other than the answering node could
|
|
@@ -125,6 +126,46 @@ export function isRetriableControlReadFailure(error) {
|
|
|
125
126
|
export function isCohortUnreachableRead(error) {
|
|
126
127
|
return causeChain(error).some(link => link instanceof BlockUnavailableError && link.reason === 'cohort-unreachable');
|
|
127
128
|
}
|
|
129
|
+
/**
|
|
130
|
+
* Did this failure mean no coordinator could be resolved for a block AT ALL — a
|
|
131
|
+
* `FindCoordinatorError` anywhere on the `cause` chain?
|
|
132
|
+
*
|
|
133
|
+
* The sibling of {@link isCohortUnreachableRead} for the failure shape a machine that stores
|
|
134
|
+
* none of a strand's blocks produces. Such a node's `findCluster` returns an EMPTY cohort, so
|
|
135
|
+
* every block falls through to `findCoordinator`, which waits out its bounded retry window and
|
|
136
|
+
* throws `FindCoordinatorError` — code `NO_NETWORK_COORDINATOR` when the only peers it saw were
|
|
137
|
+
* unconfirmed or serve another network, `NO_COORDINATOR_AVAILABLE` otherwise.
|
|
138
|
+
*
|
|
139
|
+
* Matched by CLASS, so all four of `FIND_COORDINATOR_ERROR_CODES` match, not only the two a
|
|
140
|
+
* client produces. That is the intent, not laxity: every code means "no coordinator was
|
|
141
|
+
* resolved", NONE of them means "the block does not exist", and the one reader
|
|
142
|
+
* (`StrandInstanceManager.buildStrandDatabase`) waits for a machine that can answer in every
|
|
143
|
+
* case. The two self-coordination codes reach a Sereus node only from a detected partition or
|
|
144
|
+
* suspicious cohort shrinkage — Sereus never switches self-coordination off by config — and
|
|
145
|
+
* waiting is the right answer there too.
|
|
146
|
+
*
|
|
147
|
+
* Not a retry classifier, and deliberately NOT folded into {@link isCohortUnreachableRead}:
|
|
148
|
+
* that predicate's other reader, `ControlDatabase.queryRevokedStamps`, reads an unmatched block
|
|
149
|
+
* as "no revocations known", so admitting a new class of failure there would widen a
|
|
150
|
+
* security-relevant default. One predicate per reader is what keeps that default where it was.
|
|
151
|
+
*
|
|
152
|
+
* The walk is over the same {@link causeChain}, because `StrandDatabase.initialize` runs the
|
|
153
|
+
* failure through Quereus's `db.exec`, which may wrap it. Fails CLOSED the same way: a
|
|
154
|
+
* non-`Error`, a text-only copy of the message, and an error built by a second loaded copy of
|
|
155
|
+
* `@optimystic/db-p2p` (which `instanceof` cannot recognise) all answer false, and the caller
|
|
156
|
+
* throws as it did before this existed.
|
|
157
|
+
*
|
|
158
|
+
* NOTE: matching the class rather than `.code` is the deliberate call, and the one code it
|
|
159
|
+
* admits against its own upstream advice is `SELF_COORDINATION_BLOCKED`, whose comment says
|
|
160
|
+
* retrying is unlikely to help. It costs a launch that hits it a `'syncing'` runtime retrying
|
|
161
|
+
* every 5 s instead of a watcher rebuild on a doubling delay, and only a SERVING node can hit
|
|
162
|
+
* it at all (a client is never a candidate coordinator, so it gets `NO_COORDINATOR_AVAILABLE`).
|
|
163
|
+
* Narrow this to `.code` if a config switch for self-coordination is ever passed from Sereus, or
|
|
164
|
+
* if a partition verdict is ever made from something that does not heal on its own.
|
|
165
|
+
*/
|
|
166
|
+
export function isNoCoordinatorResolved(error) {
|
|
167
|
+
return causeChain(error).some(link => link instanceof FindCoordinatorError);
|
|
168
|
+
}
|
|
128
169
|
/**
|
|
129
170
|
* Run `attempt` — a full drain of one control read — up to
|
|
130
171
|
* {@link CONTROL_READ_ATTEMPTS} times, retrying only failures
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-read-retry.js","sourceRoot":"","sources":["../src/control-read-retry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"control-read-retry.js","sourceRoot":"","sources":["../src/control-read-retry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEjG,OAAO,EAAE,gCAAgC,EAAE,MAAM,0BAA0B,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAEvC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAsB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAE1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,2QAA2Q;AAC3Q,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAK,CAAC;AAWlD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,6BAA6B,CAAC,KAAc;IAC3D,IAAI,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC;IACd,CAAC;IACD,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IAChC,OAAO,wBAAwB,CAAC,KAAK,CAAC,IAAI,gCAAgC,CAAC,KAAK,CAAC,CAAC;AACnF,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAAc;IACrD,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACpC,IAAI,YAAY,qBAAqB,IAAI,IAAI,CAAC,MAAM,KAAK,oBAAoB,CAAC,CAAC;AACjF,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAAc;IACrD,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,YAAY,oBAAoB,CAAC,CAAC;AAC7E,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,gBAAgB,CAC/B,OAAyB,EACzB,UAAmC,EAAE;IAErC,OAAO,qBAAqB,CAAC,OAAO,EAAE;QACrC,QAAQ,EAAE,qBAAqB;QAC/B,QAAQ,EAAE,4BAA4B;QACtC,QAAQ,EAAE,4BAA4B;QACtC,WAAW,EAAE,6BAA6B;QAC1C,SAAS,EAAE,cAAc;KACzB,EAAE,OAAO,CAAC,CAAC;AACb,CAAC"}
|
package/dist/control-retry.d.ts
CHANGED
|
@@ -130,9 +130,10 @@ export interface ControlRetryOptions {
|
|
|
130
130
|
*/
|
|
131
131
|
export declare function retryControlOperation<T>(attempt: () => Promise<T>, policy: ControlRetryPolicy, options?: ControlRetryOptions): Promise<T>;
|
|
132
132
|
/**
|
|
133
|
-
* Every message in the failure's `cause` chain — the substrate
|
|
134
|
-
*
|
|
135
|
-
*
|
|
133
|
+
* Every message in the failure's `cause` chain — the substrate for the matchers that have only
|
|
134
|
+
* TEXT to work with: the schema-init self-coordination refusal (`control-write-retry.ts`, whose
|
|
135
|
+
* `NOTE:` says why) and `ControlDatabase`'s own message probes. Both retry classifiers claim their
|
|
136
|
+
* failures by TYPE over {@link causeChain} instead. Every wrap on the way out of optimystic and
|
|
136
137
|
* Quereus embeds the inner message, so the text of the deepest failure is visible at every level.
|
|
137
138
|
*
|
|
138
139
|
* `unwrapError` declares its `message` as `string`, but it follows `.cause` without checking
|
|
@@ -198,3 +199,31 @@ export declare function causeChain(error: unknown): Error[];
|
|
|
198
199
|
* from its text, fails `instanceof` and is not retried — the safe side.
|
|
199
200
|
*/
|
|
200
201
|
export declare function reportsUnreachableCohort(links: readonly Error[]): boolean;
|
|
202
|
+
/**
|
|
203
|
+
* Does any link of the `cause` chain report the cluster coordinator's super-majority shortfall with
|
|
204
|
+
* NOBODY having voted no — a `PromiseShortfallError` whose `rejections` is zero? The promise round
|
|
205
|
+
* reached no verdict (too few approvals to pass, too few rejections to count as a rejection), so the
|
|
206
|
+
* cohort was simply not all there, and a moment later it may be.
|
|
207
|
+
*
|
|
208
|
+
* The one shortfall test both write policies share — the control-write classifier
|
|
209
|
+
* (`isRetriableControlWriteFailure`) and the edge node's `retryAfterRestart` — so the funnel every
|
|
210
|
+
* local control write passes through and the helper an app wraps its first writes in cannot
|
|
211
|
+
* disagree on which shortfall is worth re-presenting.
|
|
212
|
+
*
|
|
213
|
+
* A non-zero `rejections` is deliberately excluded: a member actually voted no (that branch carries
|
|
214
|
+
* `membership-not-admitted` rejections), and no backoff changes that answer — re-presenting it would
|
|
215
|
+
* re-present a spent signature to a cohort that already refused it.
|
|
216
|
+
*
|
|
217
|
+
* Matched by TYPE, which upstream's own comment on the class asks consumers to prefer over its
|
|
218
|
+
* sentence. Every wrapper between the raise site and either caller keeps the error on `cause` — the
|
|
219
|
+
* optimystic plugin's `rewrapAsQueryError`, Quereus' statement-execution rewrap, its module-create
|
|
220
|
+
* wrapper and its DDL wrapper — so the claim reaches any depth. NOTE: an error built by a second
|
|
221
|
+
* loaded copy of `@optimystic/db-core`, or one rebuilt as a plain `Error` from its text, fails
|
|
222
|
+
* `instanceof` and is not claimed — the same fail-closed direction
|
|
223
|
+
* {@link reportsUnreachableCohort} already accepts.
|
|
224
|
+
*
|
|
225
|
+
* This says only that the round went unanswered. WHERE that leaves the write is the caller's: the
|
|
226
|
+
* control-write funnel still vetoes a shortfall carried by a commit-phase batch, because a commit
|
|
227
|
+
* may have landed with only the reply lost.
|
|
228
|
+
*/
|
|
229
|
+
export declare function reportsUnansweredShortfall(links: readonly Error[]): boolean;
|
package/dist/control-retry.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import debug from 'debug';
|
|
2
|
-
import { isCohortUnreachableRead } from '@optimystic/db-core';
|
|
2
|
+
import { isCohortUnreachableRead, PromiseShortfallError } from '@optimystic/db-core';
|
|
3
3
|
import { unwrapError } from '@quereus/quereus';
|
|
4
4
|
const log = debug('sereus:cadre:control-db');
|
|
5
5
|
/**
|
|
@@ -101,9 +101,10 @@ function notifyAbandoned(listener, prefix, tag, abandonment) {
|
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
/**
|
|
104
|
-
* Every message in the failure's `cause` chain — the substrate
|
|
105
|
-
*
|
|
106
|
-
*
|
|
104
|
+
* Every message in the failure's `cause` chain — the substrate for the matchers that have only
|
|
105
|
+
* TEXT to work with: the schema-init self-coordination refusal (`control-write-retry.ts`, whose
|
|
106
|
+
* `NOTE:` says why) and `ControlDatabase`'s own message probes. Both retry classifiers claim their
|
|
107
|
+
* failures by TYPE over {@link causeChain} instead. Every wrap on the way out of optimystic and
|
|
107
108
|
* Quereus embeds the inner message, so the text of the deepest failure is visible at every level.
|
|
108
109
|
*
|
|
109
110
|
* `unwrapError` declares its `message` as `string`, but it follows `.cause` without checking
|
|
@@ -183,6 +184,36 @@ export function causeChain(error) {
|
|
|
183
184
|
export function reportsUnreachableCohort(links) {
|
|
184
185
|
return links.some(link => isCohortUnreachableRead(link));
|
|
185
186
|
}
|
|
187
|
+
/**
|
|
188
|
+
* Does any link of the `cause` chain report the cluster coordinator's super-majority shortfall with
|
|
189
|
+
* NOBODY having voted no — a `PromiseShortfallError` whose `rejections` is zero? The promise round
|
|
190
|
+
* reached no verdict (too few approvals to pass, too few rejections to count as a rejection), so the
|
|
191
|
+
* cohort was simply not all there, and a moment later it may be.
|
|
192
|
+
*
|
|
193
|
+
* The one shortfall test both write policies share — the control-write classifier
|
|
194
|
+
* (`isRetriableControlWriteFailure`) and the edge node's `retryAfterRestart` — so the funnel every
|
|
195
|
+
* local control write passes through and the helper an app wraps its first writes in cannot
|
|
196
|
+
* disagree on which shortfall is worth re-presenting.
|
|
197
|
+
*
|
|
198
|
+
* A non-zero `rejections` is deliberately excluded: a member actually voted no (that branch carries
|
|
199
|
+
* `membership-not-admitted` rejections), and no backoff changes that answer — re-presenting it would
|
|
200
|
+
* re-present a spent signature to a cohort that already refused it.
|
|
201
|
+
*
|
|
202
|
+
* Matched by TYPE, which upstream's own comment on the class asks consumers to prefer over its
|
|
203
|
+
* sentence. Every wrapper between the raise site and either caller keeps the error on `cause` — the
|
|
204
|
+
* optimystic plugin's `rewrapAsQueryError`, Quereus' statement-execution rewrap, its module-create
|
|
205
|
+
* wrapper and its DDL wrapper — so the claim reaches any depth. NOTE: an error built by a second
|
|
206
|
+
* loaded copy of `@optimystic/db-core`, or one rebuilt as a plain `Error` from its text, fails
|
|
207
|
+
* `instanceof` and is not claimed — the same fail-closed direction
|
|
208
|
+
* {@link reportsUnreachableCohort} already accepts.
|
|
209
|
+
*
|
|
210
|
+
* This says only that the round went unanswered. WHERE that leaves the write is the caller's: the
|
|
211
|
+
* control-write funnel still vetoes a shortfall carried by a commit-phase batch, because a commit
|
|
212
|
+
* may have landed with only the reply lost.
|
|
213
|
+
*/
|
|
214
|
+
export function reportsUnansweredShortfall(links) {
|
|
215
|
+
return links.some(link => link instanceof PromiseShortfallError && link.rejections === 0);
|
|
216
|
+
}
|
|
186
217
|
/**
|
|
187
218
|
* Backoff for the retry that follows attempt `attemptNumber`: the matching base delay
|
|
188
219
|
* (last entry repeats), jittered ±50%, then capped at the list's largest base so no single
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-retry.js","sourceRoot":"","sources":["../src/control-retry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"control-retry.js","sourceRoot":"","sources":["../src/control-retry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,MAAM,GAAG,GAAG,KAAK,CAAC,yBAAyB,CAAC,CAAC;AAwH7C;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAC1C,OAAyB,EACzB,MAA0B,EAC1B,UAA+B,EAAE;IAEjC,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC;IAClE,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC;IACnD,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,MAAM,CAAC,WAAW,CAAC;IAC9D,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,YAAY,CAAC;IAC5C,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC;IACpC,MAAM,MA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,IAAI,CAAC,UAAU,KAAK,CAAC,CAAC,CAAC;AAC3F,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,SAAS,aAAa,CAAC,MAAyB,EAAE,aAAqB;IACtE,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,CAAC,CAAC;IACV,CAAC;IACD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAE,CAAC;IACrE,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;IAC9C,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;AAChD,CAAC;AAED,SAAS,YAAY,CAAC,EAAU;IAC/B,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AACxD,CAAC"}
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* The same change classifier ({@link classifyControlSchemaChange}) is what
|
|
15
15
|
* `control-schema-versions.spec.ts` runs over each pair of consecutive control schema versions,
|
|
16
16
|
* so a schema edit that no store could be migrated across fails when it is made. Where the
|
|
17
|
-
* version lives, when it changes and what a new version may change: docs/
|
|
18
|
-
* "
|
|
17
|
+
* version lives, when it changes and what a new version may change: docs/cadre/control-schema.md →
|
|
18
|
+
* "Schema versions and migrations".
|
|
19
19
|
*
|
|
20
20
|
* The stored tag is the version of the last start that applied the schema to the store: the
|
|
21
21
|
* apply's `alter table OwnerKey set tags (…)` persists since Optimystic 1.16.0, so after a
|
|
@@ -46,7 +46,7 @@ export declare class ControlStoreIncompatibleError extends Error {
|
|
|
46
46
|
readonly buildVersion: number;
|
|
47
47
|
/** The DDL the apply would have run, from `diff schema`; for diagnostics, not for parsing. */
|
|
48
48
|
readonly pendingDdl: readonly string[];
|
|
49
|
-
/** `controlStorageScope(partyId)`: the storage the embedder deletes to recreate (docs/
|
|
49
|
+
/** `controlStorageScope(partyId)`: the storage the embedder deletes to recreate (docs/cadre/control-schema.md). */
|
|
50
50
|
readonly storageScope: string;
|
|
51
51
|
constructor(reason: ControlStoreIncompatibility, partyId: string, storeVersion: number, buildVersion: number, pendingDdl: readonly string[]);
|
|
52
52
|
}
|
|
@@ -63,7 +63,7 @@ export declare class ControlStoreIncompatibleError extends Error {
|
|
|
63
63
|
* declares something this build does) would put back what that release removed, and the newer
|
|
64
64
|
* release would then refuse its own store;
|
|
65
65
|
* - its version is below the baseline, whatever the diff: a store written by 1.16.0 or earlier,
|
|
66
|
-
* which the
|
|
66
|
+
* which docs/cadre/control-schema.md → "Where the version is recorded" explains cannot be migrated;
|
|
67
67
|
* - any pending statement is `unmigratable` ({@link classifyControlSchemaChange}).
|
|
68
68
|
*
|
|
69
69
|
* Every `additive` and `catalog-only` change passes, so a store from an older migratable
|
|
@@ -76,7 +76,7 @@ export declare function refuseIncompatibleControlStore(db: Database, partyId: st
|
|
|
76
76
|
export declare function declaredSchemaVersion(db: Database): number;
|
|
77
77
|
/**
|
|
78
78
|
* How applying one `diff schema` statement to a warm store treats its rows, from most to least
|
|
79
|
-
* migratable (docs/
|
|
79
|
+
* migratable (docs/cadre/control-schema.md → "Schema versions and migrations"):
|
|
80
80
|
* - `additive`: a new table, a new index, or a table tag change, which the optimystic module
|
|
81
81
|
* applies without touching a row;
|
|
82
82
|
* - `catalog-only`: a change the optimystic module applies to the table's catalog record without
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* The same change classifier ({@link classifyControlSchemaChange}) is what
|
|
15
15
|
* `control-schema-versions.spec.ts` runs over each pair of consecutive control schema versions,
|
|
16
16
|
* so a schema edit that no store could be migrated across fails when it is made. Where the
|
|
17
|
-
* version lives, when it changes and what a new version may change: docs/
|
|
18
|
-
* "
|
|
17
|
+
* version lives, when it changes and what a new version may change: docs/cadre/control-schema.md →
|
|
18
|
+
* "Schema versions and migrations".
|
|
19
19
|
*
|
|
20
20
|
* The stored tag is the version of the last start that applied the schema to the store: the
|
|
21
21
|
* apply's `alter table OwnerKey set tags (…)` persists since Optimystic 1.16.0, so after a
|
|
@@ -52,14 +52,14 @@ function refusalMessage(reason, partyId, storeVersion, buildVersion, storageScop
|
|
|
52
52
|
const store = `The control store for party ${JSON.stringify(partyId)}`;
|
|
53
53
|
const versions = `it records control schema version ${storeVersion}; this build declares ${buildVersion}`;
|
|
54
54
|
const recreate = 'Run a release whose control schema matches the store, or recreate the control store ' +
|
|
55
|
-
`(storage scope ${storageScope}) as docs/
|
|
55
|
+
`(storage scope ${storageScope}) as docs/cadre/control-schema.md describes.`;
|
|
56
56
|
switch (reason) {
|
|
57
57
|
case 'newer-release':
|
|
58
58
|
return `${store} was migrated by a newer release (${versions}). Update this app or node to that ` +
|
|
59
59
|
'release or a later one; the store and its rows are intact.';
|
|
60
60
|
case 'before-migrations':
|
|
61
61
|
return `${store} was written before control schema migrations (${versions}; migrations start at ` +
|
|
62
|
-
`version ${CONTROL_SCHEMA_BASELINE_VERSION}, and docs/
|
|
62
|
+
`version ${CONTROL_SCHEMA_BASELINE_VERSION}, and docs/cadre/control-schema.md says why earlier stores are not ` +
|
|
63
63
|
`migrated), so this build cannot upgrade it in place. ${recreate}`;
|
|
64
64
|
case 'not-migratable':
|
|
65
65
|
return `${store} cannot be migrated to this build's control schema (${versions}): applying it would ` +
|
|
@@ -79,7 +79,7 @@ function refusalMessage(reason, partyId, storeVersion, buildVersion, storageScop
|
|
|
79
79
|
* declares something this build does) would put back what that release removed, and the newer
|
|
80
80
|
* release would then refuse its own store;
|
|
81
81
|
* - its version is below the baseline, whatever the diff: a store written by 1.16.0 or earlier,
|
|
82
|
-
* which the
|
|
82
|
+
* which docs/cadre/control-schema.md → "Where the version is recorded" explains cannot be migrated;
|
|
83
83
|
* - any pending statement is `unmigratable` ({@link classifyControlSchemaChange}).
|
|
84
84
|
*
|
|
85
85
|
* Every `additive` and `catalog-only` change passes, so a store from an older migratable
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-schema-version.js","sourceRoot":"","sources":["../src/control-schema-version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,MAAM,EAAsE,MAAM,kBAAkB,CAAC;AAE9G,OAAO,EAAE,+BAA+B,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AACvH,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD,6EAA6E;AAC7E,MAAM,aAAa,GAAG,UAAU,CAAC;AAcjC,0EAA0E;AAC1E,MAAM,OAAO,6BAA8B,SAAQ,KAAK;IAYvD,YACC,MAAmC,EACnC,OAAe,EACf,YAAoB,EACpB,YAAoB,EACpB,UAA6B;QAE7B,MAAM,YAAY,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;QAClD,KAAK,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC;QACjF,IAAI,CAAC,IAAI,GAAG,+BAA+B,CAAC;QAC5C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IAClC,CAAC;CACD;AAED;;;;GAIG;AACH,SAAS,cAAc,CACtB,MAAmC,EACnC,OAAe,EACf,YAAoB,EACpB,YAAoB,EACpB,YAAoB;IAEpB,MAAM,KAAK,GAAG,+BAA+B,IAAI,CAAC,SAAS,CAA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