@optimystic/db-core 1.26.0 → 1.27.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/src/cluster/structs.d.ts +10 -0
- package/dist/src/cluster/structs.d.ts.map +1 -1
- package/dist/src/network/i-key-network.d.ts +28 -0
- package/dist/src/network/i-key-network.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/cluster/structs.ts +10 -0
- package/src/network/i-key-network.ts +30 -0
|
@@ -420,6 +420,16 @@ export interface ClusterConsensusConfig {
|
|
|
420
420
|
readRepairWindowMs?: number;
|
|
421
421
|
/** Per-read probability of triggering read-repair in 'lazy' mode even within the window (0..1). Default 0 (no random check). */
|
|
422
422
|
readRepairSampleRate?: number;
|
|
423
|
+
/**
|
|
424
|
+
* For 'lazy' mode: how long after a consult that heard from every other member of a held block's
|
|
425
|
+
* cohort and found nothing ahead the block may go without another one, while every commit to it
|
|
426
|
+
* needs every member's promise (two or three members at the default threshold), every member has
|
|
427
|
+
* stayed connected to this node, and this node holds no pending record for the block. Default
|
|
428
|
+
* 300 000 (`DEFAULT_READ_REPAIR_QUIET_WINDOW_MS` in db-p2p); `0` turns it off, and so in effect
|
|
429
|
+
* does any value at or below `readRepairWindowMs`. See docs/transactions.md § Lazy read-repair
|
|
430
|
+
* window. On a node, set through `clusterPolicy.readRepairQuietWindowMs`.
|
|
431
|
+
*/
|
|
432
|
+
readRepairQuietWindowMs?: number;
|
|
423
433
|
/**
|
|
424
434
|
* How long ONE cohort peer gets to answer ONE read-path request, in milliseconds (default
|
|
425
435
|
* {@link DEFAULT_COHORT_QUERY_TIMEOUT_MS} = 1000). It sets BOTH per-peer deadlines on the read
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structs.d.ts","sourceRoot":"","sources":["../../../src/cluster/structs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,E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G,QAAQ,GAAG,QAAQ,CAAC"}
|
|
@@ -27,6 +27,21 @@ export type FindCoordinatorOptions = {
|
|
|
27
27
|
*/
|
|
28
28
|
intent?: CoordinatorIntent;
|
|
29
29
|
};
|
|
30
|
+
/**
|
|
31
|
+
* What {@link IKeyNetwork.connectedCohort} reports for a key: a cohort that is the whole serving
|
|
32
|
+
* network this node knows of, this node among it and every other member connected to it.
|
|
33
|
+
*
|
|
34
|
+
* A **connection run** is the span during which a remote peer has at least one open connection to
|
|
35
|
+
* this node; it ends when the peer's last connection closes, and the next connection starts a new
|
|
36
|
+
* run with a new id. So two reports with equal `members` and equal `runs` prove that no member's
|
|
37
|
+
* connection to this node broke between them.
|
|
38
|
+
*/
|
|
39
|
+
export type ConnectedCohort = {
|
|
40
|
+
/** The cohort `findCluster` assembles for the key now, as peer-id strings, this node included, sorted ascending. */
|
|
41
|
+
readonly members: readonly string[];
|
|
42
|
+
/** Per member other than this node: the id of its current connection run. Ids are never reused within a process. */
|
|
43
|
+
readonly runs: Readonly<Record<string, number>>;
|
|
44
|
+
};
|
|
30
45
|
/**
|
|
31
46
|
* Maps a block to the peers responsible for it.
|
|
32
47
|
*
|
|
@@ -73,5 +88,18 @@ export type IKeyNetwork = {
|
|
|
73
88
|
* such peers omit this, which reads as "none known".
|
|
74
89
|
*/
|
|
75
90
|
absentCohortMembers?(key: RoutingKey): Promise<string[]>;
|
|
91
|
+
/**
|
|
92
|
+
* Optionally report, for `key`, that the cohort `findCluster` would assemble now is every machine
|
|
93
|
+
* that could coordinate a commit to the key's block as far as this node can know — the whole
|
|
94
|
+
* serving network it knows of, this node included — and that every other member is connected to
|
|
95
|
+
* this node, with the connection run each is on (see {@link ConnectedCohort}). Answers from what
|
|
96
|
+
* the node already holds, without dialing or opening a stream.
|
|
97
|
+
*
|
|
98
|
+
* `undefined` means no such guarantee: the cohort is a selection from a wider network, a peer is
|
|
99
|
+
* not yet identified or is remembered but absent, a member is not connected, or the
|
|
100
|
+
* implementation cannot judge. Implementations that track no connections omit this, which reads
|
|
101
|
+
* the same, so a caller then behaves as if the method did not exist.
|
|
102
|
+
*/
|
|
103
|
+
connectedCohort?(key: RoutingKey): Promise<ConnectedCohort | undefined>;
|
|
76
104
|
};
|
|
77
105
|
//# sourceMappingURL=i-key-network.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i-key-network.d.ts","sourceRoot":"","sources":["../../../src/network/i-key-network.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,OAAO,CAAC;AAEjD,MAAM,MAAM,sBAAsB,GAAG;IACpC,sDAAsD;IACtD,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC3B,CAAC;AAGF;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG;IACzB;;;;OAIG;IACH,eAAe,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE7F;;;;OAIG;IACH,WAAW,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAEpD;;;;;;;OAOG;IACH,iBAAiB,CAAC,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1E;;;;;;OAMG;IACH,wBAAwB,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAE9C;;;;;;;OAOG;IACH,mBAAmB,CAAC,CAAC,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AwB,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAE9C;;;;;;;OAOG;IACH,mBAAmB,CAAC,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAEzD;;;;;;;;;;;OAWG;IACH,eAAe,CAAC,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,CAAC;CACxE,CAAA"}
|
package/package.json
CHANGED
package/src/cluster/structs.ts
CHANGED
|
@@ -439,6 +439,16 @@ export interface ClusterConsensusConfig {
|
|
|
439
439
|
readRepairWindowMs?: number;
|
|
440
440
|
/** Per-read probability of triggering read-repair in 'lazy' mode even within the window (0..1). Default 0 (no random check). */
|
|
441
441
|
readRepairSampleRate?: number;
|
|
442
|
+
/**
|
|
443
|
+
* For 'lazy' mode: how long after a consult that heard from every other member of a held block's
|
|
444
|
+
* cohort and found nothing ahead the block may go without another one, while every commit to it
|
|
445
|
+
* needs every member's promise (two or three members at the default threshold), every member has
|
|
446
|
+
* stayed connected to this node, and this node holds no pending record for the block. Default
|
|
447
|
+
* 300 000 (`DEFAULT_READ_REPAIR_QUIET_WINDOW_MS` in db-p2p); `0` turns it off, and so in effect
|
|
448
|
+
* does any value at or below `readRepairWindowMs`. See docs/transactions.md § Lazy read-repair
|
|
449
|
+
* window. On a node, set through `clusterPolicy.readRepairQuietWindowMs`.
|
|
450
|
+
*/
|
|
451
|
+
readRepairQuietWindowMs?: number;
|
|
442
452
|
/**
|
|
443
453
|
* How long ONE cohort peer gets to answer ONE read-path request, in milliseconds (default
|
|
444
454
|
* {@link DEFAULT_COHORT_QUERY_TIMEOUT_MS} = 1000). It sets BOTH per-peer deadlines on the read
|
|
@@ -31,6 +31,22 @@ export type FindCoordinatorOptions = {
|
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
|
|
34
|
+
/**
|
|
35
|
+
* What {@link IKeyNetwork.connectedCohort} reports for a key: a cohort that is the whole serving
|
|
36
|
+
* network this node knows of, this node among it and every other member connected to it.
|
|
37
|
+
*
|
|
38
|
+
* A **connection run** is the span during which a remote peer has at least one open connection to
|
|
39
|
+
* this node; it ends when the peer's last connection closes, and the next connection starts a new
|
|
40
|
+
* run with a new id. So two reports with equal `members` and equal `runs` prove that no member's
|
|
41
|
+
* connection to this node broke between them.
|
|
42
|
+
*/
|
|
43
|
+
export type ConnectedCohort = {
|
|
44
|
+
/** The cohort `findCluster` assembles for the key now, as peer-id strings, this node included, sorted ascending. */
|
|
45
|
+
readonly members: readonly string[];
|
|
46
|
+
/** Per member other than this node: the id of its current connection run. Ids are never reused within a process. */
|
|
47
|
+
readonly runs: Readonly<Record<string, number>>;
|
|
48
|
+
};
|
|
49
|
+
|
|
34
50
|
/**
|
|
35
51
|
* Maps a block to the peers responsible for it.
|
|
36
52
|
*
|
|
@@ -81,4 +97,18 @@ export type IKeyNetwork = {
|
|
|
81
97
|
* such peers omit this, which reads as "none known".
|
|
82
98
|
*/
|
|
83
99
|
absentCohortMembers?(key: RoutingKey): Promise<string[]>;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Optionally report, for `key`, that the cohort `findCluster` would assemble now is every machine
|
|
103
|
+
* that could coordinate a commit to the key's block as far as this node can know — the whole
|
|
104
|
+
* serving network it knows of, this node included — and that every other member is connected to
|
|
105
|
+
* this node, with the connection run each is on (see {@link ConnectedCohort}). Answers from what
|
|
106
|
+
* the node already holds, without dialing or opening a stream.
|
|
107
|
+
*
|
|
108
|
+
* `undefined` means no such guarantee: the cohort is a selection from a wider network, a peer is
|
|
109
|
+
* not yet identified or is remembered but absent, a member is not connected, or the
|
|
110
|
+
* implementation cannot judge. Implementations that track no connections omit this, which reads
|
|
111
|
+
* the same, so a caller then behaves as if the method did not exist.
|
|
112
|
+
*/
|
|
113
|
+
connectedCohort?(key: RoutingKey): Promise<ConnectedCohort | undefined>;
|
|
84
114
|
}
|