@optimystic/db-core 1.21.0 → 1.23.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 +8 -4
- package/dist/src/btree/btree.d.ts +36 -4
- package/dist/src/btree/btree.d.ts.map +1 -1
- package/dist/src/btree/btree.js +86 -18
- package/dist/src/btree/btree.js.map +1 -1
- package/dist/src/collection/action.d.ts +7 -4
- package/dist/src/collection/action.d.ts.map +1 -1
- package/dist/src/collection/action.js +13 -5
- package/dist/src/collection/action.js.map +1 -1
- package/dist/src/collection/collection.d.ts +177 -51
- package/dist/src/collection/collection.d.ts.map +1 -1
- package/dist/src/collection/collection.js +265 -81
- package/dist/src/collection/collection.js.map +1 -1
- package/dist/src/collection/struct.d.ts +44 -8
- package/dist/src/collection/struct.d.ts.map +1 -1
- package/dist/src/collection/struct.js.map +1 -1
- package/dist/src/collection/write-attempts.d.ts +138 -34
- package/dist/src/collection/write-attempts.d.ts.map +1 -1
- package/dist/src/collection/write-attempts.js +168 -101
- package/dist/src/collection/write-attempts.js.map +1 -1
- package/dist/src/collections/diary/diary.d.ts.map +1 -1
- package/dist/src/collections/diary/diary.js +5 -1
- package/dist/src/collections/diary/diary.js.map +1 -1
- package/dist/src/collections/tree/tree.d.ts +18 -10
- package/dist/src/collections/tree/tree.d.ts.map +1 -1
- package/dist/src/collections/tree/tree.js +17 -9
- package/dist/src/collections/tree/tree.js.map +1 -1
- package/dist/src/hlc/clock-store.d.ts +63 -0
- package/dist/src/hlc/clock-store.d.ts.map +1 -0
- package/dist/src/hlc/clock-store.js +49 -0
- package/dist/src/hlc/clock-store.js.map +1 -0
- package/dist/src/hlc/clock.d.ts +64 -0
- package/dist/src/hlc/clock.d.ts.map +1 -0
- package/dist/src/hlc/clock.js +171 -0
- package/dist/src/hlc/clock.js.map +1 -0
- package/dist/src/hlc/hlc.d.ts +38 -0
- package/dist/src/hlc/hlc.d.ts.map +1 -0
- package/dist/src/hlc/hlc.js +41 -0
- package/dist/src/hlc/hlc.js.map +1 -0
- package/dist/src/hlc/index.d.ts +5 -0
- package/dist/src/hlc/index.d.ts.map +1 -0
- package/dist/src/hlc/index.js +5 -0
- package/dist/src/hlc/index.js.map +1 -0
- package/dist/src/hlc/skew.d.ts +35 -0
- package/dist/src/hlc/skew.d.ts.map +1 -0
- package/dist/src/hlc/skew.js +35 -0
- package/dist/src/hlc/skew.js.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/lane/index.d.ts +2 -0
- package/dist/src/lane/index.d.ts.map +1 -0
- package/dist/src/lane/index.js +2 -0
- package/dist/src/lane/index.js.map +1 -0
- package/dist/src/lane/lane.d.ts +46 -0
- package/dist/src/lane/lane.d.ts.map +1 -0
- package/dist/src/lane/lane.js +26 -0
- package/dist/src/lane/lane.js.map +1 -0
- package/dist/src/log/log.d.ts +50 -22
- package/dist/src/log/log.d.ts.map +1 -1
- package/dist/src/log/log.js +21 -13
- package/dist/src/log/log.js.map +1 -1
- package/dist/src/log/struct.d.ts +61 -1
- package/dist/src/log/struct.d.ts.map +1 -1
- package/dist/src/log/struct.js +24 -0
- package/dist/src/log/struct.js.map +1 -1
- package/dist/src/network/i-repo.d.ts +10 -0
- package/dist/src/network/i-repo.d.ts.map +1 -1
- package/dist/src/network/stale-failure.d.ts +20 -7
- package/dist/src/network/stale-failure.d.ts.map +1 -1
- package/dist/src/network/stale-failure.js +29 -7
- package/dist/src/network/stale-failure.js.map +1 -1
- package/dist/src/network/struct.d.ts +50 -0
- package/dist/src/network/struct.d.ts.map +1 -1
- package/dist/src/network/struct.js.map +1 -1
- package/dist/src/offline/entry.d.ts +14 -0
- package/dist/src/offline/entry.d.ts.map +1 -1
- package/dist/src/offline/entry.js +2 -0
- package/dist/src/offline/entry.js.map +1 -1
- package/dist/src/offline/journal.d.ts +10 -0
- package/dist/src/offline/journal.d.ts.map +1 -1
- package/dist/src/offline/queue.d.ts +10 -0
- package/dist/src/offline/queue.d.ts.map +1 -1
- package/dist/src/offline/queue.js +29 -3
- package/dist/src/offline/queue.js.map +1 -1
- package/dist/src/offline/status.d.ts +7 -0
- package/dist/src/offline/status.d.ts.map +1 -1
- package/dist/src/offline/status.js.map +1 -1
- package/dist/src/testing/test-transactor.d.ts +9 -1
- package/dist/src/testing/test-transactor.d.ts.map +1 -1
- package/dist/src/testing/test-transactor.js +12 -3
- package/dist/src/testing/test-transactor.js.map +1 -1
- package/dist/src/transaction/actions-engine.d.ts +3 -0
- package/dist/src/transaction/actions-engine.d.ts.map +1 -1
- package/dist/src/transaction/actions-engine.js +3 -0
- package/dist/src/transaction/actions-engine.js.map +1 -1
- package/dist/src/transaction/coordinator.d.ts +16 -5
- package/dist/src/transaction/coordinator.d.ts.map +1 -1
- package/dist/src/transaction/coordinator.js +203 -48
- package/dist/src/transaction/coordinator.js.map +1 -1
- package/dist/src/transaction/entry-commit.d.ts +45 -10
- package/dist/src/transaction/entry-commit.d.ts.map +1 -1
- package/dist/src/transaction/entry-commit.js +20 -7
- package/dist/src/transaction/entry-commit.js.map +1 -1
- package/dist/src/transaction/errors.d.ts +69 -1
- package/dist/src/transaction/errors.d.ts.map +1 -1
- package/dist/src/transaction/errors.js +70 -1
- package/dist/src/transaction/errors.js.map +1 -1
- package/dist/src/transaction/index.d.ts +1 -1
- package/dist/src/transaction/index.d.ts.map +1 -1
- package/dist/src/transaction/index.js +1 -1
- package/dist/src/transaction/index.js.map +1 -1
- package/dist/src/transaction/session.d.ts.map +1 -1
- package/dist/src/transaction/session.js +18 -5
- package/dist/src/transaction/session.js.map +1 -1
- package/dist/src/transaction/transaction.d.ts +74 -15
- package/dist/src/transaction/transaction.d.ts.map +1 -1
- package/dist/src/transaction/transaction.js +35 -15
- package/dist/src/transaction/transaction.js.map +1 -1
- package/dist/src/transaction/validator.d.ts +25 -4
- package/dist/src/transaction/validator.d.ts.map +1 -1
- package/dist/src/transaction/validator.js +45 -5
- package/dist/src/transaction/validator.js.map +1 -1
- package/dist/src/transactor/block-floors.d.ts +12 -1
- package/dist/src/transactor/block-floors.d.ts.map +1 -1
- package/dist/src/transactor/block-floors.js +14 -1
- package/dist/src/transactor/block-floors.js.map +1 -1
- package/dist/src/transactor/network-transactor.d.ts +8 -0
- package/dist/src/transactor/network-transactor.d.ts.map +1 -1
- package/dist/src/transactor/network-transactor.js +9 -4
- package/dist/src/transactor/network-transactor.js.map +1 -1
- package/dist/src/transactor/transactor-source.d.ts +11 -0
- package/dist/src/transactor/transactor-source.d.ts.map +1 -1
- package/dist/src/transactor/transactor-source.js +5 -1
- package/dist/src/transactor/transactor-source.js.map +1 -1
- package/dist/src/transactor/transactor.d.ts +8 -0
- package/dist/src/transactor/transactor.d.ts.map +1 -1
- package/dist/src/transform/cache-source.d.ts +7 -0
- package/dist/src/transform/cache-source.d.ts.map +1 -1
- package/dist/src/transform/cache-source.js +14 -18
- package/dist/src/transform/cache-source.js.map +1 -1
- package/package.json +1 -1
- package/src/btree/btree.ts +92 -18
- package/src/collection/action.ts +13 -5
- package/src/collection/collection.ts +3272 -3039
- package/src/collection/struct.ts +493 -456
- package/src/collection/write-attempts.ts +213 -109
- package/src/collections/diary/diary.ts +5 -1
- package/src/collections/tree/tree.ts +33 -18
- package/src/hlc/clock-store.ts +68 -0
- package/src/hlc/clock.ts +196 -0
- package/src/hlc/hlc.ts +56 -0
- package/src/hlc/index.ts +4 -0
- package/src/hlc/skew.ts +55 -0
- package/src/index.ts +2 -0
- package/src/lane/index.ts +1 -0
- package/src/lane/lane.ts +54 -0
- package/src/log/log.ts +341 -310
- package/src/log/struct.ts +62 -1
- package/src/network/i-repo.ts +11 -1
- package/src/network/stale-failure.ts +31 -7
- package/src/network/struct.ts +50 -0
- package/src/offline/entry.ts +16 -0
- package/src/offline/journal.ts +10 -0
- package/src/offline/queue.ts +38 -4
- package/src/offline/status.ts +7 -0
- package/src/testing/test-transactor.ts +1065 -1050
- package/src/transaction/actions-engine.ts +3 -0
- package/src/transaction/coordinator.ts +235 -54
- package/src/transaction/entry-commit.ts +56 -14
- package/src/transaction/errors.ts +60 -0
- package/src/transaction/index.ts +1 -1
- package/src/transaction/session.ts +18 -5
- package/src/transaction/transaction.ts +90 -17
- package/src/transaction/validator.ts +46 -5
- package/src/transactor/block-floors.ts +15 -1
- package/src/transactor/network-transactor.ts +1908 -1896
- package/src/transactor/transactor-source.ts +15 -1
- package/src/transactor/transactor.ts +9 -0
- package/src/transform/cache-source.ts +15 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../src/log/log.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAW,MAAM,mBAAmB,CAAC;AAEnD,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC9J,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,QAAQ,EAAe,sBAAsB,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGlH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../src/log/log.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAW,MAAM,mBAAmB,CAAC;AAEnD,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC9J,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE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AO,CAAC,iBAAiB,EAAE,CAAC;IActF,0CAA0C;IACpC,gBAAgB,IAAI,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC;IAiB5D,wEAAwE;IAClE,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IA+C5E,oJAAoJ;IAC7I,MAAM,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE,OAAO,UAAO;IAMrE,6GAA6G;YAC/F,cAAc;IAc5B,+EAA+E;YACjE,WAAW;IAWzB;;;;;oGAKgG;IAChG,MAAM,CAAC,eAAe,CAAC,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE,cAAc,CAAC,EAAE,MAAM,OAAO,GAanF,gBAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;CAGzC"}
|
package/dist/src/log/log.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { sha256 } from 'multiformats/hashes/sha2';
|
|
2
2
|
import { Chain, entryAt } from "../chain/chain.js";
|
|
3
3
|
import { nameof } from "../utility/nameof.js";
|
|
4
|
-
import { LogDataBlockType, LogHeaderBlockType } from "./struct.js";
|
|
4
|
+
import { LogDataBlockType, LogHeaderBlockType, hlcOf } from "./struct.js";
|
|
5
5
|
import { toString as uint8ArrayToString } from 'uint8arrays/to-string';
|
|
6
|
+
import { maxHlc } from '../hlc/hlc.js';
|
|
6
7
|
import { BLOCK_TARGET_BYTES } from '../network/block-size.js';
|
|
7
8
|
export const priorHash$ = nameof("priorHash");
|
|
8
9
|
/**
|
|
@@ -55,22 +56,24 @@ export class Log {
|
|
|
55
56
|
* Adds a new action entry to the log.
|
|
56
57
|
*
|
|
57
58
|
* See {@link AddActionsOptions} for what the trailing options carry, and in particular why a
|
|
58
|
-
* writer that may retry passes its own `timestamp` rather than letting each attempt
|
|
59
|
+
* writer that may retry passes its own `hlc` and `timestamp` rather than letting each attempt
|
|
60
|
+
* take its own.
|
|
59
61
|
*/
|
|
60
62
|
async addActions(actions, actionId, rev, getBlockIds, options) {
|
|
61
|
-
const { collectionIds = [], reads, timestamp = Date.now() } = options
|
|
63
|
+
const { collectionIds = [], reads, hlc, lane, timestamp = Date.now() } = options;
|
|
62
64
|
const action = reads !== undefined
|
|
63
|
-
? { actionId, actions, blockIds: [], collectionIds, reads }
|
|
64
|
-
: { actionId, actions, blockIds: [], collectionIds };
|
|
65
|
-
const entry = { timestamp, rev, action };
|
|
65
|
+
? { actionId, actions, blockIds: [], collectionIds, lane, reads }
|
|
66
|
+
: { actionId, actions, blockIds: [], collectionIds, lane };
|
|
67
|
+
const entry = { timestamp, hlc, rev, action };
|
|
66
68
|
const tailPath = await this.chain.add(entry);
|
|
67
69
|
const entryWithBlockIds = { ...entry, action: { ...entry.action, blockIds: getBlockIds() } };
|
|
68
70
|
this.chain.updateAt(tailPath, entryWithBlockIds);
|
|
69
71
|
return { entry: entryWithBlockIds, tailPath };
|
|
70
72
|
}
|
|
71
|
-
/** Adds a checkpoint to the log. */
|
|
72
|
-
async addCheckpoint(pendings, rev,
|
|
73
|
-
const
|
|
73
|
+
/** Adds a checkpoint to the log, under the write's {@link EntryTimes}. */
|
|
74
|
+
async addCheckpoint(pendings, rev, times) {
|
|
75
|
+
const { hlc, timestamp = Date.now() } = times;
|
|
76
|
+
const entry = { timestamp, hlc, rev, checkpoint: { pendings } };
|
|
74
77
|
const tailPath = await this.chain.add(entry);
|
|
75
78
|
return { entry, tailPath };
|
|
76
79
|
}
|
|
@@ -79,13 +82,15 @@ export class Log {
|
|
|
79
82
|
* invalid by dispute. The committed history is never rewritten — this is a new, append-only,
|
|
80
83
|
* prior-hash-linked entry, recoverable on sync exactly like a commit. The caller has already
|
|
81
84
|
* verified `resolution` is a challenger-wins certificate and computed the per-block `reverted`
|
|
82
|
-
* targets (the new revisions restoring the as-if-`T_inv`-absent content).
|
|
85
|
+
* targets (the new revisions restoring the as-if-`T_inv`-absent content). The entry carries the
|
|
86
|
+
* applying node's {@link EntryTimes} like every other entry kind.
|
|
83
87
|
*/
|
|
84
|
-
async addInvalidation(invalidatedActionId, invalidatedRev, resolution, reverted, rev,
|
|
88
|
+
async addInvalidation(invalidatedActionId, invalidatedRev, resolution, reverted, rev, options) {
|
|
89
|
+
const { hlc, timestamp = Date.now(), cascadeRoot } = options;
|
|
85
90
|
const invalidation = cascadeRoot !== undefined
|
|
86
91
|
? { invalidatedActionId, invalidatedRev, resolution, reverted, cascadeRoot }
|
|
87
92
|
: { invalidatedActionId, invalidatedRev, resolution, reverted };
|
|
88
|
-
const entry = { timestamp, rev, invalidation };
|
|
93
|
+
const entry = { timestamp, hlc, rev, invalidation };
|
|
89
94
|
const tailPath = await this.chain.add(entry);
|
|
90
95
|
return { entry, tailPath };
|
|
91
96
|
}
|
|
@@ -151,9 +156,11 @@ export class Log {
|
|
|
151
156
|
let checkpointPendings = [];
|
|
152
157
|
let rev;
|
|
153
158
|
let checkpointPath;
|
|
159
|
+
let hlcHighWater;
|
|
154
160
|
// Step through collecting both pending and entries until a checkpoint is found
|
|
155
161
|
for await (const path of this.chain.select(undefined, false)) {
|
|
156
162
|
const entry = entryAt(path);
|
|
163
|
+
hlcHighWater = maxHlc(hlcHighWater, hlcOf(entry));
|
|
157
164
|
rev = rev ?? entry.rev;
|
|
158
165
|
if (entry.checkpoint) {
|
|
159
166
|
checkpointPath = path;
|
|
@@ -175,6 +182,7 @@ export class Log {
|
|
|
175
182
|
if (checkpointPath) {
|
|
176
183
|
for await (const path of this.chain.select(checkpointPath, false)) {
|
|
177
184
|
const entry = entryAt(path);
|
|
185
|
+
hlcHighWater = maxHlc(hlcHighWater, hlcOf(entry));
|
|
178
186
|
if (startRev !== undefined && entry.rev > startRev) {
|
|
179
187
|
if (entry.action) {
|
|
180
188
|
entriesFromCheckpoint.push(entry.action);
|
|
@@ -187,7 +195,7 @@ export class Log {
|
|
|
187
195
|
}
|
|
188
196
|
const pendings = [...checkpointPendings, ...pendingActions.reverse()];
|
|
189
197
|
const entries = [...entriesFromCheckpoint.reverse(), ...entriesFromTail.reverse()];
|
|
190
|
-
return { context: rev ? { committed: pendings, rev } : undefined, entries };
|
|
198
|
+
return { context: rev ? { committed: pendings, rev } : undefined, entries, hlcHighWater };
|
|
191
199
|
}
|
|
192
200
|
/** Enumerates log entries from the given starting path or end if undefined, in forward (from tail to head) or reverse (from head to tail) order. */
|
|
193
201
|
async *select(starting, forward = true) {
|
package/dist/src/log/log.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../../src/log/log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAI9C,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../../src/log/log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAI9C,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAEtE,OAAO,EAAE,MAAM,EAAY,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAQ9D,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAgB,WAAW,CAAC,CAAC;AA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,kBAAkB,EAAE,EAAE,CAAC,EAAE,CAAC;YAClG,QAAQ,EAAE,KAAK,EAAE,OAA0B,EAAE,OAAsC,EAAE,EAAE;gBACtF,IAAI,OAAO,EAAE,CAAC;oBACb,gFAAgF;oBAChF,8EAA8E;oBAC9E,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;oBACzG,OAAO,CAAC,SAAS,GAAG,kBAAkB,CAAC,IAAI,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;gBAClE,CAAC;YACF,CAAC;SACsC,CAAC;IAE1C,CAAC;CACD"}
|
package/dist/src/log/struct.d.ts
CHANGED
|
@@ -1,8 +1,23 @@
|
|
|
1
1
|
import type { BlockId, CollectionId, ActionContext, ActionId, ActionRev, ReadDependency } from "../index.js";
|
|
2
|
+
import { type Hlc } from "../hlc/hlc.js";
|
|
3
|
+
import type { Lane } from "../lane/lane.js";
|
|
2
4
|
/** A log entry - an action, a checkpoint, or an invalidation */
|
|
3
5
|
export type LogEntry<TAction> = {
|
|
4
|
-
/**
|
|
6
|
+
/** The wall-clock time the writer's clock read when it wrote the entry. Informational: nothing
|
|
7
|
+
* orders by it. Kept beside {@link hlc}, which is a second fact, not this one twice — its `wallMs`
|
|
8
|
+
* is at or above this and may be a future time after the writer's clock observed a jump. */
|
|
5
9
|
readonly timestamp: number;
|
|
10
|
+
/**
|
|
11
|
+
* The hybrid logical clock value the writer minted for the write this entry records
|
|
12
|
+
* (docs/crdt-sync.md §Migration Path, Stage 1). Minted once per write and re-sent verbatim by
|
|
13
|
+
* every retry, like {@link timestamp}; one value for every entry of a multi-collection write.
|
|
14
|
+
* Nothing orders by it yet — the revision is the order within a collection — but it is what a
|
|
15
|
+
* later merge of divergent histories orders by, and the entry is the unit such a merge orders.
|
|
16
|
+
*
|
|
17
|
+
* Every entry this build writes carries it. A STORED entry written before the field existed lacks
|
|
18
|
+
* it; read an entry's HLC through {@link hlcOf}, never off the field.
|
|
19
|
+
*/
|
|
20
|
+
readonly hlc: Hlc;
|
|
6
21
|
/** Revision number - monotonically increasing from the prior entry's rev. Starts at 1. */
|
|
7
22
|
readonly rev: number;
|
|
8
23
|
readonly action?: ActionEntry<TAction>;
|
|
@@ -20,6 +35,20 @@ export type ActionEntry<TAction> = {
|
|
|
20
35
|
blockIds: BlockId[];
|
|
21
36
|
/** Other collection ids affected by the action - this action is conditional on successful commit in all of these collections */
|
|
22
37
|
readonly collectionIds?: CollectionId[];
|
|
38
|
+
/**
|
|
39
|
+
* The write's lane (`Lane` in `packages/db-core/src/lane/lane.ts`): whether its conflicts with
|
|
40
|
+
* other machines' concurrent writes are decided by the quorum and the revision order
|
|
41
|
+
* (`serializable`) or may be merged later under the collection's declaration (`convergent`).
|
|
42
|
+
* Minted once per write beside the action id, timestamp and HLC (`WriteIdentity.lane`,
|
|
43
|
+
* `Transaction.lane`), and re-sent verbatim by every retry; one lane for every entry of a
|
|
44
|
+
* multi-collection write. On the action entry rather than the log entry because a checkpoint has
|
|
45
|
+
* no lane and an invalidation reverses an action under the strong rules. Nothing admits by it yet.
|
|
46
|
+
*
|
|
47
|
+
* Every entry this build writes carries it. A STORED entry written before the field existed lacks
|
|
48
|
+
* it (every write then was serializable); read an entry's lane through {@link laneOf}, never off
|
|
49
|
+
* the field.
|
|
50
|
+
*/
|
|
51
|
+
readonly lane: Lane;
|
|
23
52
|
/**
|
|
24
53
|
* The `(blockId, revision)` reads this transaction observed during execution — the same
|
|
25
54
|
* read set the {@link Transaction} carried in its PEND request (see `Transaction.reads`).
|
|
@@ -148,10 +177,41 @@ export type CheckpointEntry = {
|
|
|
148
177
|
* - missing from the set are the implicitly checkpointed ones */
|
|
149
178
|
readonly pendings: ActionRev[];
|
|
150
179
|
};
|
|
180
|
+
/**
|
|
181
|
+
* The one reader rule for an entry's HLC: the field when the entry carries one, else the legacy
|
|
182
|
+
* value derived from its timestamp (`legacyHlc`: the wall time, no logical count, the empty node
|
|
183
|
+
* id). The parameter admits an absent field because a stored entry written before the field existed
|
|
184
|
+
* has none, whatever {@link LogEntry} declares about the entries this build writes.
|
|
185
|
+
*/
|
|
186
|
+
export declare function hlcOf(entry: {
|
|
187
|
+
readonly timestamp: number;
|
|
188
|
+
readonly hlc?: Hlc;
|
|
189
|
+
}): Hlc;
|
|
190
|
+
/**
|
|
191
|
+
* The one reader rule for an action entry's lane: the field when the entry carries one, else
|
|
192
|
+
* `serializable`, since every write made before the field existed took the quorum lane. The
|
|
193
|
+
* parameter admits an absent field because a stored entry written before the field existed has
|
|
194
|
+
* none, whatever {@link ActionEntry} declares about the entries this build writes.
|
|
195
|
+
*
|
|
196
|
+
* NOTE: `ActionEntry.lane` is declared required while a stored legacy entry lacks it, so a reader
|
|
197
|
+
* that takes the field directly compiles and meets `undefined` on such an entry — the same tripwire
|
|
198
|
+
* `hlcOf` records for `LogEntry.hlc`. Read through here. Splitting the stored and written shapes
|
|
199
|
+
* into two types was declined for one reader; if a second direct reader ever appears, split then.
|
|
200
|
+
*/
|
|
201
|
+
export declare function laneOf(entry: {
|
|
202
|
+
readonly lane?: Lane;
|
|
203
|
+
}): Lane;
|
|
151
204
|
export declare const LogDataBlockType = "LGD";
|
|
152
205
|
export declare const LogHeaderBlockType = "LGH";
|
|
153
206
|
export type GetFromResult<TAction> = {
|
|
154
207
|
context: ActionContext | undefined;
|
|
155
208
|
entries: ActionEntry<TAction>[];
|
|
209
|
+
/**
|
|
210
|
+
* The highest HLC ({@link hlcOf}) among every entry the walk read — action, checkpoint and
|
|
211
|
+
* invalidation entries alike, the ones below `startRev` it read to find its way included — so the
|
|
212
|
+
* reader's clock can observe it (docs/crdt-sync.md §Migration Path, Stage 1). One value rather than
|
|
213
|
+
* one per entry, since the clock keeps only a maximum. Absent when the walk read no entry.
|
|
214
|
+
*/
|
|
215
|
+
hlcHighWater?: Hlc;
|
|
156
216
|
};
|
|
157
217
|
//# sourceMappingURL=struct.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"struct.d.ts","sourceRoot":"","sources":["../../../src/log/struct.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"struct.d.ts","sourceRoot":"","sources":["../../../src/log/struct.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7G,OAAO,EAAa,KAAK,GAAG,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE5C,gEAAgE;AAChE,MAAM,MAAM,QAAQ,CAAC,OAAO,IAAI;IAC/B;;gGAE4F;IAC5F,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;;;;;;;;;OASG;IACH,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC;IAClB,2FAA2F;IAC3F,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IACvC,QAAQ,CAAC,UAAU,CAAC,EAAE,eAAe,CAAC;IACtC,kGAAkG;IAClG,QAAQ,CAAC,YAAY,CAAC,EAAE,iBAAiB,CAAC;CAC1C,CAAC;AAEF,+DAA+D;AAC/D,MAAM,MAAM,WAAW,CAAC,OAAO,IAAI;IAClC,iDAAiD;IACjD,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,4BAA4B;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC;IAC5B,yEAAyE;IACzE,QAAQ,EAAE,O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C,EAAE,CAAC;IAChC;;;;;OAKG;IACH,YAAY,CAAC,EAAE,GAAG,CAAC;CACnB,CAAC"}
|
package/dist/src/log/struct.js
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
import { legacyHlc } from "../hlc/hlc.js";
|
|
2
|
+
/**
|
|
3
|
+
* The one reader rule for an entry's HLC: the field when the entry carries one, else the legacy
|
|
4
|
+
* value derived from its timestamp (`legacyHlc`: the wall time, no logical count, the empty node
|
|
5
|
+
* id). The parameter admits an absent field because a stored entry written before the field existed
|
|
6
|
+
* has none, whatever {@link LogEntry} declares about the entries this build writes.
|
|
7
|
+
*/
|
|
8
|
+
export function hlcOf(entry) {
|
|
9
|
+
return entry.hlc ?? legacyHlc(entry.timestamp);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The one reader rule for an action entry's lane: the field when the entry carries one, else
|
|
13
|
+
* `serializable`, since every write made before the field existed took the quorum lane. The
|
|
14
|
+
* parameter admits an absent field because a stored entry written before the field existed has
|
|
15
|
+
* none, whatever {@link ActionEntry} declares about the entries this build writes.
|
|
16
|
+
*
|
|
17
|
+
* NOTE: `ActionEntry.lane` is declared required while a stored legacy entry lacks it, so a reader
|
|
18
|
+
* that takes the field directly compiles and meets `undefined` on such an entry — the same tripwire
|
|
19
|
+
* `hlcOf` records for `LogEntry.hlc`. Read through here. Splitting the stored and written shapes
|
|
20
|
+
* into two types was declined for one reader; if a second direct reader ever appears, split then.
|
|
21
|
+
*/
|
|
22
|
+
export function laneOf(entry) {
|
|
23
|
+
return entry.lane ?? 'serializable';
|
|
24
|
+
}
|
|
1
25
|
export const LogDataBlockType = "LGD";
|
|
2
26
|
export const LogHeaderBlockType = "LGH";
|
|
3
27
|
//# sourceMappingURL=struct.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"struct.js","sourceRoot":"","sources":["../../../src/log/struct.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"struct.js","sourceRoot":"","sources":["../../../src/log/struct.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAY,MAAM,eAAe,CAAC;AA0LpD;;;;;GAKG;AACH,MAAM,UAAU,KAAK,CAAC,KAAyD;IAC9E,OAAO,KAAK,CAAC,GAAG,IAAI,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AAChD,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,MAAM,CAAC,KAA+B;IACrD,OAAO,KAAK,CAAC,IAAI,IAAI,cAAc,CAAC;AACrC,CAAC;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAC;AACtC,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ActionBlocks, BlockContentDigests, CommitResult, GetBlockResults, PendResult, PendRequest, BlockGets, BlockId, ActionId } from "../index.js";
|
|
2
|
+
import type { Lane } from "../lane/lane.js";
|
|
2
3
|
export type MessageOptions = {
|
|
3
4
|
expiration?: number;
|
|
4
5
|
signal?: AbortSignal;
|
|
@@ -28,11 +29,20 @@ export type MessageOptions = {
|
|
|
28
29
|
* call, where there is no asker to stand in for.
|
|
29
30
|
*/
|
|
30
31
|
asker?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Answer a read from this node's own storage alone: no cohort consult, and no consult-derived
|
|
34
|
+
* flag. Set by every block-repair answer (an archive, a consult answer, a lineage answer), so a
|
|
35
|
+
* peer reports what it holds itself, never what its cohort says. Never sent.
|
|
36
|
+
*/
|
|
37
|
+
skipClusterFetch?: boolean;
|
|
31
38
|
};
|
|
32
39
|
export type RepoCommitRequest = {
|
|
33
40
|
blockIds: BlockId[];
|
|
34
41
|
actionId: ActionId;
|
|
35
42
|
rev: number;
|
|
43
|
+
/** The write's lane ({@link CommitRequest.lane}), carried onto every per-block commit the
|
|
44
|
+
* transactor sends; absent on bare per-block paths and for an older writer. */
|
|
45
|
+
lane?: Lane;
|
|
36
46
|
/**
|
|
37
47
|
* The collection's chain tail block id (the {@link CommitRequest.tailId}). Optional on the per-block
|
|
38
48
|
* repo operation: the transactor threads the committing collection's tail through every per-block
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i-repo.d.ts","sourceRoot":"","sources":["../../../src/network/i-repo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,YAAY,EAAE,eAAe,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"i-repo.d.ts","sourceRoot":"","sources":["../../../src/network/i-repo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,YAAY,EAAE,eAAe,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAiB,MAAM,aAAa,CAAC;AAC1K,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,MAAM,cAAc,GAAG;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;;;;;;OAQG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;OAMG;IACH,oBAAoB,CAAC,EAAE,OAAO,EAAE,CAAC;IACjC;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC/B,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,QAAQ,EAAE,QAAQ,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ;mFAC+E;IAC/E,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;;;;;OAQG;IAIH,YAAY,CAAC,EAAE,mBAAmB,CAAC;IACnC;2DACuD;IACvD,UAAU,CAAC,EAAE,IAAI,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG;IACnB,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAC9E,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAC1E,MAAM,CAAC,SAAS,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzE,MAAM,CAAC,OAAO,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IACpF;;;;;;;;;OASG;IACH,QAAQ,CAAC,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAC3F,2FAA2F;IAC3F,UAAU,CAAC,CAAC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CACrG,CAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { BlockId } from "../index.js";
|
|
1
2
|
import type { ActionId, ActionRev } from "../collection/action.js";
|
|
2
3
|
import type { ExpiredFailure, RejectedFailure, ShortfallFailure, StaleFailure, WriteFailure } from "./struct.js";
|
|
3
4
|
/**
|
|
@@ -53,15 +54,27 @@ export declare function isRejectedFailure(failure: WriteFailure): failure is Rej
|
|
|
53
54
|
* NOTE: comparing revisions across blocks is meaningful only within one collection, where every
|
|
54
55
|
* candidate comes from the same revision counter. A batch (`IRepo.pendMany` / `commitMany`) spans
|
|
55
56
|
* collections, and `CoordinatorRepo` still picks the highest across them, so its `staleAt` names the
|
|
56
|
-
* block — and so the collection — of one loser among several counters.
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* per-collection.
|
|
57
|
+
* block — and so the collection — of one loser among several counters. The multi-collection
|
|
58
|
+
* coordinator, the only writer that sends a batch, therefore attributes a batched answer's number by
|
|
59
|
+
* its block id ({@link staleAtOwner}): the collection owning `staleAt.blockId` gets the number, and
|
|
60
|
+
* every other collection of the batch is treated as refused with no confirmed number. The other
|
|
61
|
+
* collections' losses are understated by that, never overstated — a number is only ever compared
|
|
62
|
+
* against the counter it came from.
|
|
63
63
|
*/
|
|
64
64
|
export declare function highestStaleAt(candidates: readonly StaleFailure['staleAt'][]): StaleFailure['staleAt'];
|
|
65
|
+
/**
|
|
66
|
+
* The single rule for attributing a {@link StaleFailure.staleAt} that answered a request spanning
|
|
67
|
+
* several collections: the one collection whose blocks include `staleAt.blockId`, or `undefined`
|
|
68
|
+
* when no candidate owns it (a block none of them sent, or no number at all).
|
|
69
|
+
*
|
|
70
|
+
* A revision is a per-collection counter, so the number is meaningful only against the counter of
|
|
71
|
+
* the collection that owns the block it names. A request for ONE collection needs no attribution —
|
|
72
|
+
* its number is that collection's whatever block it names — so this is for the batched answer
|
|
73
|
+
* (`IRepo.pendMany` / `commitMany`), where `CoordinatorRepo` reports one number, the highest across
|
|
74
|
+
* the batch's collections ({@link highestStaleAt}), and only the owner of the named block may count
|
|
75
|
+
* it as its own.
|
|
76
|
+
*/
|
|
77
|
+
export declare function staleAtOwner<Owner>(staleAt: StaleFailure['staleAt'], blocksByOwner: ReadonlyMap<Owner, readonly BlockId[]>): Owner | undefined;
|
|
65
78
|
/**
|
|
66
79
|
* The single rule for "is the action holding this revision OUR OWN?" — true only when `latest`
|
|
67
80
|
* names exactly the revision being requested AND the same action requesting it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stale-failure.d.ts","sourceRoot":"","sources":["../../../src/network/stale-failure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,gBAAgB,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEjH;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAGhE;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,IAAI,cAAc,CAEhF;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,IAAI,gBAAgB,CAErF;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,IAAI,eAAe,CAEnF;AAED
|
|
1
|
+
{"version":3,"file":"stale-failure.d.ts","sourceRoot":"","sources":["../../../src/network/stale-failure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,gBAAgB,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEjH;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAGhE;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,IAAI,cAAc,CAEhF;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,IAAI,gBAAgB,CAErF;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,IAAI,eAAe,CAEnF;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,SAAS,YAAY,CAAC,SAAS,CAAC,EAAE,GAAG,YAAY,CAAC,SAAS,CAAC,CAQtG;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,YAAY,CAAC,SAAS,CAAC,EAAE,aAAa,EAAE,WAAW,CAAC,KAAK,EAAE,SAAS,OAAO,EAAE,CAAC,GAAG,KAAK,GAAG,SAAS,CAU9I;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAEjH"}
|
|
@@ -61,13 +61,12 @@ export function isRejectedFailure(failure) {
|
|
|
61
61
|
* NOTE: comparing revisions across blocks is meaningful only within one collection, where every
|
|
62
62
|
* candidate comes from the same revision counter. A batch (`IRepo.pendMany` / `commitMany`) spans
|
|
63
63
|
* collections, and `CoordinatorRepo` still picks the highest across them, so its `staleAt` names the
|
|
64
|
-
* block — and so the collection — of one loser among several counters.
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
* per-collection.
|
|
64
|
+
* block — and so the collection — of one loser among several counters. The multi-collection
|
|
65
|
+
* coordinator, the only writer that sends a batch, therefore attributes a batched answer's number by
|
|
66
|
+
* its block id ({@link staleAtOwner}): the collection owning `staleAt.blockId` gets the number, and
|
|
67
|
+
* every other collection of the batch is treated as refused with no confirmed number. The other
|
|
68
|
+
* collections' losses are understated by that, never overstated — a number is only ever compared
|
|
69
|
+
* against the counter it came from.
|
|
71
70
|
*/
|
|
72
71
|
export function highestStaleAt(candidates) {
|
|
73
72
|
let best;
|
|
@@ -78,6 +77,29 @@ export function highestStaleAt(candidates) {
|
|
|
78
77
|
}
|
|
79
78
|
return best;
|
|
80
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* The single rule for attributing a {@link StaleFailure.staleAt} that answered a request spanning
|
|
82
|
+
* several collections: the one collection whose blocks include `staleAt.blockId`, or `undefined`
|
|
83
|
+
* when no candidate owns it (a block none of them sent, or no number at all).
|
|
84
|
+
*
|
|
85
|
+
* A revision is a per-collection counter, so the number is meaningful only against the counter of
|
|
86
|
+
* the collection that owns the block it names. A request for ONE collection needs no attribution —
|
|
87
|
+
* its number is that collection's whatever block it names — so this is for the batched answer
|
|
88
|
+
* (`IRepo.pendMany` / `commitMany`), where `CoordinatorRepo` reports one number, the highest across
|
|
89
|
+
* the batch's collections ({@link highestStaleAt}), and only the owner of the named block may count
|
|
90
|
+
* it as its own.
|
|
91
|
+
*/
|
|
92
|
+
export function staleAtOwner(staleAt, blocksByOwner) {
|
|
93
|
+
if (staleAt === undefined) {
|
|
94
|
+
return undefined;
|
|
95
|
+
}
|
|
96
|
+
for (const [owner, blockIds] of blocksByOwner) {
|
|
97
|
+
if (blockIds.includes(staleAt.blockId)) {
|
|
98
|
+
return owner;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return undefined;
|
|
102
|
+
}
|
|
81
103
|
/**
|
|
82
104
|
* The single rule for "is the action holding this revision OUR OWN?" — true only when `latest`
|
|
83
105
|
* names exactly the revision being requested AND the same action requesting it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stale-failure.js","sourceRoot":"","sources":["../../../src/network/stale-failure.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stale-failure.js","sourceRoot":"","sources":["../../../src/network/stale-failure.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAqB;IACtD,IAAI,eAAe,CAAC,OAAO,CAAC,IAAI,kBAAkB,CAAC,OAA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,CAAC;QACd,CAAC;IACF,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,aAAa,CAAC,MAA6B,EAAE,GAAuB,EAAE,QAAkB;IACvG,OAAO,MAAM,KAAK,SAAS,IAAI,GAAG,KAAK,SAAS,IAAI,MAAM,CAAC,GAAG,KAAK,GAAG,IAAI,MAAM,CAAC,QAAQ,KAAK,QAAQ,CAAC;AACxG,CAAC"}
|
|
@@ -2,6 +2,8 @@ import type { CollectionId, BlockId, IBlock, ActionId, Transform, Transforms } f
|
|
|
2
2
|
import type { ActionContext, ActionRev } from "../collection/action.js";
|
|
3
3
|
import type { Transaction, ValidityRejection } from "../transaction/transaction.js";
|
|
4
4
|
import type { DisputeResolutionProof } from "../log/struct.js";
|
|
5
|
+
import type { Hlc } from "../hlc/hlc.js";
|
|
6
|
+
import type { Lane } from "../lane/lane.js";
|
|
5
7
|
import type { PeerId } from "./types.js";
|
|
6
8
|
export type ActionBlocks = {
|
|
7
9
|
blockIds: BlockId[];
|
|
@@ -49,6 +51,31 @@ export type PendRequest = ActionTransforms & {
|
|
|
49
51
|
};
|
|
50
52
|
/** For multi-collection transactions: supercluster nominees for consensus */
|
|
51
53
|
superclusterNominees?: PeerId[];
|
|
54
|
+
/**
|
|
55
|
+
* The HLC of the write this pend carries (`LogEntry.hlc`, `Transaction.hlc`): the same value the
|
|
56
|
+
* log entry inside `transforms` carries, put here so a storage node observes the HLC of every
|
|
57
|
+
* write it stores without parsing log blocks out of transforms (docs/crdt-sync.md §Migration
|
|
58
|
+
* Path, Stage 1). The writer always sets it (`TransactorSource.transact`,
|
|
59
|
+
* `TransactionCoordinator.pendRequestFor`); optional on the wire because an older writer sends
|
|
60
|
+
* none, and because the re-send of a retained attempt has none at hand. Observational: a member
|
|
61
|
+
* reads it into its clock and never judges the pend by it. Omitted rather than `undefined`, for
|
|
62
|
+
* the same preimage reason as {@link baseRevs}.
|
|
63
|
+
*/
|
|
64
|
+
hlc?: Hlc;
|
|
65
|
+
/**
|
|
66
|
+
* The lane of the write this pend carries (`ActionEntry.lane`, `Transaction.lane`): whether its
|
|
67
|
+
* conflicts with concurrent writes are the quorum's to decide (`serializable`) or may be merged
|
|
68
|
+
* later under the collection's declaration (`convergent`) — see `Lane` in
|
|
69
|
+
* `packages/db-core/src/lane/lane.ts`. The same value the log entry inside `transforms` carries,
|
|
70
|
+
* put here so a storage node reads it without parsing log blocks. Every writer of this build sets
|
|
71
|
+
* it (`TransactorSource.transact`, `TransactionCoordinator.pendRequestFor`); optional on the wire
|
|
72
|
+
* because an older writer sends none. A reader treats absence as "not stated", never as a lane.
|
|
73
|
+
* Observational: nothing judges the pend by it — a validating member checks the lane the
|
|
74
|
+
* transaction inside {@link validation} claims (`TransactionValidator.validate`) — and the
|
|
75
|
+
* coordinator's solo log lines report it. Omitted rather than `undefined`, for the same preimage
|
|
76
|
+
* reason as {@link baseRevs}.
|
|
77
|
+
*/
|
|
78
|
+
lane?: Lane;
|
|
52
79
|
/**
|
|
53
80
|
* Aged, advisory retry priority for a pend that carries no transaction (default 0 when absent).
|
|
54
81
|
* A validated multi-collection pend instead carries priority on the transaction inside
|
|
@@ -438,6 +465,14 @@ export type CommitRequest = ActionBlocks & {
|
|
|
438
465
|
* {@link blockDigests} is.
|
|
439
466
|
*/
|
|
440
467
|
refuseSolo?: true;
|
|
468
|
+
/**
|
|
469
|
+
* {@link PendRequest.lane}, on the commit, so a coordinator handling the commit reads the write's
|
|
470
|
+
* lane with no memory of the pend. Carried through every per-coordinator rebuild of the commit
|
|
471
|
+
* (`repoCommitRequest` in `NetworkTransactor`); optional on the wire for an older writer, and
|
|
472
|
+
* absence is "not stated". Omitted rather than `undefined`, for the preimage reason
|
|
473
|
+
* {@link blockDigests} is.
|
|
474
|
+
*/
|
|
475
|
+
lane?: Lane;
|
|
441
476
|
};
|
|
442
477
|
/**
|
|
443
478
|
* Originates a compensating invalidation through the same critical-cluster consensus as any
|
|
@@ -535,6 +570,21 @@ export type BlockGets = {
|
|
|
535
570
|
* reads as `unknown`. Asked only by a writer deciding whether its own superseded write is saved
|
|
536
571
|
* (`ITransactor.getLineage`); an ordinary read never sets it. */
|
|
537
572
|
lineageOf?: ActionRev;
|
|
573
|
+
/** The asker does not want this read to start the read-repair consult that the lazy window alone
|
|
574
|
+
* would run BEHIND the read: a held block whose window has expired (or that the lazy mode's
|
|
575
|
+
* `readRepairSampleRate` picked for a re-check) is answered from the answering repo's own copy and
|
|
576
|
+
* no cohort consult is started for it. An effort hint, never a correctness one —
|
|
577
|
+
* the doubt an earlier consult recorded still stamps `unconfirmedAheadRev`, and the window's
|
|
578
|
+
* freshness stamp is untouched, so the next read without the flag consults as before.
|
|
579
|
+
*
|
|
580
|
+
* It never skips a consult whose answer the read depends on: a block missing locally (the absence
|
|
581
|
+
* verdict), a held block whose read carries a floor above it ({@link floors}), and every consult
|
|
582
|
+
* under `'paranoid'` read-repair still run and still block. Whole-read, so `NetworkTransactor.get`
|
|
583
|
+
* forwards it on every batch: a remote coordinator also skips its own background consult. A peer
|
|
584
|
+
* that predates the field ignores it and consults as before. Meant for the node's watch tick,
|
|
585
|
+
* through `Collection.readCommittedTails`, which reads every watched tail on a timer. Distinct from
|
|
586
|
+
* `skipClusterFetch`, the sync protocol's guard, which skips every consult and never flags. */
|
|
587
|
+
skipWindowConsult?: true;
|
|
538
588
|
};
|
|
539
589
|
/**
|
|
540
590
|
* Whether a block's current content was BUILT FROM a given committed `(actionId, rev)` — the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"struct.d.ts","sourceRoot":"","sources":["../../../src/network/struct.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAClG,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;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AAC,EAAE,YAAY,CAAC;CACvB,CAAC;AAEF;;;;;GAKG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;IACnC,QAAQ,CAAC,OAAO,EAAE,OAAO;IAAE,QAAQ,CAAC,MAAM,EAAE,sBAAsB;gBAAzD,OAAO,EAAE,OAAO,EAAW,MAAM,EAAE,sBAAsB;CAI9E;AAED;;;;;;;GAOG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;IACrC,QAAQ,CAAC,OAAO,EAAE,OAAO;IAAE,QAAQ,CAAC,UAAU,EAAE,MAAM;gBAA7C,OAAO,EAAE,OAAO,EAAW,UAAU,EAAE,MAAM;CAIlE;AAED,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;AAE9D;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAClC,gCAAgC;IAChC,KAAK,EAAE,OAAO,CAAC;IACf,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qGAAqG;IACrG,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAC7B,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAChC,WAAW,EAAE,WAAW,EACxB,cAAc,EAAE,MAAM,KAClB,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAGnC,2CAA2C;AAC3C,MAAM,MAAM,SAAS,GAAG,YAAY,CAAC;AACrC,+CAA+C;AAC/C,MAAM,MAAM,aAAa,GAAG,gBAAgB,CAAC;AAC7C,8CAA8C;AAC9C,MAAM,MAAM,YAAY,GAAG,eAAe,CAAC;AAC3C,4CAA4C;AAC5C,MAAM,MAAM,UAAU,GAAG,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"struct.js","sourceRoot":"","sources":["../../../src/network/struct.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"struct.js","sourceRoot":"","sources":["../../../src/network/struct.ts"],"names":[],"mappings":"AAiuBA;;;;;GAKG;AACH,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAC1B;IAA2B;IAAhD,YAAqB,OAAgB,EAAW,MAA8B;QAC7E,KAAK,CAAC,SAAS,OAAO,oBAAoB,MAAM,mDAAmD,CAAC,CAAC;QADjF,YAAO,GAAP,OAAO,CAAS;QAAW,WAAM,GAAN,MAAM,CAAwB;QAE7E,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;IACrC,CAAC;CACD;AAED;;;;;;;GAOG;AACH,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IAC5B;IAA2B;IAAhD,YAAqB,OAAgB,EAAW,UAAkB;QACjE,KAAK,CAAC,SAAS,OAAO,4CAA4C,UAAU,wDAAwD,CAAC,CAAC;QADlH,YAAO,GAAP,OAAO,CAAS;QAAW,eAAU,GAAV,UAAU,CAAQ;QAEjE,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;IACvC,CAAC;CACD"}
|
|
@@ -3,6 +3,8 @@ import type { Collection } from '../collection/collection.js';
|
|
|
3
3
|
import type { EntryId } from '../collection/segments.js';
|
|
4
4
|
import type { CollectionId, InFlightAttempt } from '../collection/struct.js';
|
|
5
5
|
import type { WriteDurability } from '../network/struct.js';
|
|
6
|
+
import type { Hlc } from '../hlc/hlc.js';
|
|
7
|
+
import type { Lane } from '../lane/lane.js';
|
|
6
8
|
import type { CommittedEffect, EntryStatus, EntryWaitingFor, QueuedEntry } from './status.js';
|
|
7
9
|
import type { JournalDriveState } from './journal.js';
|
|
8
10
|
/** One queued entry, as `OfflineQueue` holds it, and the projections of it the queue reports. */
|
|
@@ -10,6 +12,18 @@ export type Entry = {
|
|
|
10
12
|
readonly id: EntryId;
|
|
11
13
|
readonly seq: number;
|
|
12
14
|
readonly queuedAt: number;
|
|
15
|
+
/** The local commit time as an HLC (`JournalEntryRecord.hlc`): minted at enqueue from the sealed
|
|
16
|
+
* collections' transactor clock, restored from the journal, and passed to every drive of the entry
|
|
17
|
+
* as the write's HLC. Fixed for the entry's whole life, like `queuedAt` — a renewed action id
|
|
18
|
+
* does not renew it, since the entry is the same local commit. */
|
|
19
|
+
readonly hlc: Hlc;
|
|
20
|
+
/** The entry's lane (`JournalEntryRecord.lane`): the caller's classification at enqueue, or the
|
|
21
|
+
* stricter of the sealed collections' own declarations over their segments, restored from the
|
|
22
|
+
* journal, and passed to every drive as the write's lane. Fixed for the entry's whole life, like
|
|
23
|
+
* `hlc`: a later change to a collection's declaration, or to a SQL table's tags, does not
|
|
24
|
+
* reclassify an entry already queued — its lane is what was true of its statements when the
|
|
25
|
+
* application made them. */
|
|
26
|
+
readonly lane: Lane;
|
|
13
27
|
readonly expiresAt: number | undefined;
|
|
14
28
|
/** The collections the entry sealed a segment in — the ones `sealPending` answered `true` for. */
|
|
15
29
|
readonly collections: readonly Collection<any>[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry.d.ts","sourceRoot":"","sources":["../../../src/offline/entry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE7E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC9F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEtD,iGAAiG;AACjG,MAAM,MAAM,KAAK,GAAG;IACnB,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ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