camusdb 0.6.0 → 0.8.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 +250 -0
- package/dist/client.d.ts +73 -39
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +158 -169
- package/dist/client.js.map +1 -1
- package/dist/config.d.ts +22 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +19 -0
- package/dist/config.js.map +1 -1
- package/dist/endpoint-pool.d.ts +8 -0
- package/dist/endpoint-pool.d.ts.map +1 -1
- package/dist/endpoint-pool.js +25 -0
- package/dist/endpoint-pool.js.map +1 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/node-stats.d.ts +113 -0
- package/dist/node-stats.d.ts.map +1 -0
- package/dist/node-stats.js +90 -0
- package/dist/node-stats.js.map +1 -0
- package/dist/options.d.ts +10 -0
- package/dist/options.d.ts.map +1 -1
- package/dist/options.js +1 -0
- package/dist/options.js.map +1 -1
- package/dist/pipeline.d.ts +136 -0
- package/dist/pipeline.d.ts.map +1 -0
- package/dist/pipeline.js +375 -0
- package/dist/pipeline.js.map +1 -0
- package/dist/prepared/auto-prepare.d.ts +51 -0
- package/dist/prepared/auto-prepare.d.ts.map +1 -0
- package/dist/prepared/auto-prepare.js +150 -0
- package/dist/prepared/auto-prepare.js.map +1 -0
- package/dist/prepared/policy.d.ts +7 -0
- package/dist/prepared/policy.d.ts.map +1 -1
- package/dist/prepared/policy.js +16 -0
- package/dist/prepared/policy.js.map +1 -1
- package/dist/query-stream.d.ts +9 -1
- package/dist/query-stream.d.ts.map +1 -1
- package/dist/query-stream.js +20 -2
- package/dist/query-stream.js.map +1 -1
- package/dist/retry.d.ts +8 -0
- package/dist/retry.d.ts.map +1 -1
- package/dist/retry.js +12 -1
- package/dist/retry.js.map +1 -1
- package/dist/sql-syntax.d.ts +6 -0
- package/dist/sql-syntax.d.ts.map +1 -1
- package/dist/sql-syntax.js +8 -0
- package/dist/sql-syntax.js.map +1 -1
- package/dist/statements.d.ts +14 -0
- package/dist/statements.d.ts.map +1 -1
- package/dist/statements.js +45 -3
- package/dist/statements.js.map +1 -1
- package/dist/telemetry.d.ts +199 -0
- package/dist/telemetry.d.ts.map +1 -0
- package/dist/telemetry.js +423 -0
- package/dist/telemetry.js.map +1 -0
- package/dist/transaction.d.ts +60 -5
- package/dist/transaction.d.ts.map +1 -1
- package/dist/transaction.js +124 -24
- package/dist/transaction.js.map +1 -1
- package/dist/transport/authenticating-transport.d.ts +9 -1
- package/dist/transport/authenticating-transport.d.ts.map +1 -1
- package/dist/transport/authenticating-transport.js +13 -0
- package/dist/transport/authenticating-transport.js.map +1 -1
- package/dist/transport/grpc/batch-frames.d.ts +23 -5
- package/dist/transport/grpc/batch-frames.d.ts.map +1 -1
- package/dist/transport/grpc/batch-frames.js +29 -8
- package/dist/transport/grpc/batch-frames.js.map +1 -1
- package/dist/transport/grpc/batcher.d.ts +69 -5
- package/dist/transport/grpc/batcher.d.ts.map +1 -1
- package/dist/transport/grpc/batcher.js +217 -10
- package/dist/transport/grpc/batcher.js.map +1 -1
- package/dist/transport/grpc/grpc-transport.d.ts +35 -1
- package/dist/transport/grpc/grpc-transport.d.ts.map +1 -1
- package/dist/transport/grpc/grpc-transport.js +193 -7
- package/dist/transport/grpc/grpc-transport.js.map +1 -1
- package/dist/transport/grpc/messages.d.ts +15 -0
- package/dist/transport/grpc/messages.d.ts.map +1 -1
- package/dist/transport/grpc/messages.js +9 -0
- package/dist/transport/grpc/messages.js.map +1 -1
- package/dist/transport/rest-transport.d.ts +9 -1
- package/dist/transport/rest-transport.d.ts.map +1 -1
- package/dist/transport/rest-transport.js +24 -0
- package/dist/transport/rest-transport.js.map +1 -1
- package/dist/transport/sequential-pipeline.d.ts +21 -0
- package/dist/transport/sequential-pipeline.d.ts.map +1 -0
- package/dist/transport/sequential-pipeline.js +119 -0
- package/dist/transport/sequential-pipeline.js.map +1 -0
- package/dist/transport/transport.d.ts +94 -0
- package/dist/transport/transport.d.ts.map +1 -1
- package/dist/transport/transport.js +10 -0
- package/dist/transport/transport.js.map +1 -1
- package/package.json +10 -4
- package/proto/camus_sql.proto +114 -0
package/dist/transaction.d.ts
CHANGED
|
@@ -5,7 +5,19 @@
|
|
|
5
5
|
* file that was distributed with this source code.
|
|
6
6
|
*/
|
|
7
7
|
import type { CamusTransactionOptions } from './options.js';
|
|
8
|
+
import { CamusPipeline } from './pipeline.js';
|
|
8
9
|
import type { ClientRuntime } from './runtime.js';
|
|
10
|
+
import type { StartTransactionResult } from './transport/transport.js';
|
|
11
|
+
/**
|
|
12
|
+
* A pipeline's claim on a transaction's `BEGIN`. It is settled once the server answered the
|
|
13
|
+
* `BEGIN` that rode the pipeline's exchange.
|
|
14
|
+
*
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export interface StartClaim {
|
|
18
|
+
resolve(result: StartTransactionResult, target: string): void;
|
|
19
|
+
reject(error: Error): void;
|
|
20
|
+
}
|
|
9
21
|
/**
|
|
10
22
|
* A set of reads and writes that take effect atomically, at one logical instant, across columns,
|
|
11
23
|
* rows, and tables.
|
|
@@ -18,9 +30,13 @@ import type { ClientRuntime } from './runtime.js';
|
|
|
18
30
|
* a later transaction, but never relocates this one. A caller that knows the transaction's hot
|
|
19
31
|
* statement can choose the endpoint at `BEGIN` with `options.affinity` instead.
|
|
20
32
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
33
|
+
* `options.deferBegin` defers `BEGIN` with learned routing off too. The first statement then starts
|
|
34
|
+
* the transaction on the pool's rotation. When that first statement is a `CamusPipeline` send, the
|
|
35
|
+
* `BEGIN` travels inside the same exchange.
|
|
36
|
+
*
|
|
37
|
+
* Two consequences of the deferral are visible, and only for a deferred transaction: the
|
|
38
|
+
* server-minted identity reads as zero until the first statement, and a failure to begin surfaces
|
|
39
|
+
* from that first statement rather than from the call that created the transaction.
|
|
24
40
|
*/
|
|
25
41
|
export declare class CamusTransaction {
|
|
26
42
|
private readonly runtime;
|
|
@@ -37,6 +53,11 @@ export declare class CamusTransaction {
|
|
|
37
53
|
private startPromise;
|
|
38
54
|
private startFailed;
|
|
39
55
|
private finalized;
|
|
56
|
+
/**
|
|
57
|
+
* True once a pipeline committed this transaction, so that a later finalize does not ask the
|
|
58
|
+
* server about a transaction it no longer knows.
|
|
59
|
+
*/
|
|
60
|
+
private committedByPipeline;
|
|
40
61
|
/** The concurrency knobs this transaction was begun with, after every default was applied. */
|
|
41
62
|
readonly options: CamusTransactionOptions;
|
|
42
63
|
/**
|
|
@@ -54,8 +75,8 @@ export declare class CamusTransaction {
|
|
|
54
75
|
/**
|
|
55
76
|
* True once the server minted this transaction.
|
|
56
77
|
*
|
|
57
|
-
* It is always true with learned routing off
|
|
58
|
-
* statement, or until an explicit `affinity`, starts it.
|
|
78
|
+
* It is always true with learned routing off and no `deferBegin`. For a deferred transaction it
|
|
79
|
+
* is false until the first statement, or until an explicit `affinity`, starts it.
|
|
59
80
|
*/
|
|
60
81
|
get isStarted(): boolean;
|
|
61
82
|
/** True once this transaction was committed or rolled back. */
|
|
@@ -80,6 +101,40 @@ export declare class CamusTransaction {
|
|
|
80
101
|
*/
|
|
81
102
|
ensureStarted(preferredEndpoint: string | undefined, signal?: AbortSignal): Promise<string>;
|
|
82
103
|
private startOn;
|
|
104
|
+
private seat;
|
|
105
|
+
/**
|
|
106
|
+
* Several statements of this transaction, sent as one exchange and answered together. See
|
|
107
|
+
* `CamusPipeline`. A transaction begun with `deferBegin`, or with learned routing on, sends its
|
|
108
|
+
* `BEGIN` inside the first pipeline send too.
|
|
109
|
+
*/
|
|
110
|
+
pipeline(): CamusPipeline;
|
|
111
|
+
/**
|
|
112
|
+
* Lets a pipeline begin this transaction inside its first exchange.
|
|
113
|
+
*
|
|
114
|
+
* When nothing has begun the transaction yet, it reports a claim. The pipeline settles the claim
|
|
115
|
+
* after the server answered the `BEGIN`. When a `BEGIN` is already under way, it reports that
|
|
116
|
+
* `BEGIN` for the pipeline to await instead. When the transaction has started, it reports
|
|
117
|
+
* neither. The memoized `startPromise` is what makes a pipeline and a statement that race to be
|
|
118
|
+
* the first one agree on one `BEGIN`.
|
|
119
|
+
*
|
|
120
|
+
* @internal
|
|
121
|
+
*/
|
|
122
|
+
claimStart(): {
|
|
123
|
+
claim?: StartClaim;
|
|
124
|
+
pending?: Promise<void>;
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Records that a pipeline's conditional commit committed this transaction.
|
|
128
|
+
*
|
|
129
|
+
* @internal
|
|
130
|
+
*/
|
|
131
|
+
markCommittedByPipeline(): void;
|
|
132
|
+
/**
|
|
133
|
+
* True when a pipeline committed this transaction.
|
|
134
|
+
*
|
|
135
|
+
* @internal
|
|
136
|
+
*/
|
|
137
|
+
get isCommittedByPipeline(): boolean;
|
|
83
138
|
/** Makes this transaction's writes durable. */
|
|
84
139
|
commit(signal?: AbortSignal): Promise<void>;
|
|
85
140
|
/** Discards this transaction's writes. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../src/transaction.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../src/transaction.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAGlD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAEvE;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,MAAM,EAAE,sBAAsB,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,SAAS,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC;YAUnF,OAAO;IAqBrB,OAAO,CAAC,IAAI;IAQZ;;;;OAIG;IACH,QAAQ,IAAI,aAAa;IAIzB;;;;;;;;;;OAUG;IACH,UAAU,IAAI;QAAE,KAAK,CAAC,EAAE,UAAU,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAA;KAAE;IAiC7D;;;;OAIG;IACH,uBAAuB,IAAI,IAAI;IAK/B;;;;OAIG;IACH,IAAI,qBAAqB,IAAI,OAAO,CAEnC;IAED,+CAA+C;IAC/C,MAAM,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3C,0CAA0C;IAC1C,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAI7C;;;;;;;;;;OAUG;YACW,QAAQ;IAmEtB;;;;OAIG;IACG,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC;IAU5C;;;;;;OAMG;IACH,MAAM,CAAC,QAAQ,CAAC,SAAS;;;MAAoB;CAC9C"}
|
package/dist/transaction.js
CHANGED
|
@@ -6,8 +6,10 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { CamusError } from './errors.js';
|
|
8
8
|
import { CamusErrorCode } from './error-codes.js';
|
|
9
|
+
import { CamusPipeline } from './pipeline.js';
|
|
9
10
|
import { delay } from './retry.js';
|
|
10
11
|
import { CamusRouteOpKind } from './routing/route-cache.js';
|
|
12
|
+
import { CamusRetryKind, recordRetry, traced } from './telemetry.js';
|
|
11
13
|
/**
|
|
12
14
|
* A set of reads and writes that take effect atomically, at one logical instant, across columns,
|
|
13
15
|
* rows, and tables.
|
|
@@ -20,9 +22,13 @@ import { CamusRouteOpKind } from './routing/route-cache.js';
|
|
|
20
22
|
* a later transaction, but never relocates this one. A caller that knows the transaction's hot
|
|
21
23
|
* statement can choose the endpoint at `BEGIN` with `options.affinity` instead.
|
|
22
24
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
25
|
+
* `options.deferBegin` defers `BEGIN` with learned routing off too. The first statement then starts
|
|
26
|
+
* the transaction on the pool's rotation. When that first statement is a `CamusPipeline` send, the
|
|
27
|
+
* `BEGIN` travels inside the same exchange.
|
|
28
|
+
*
|
|
29
|
+
* Two consequences of the deferral are visible, and only for a deferred transaction: the
|
|
30
|
+
* server-minted identity reads as zero until the first statement, and a failure to begin surfaces
|
|
31
|
+
* from that first statement rather than from the call that created the transaction.
|
|
26
32
|
*/
|
|
27
33
|
export class CamusTransaction {
|
|
28
34
|
runtime;
|
|
@@ -39,6 +45,11 @@ export class CamusTransaction {
|
|
|
39
45
|
startPromise;
|
|
40
46
|
startFailed = false;
|
|
41
47
|
finalized = false;
|
|
48
|
+
/**
|
|
49
|
+
* True once a pipeline committed this transaction, so that a later finalize does not ask the
|
|
50
|
+
* server about a transaction it no longer knows.
|
|
51
|
+
*/
|
|
52
|
+
committedByPipeline = false;
|
|
42
53
|
/** The concurrency knobs this transaction was begun with, after every default was applied. */
|
|
43
54
|
options;
|
|
44
55
|
/**
|
|
@@ -61,8 +72,8 @@ export class CamusTransaction {
|
|
|
61
72
|
/**
|
|
62
73
|
* True once the server minted this transaction.
|
|
63
74
|
*
|
|
64
|
-
* It is always true with learned routing off
|
|
65
|
-
* statement, or until an explicit `affinity`, starts it.
|
|
75
|
+
* It is always true with learned routing off and no `deferBegin`. For a deferred transaction it
|
|
76
|
+
* is false until the first statement, or until an explicit `affinity`, starts it.
|
|
66
77
|
*/
|
|
67
78
|
get isStarted() {
|
|
68
79
|
return this.startedValue;
|
|
@@ -106,18 +117,88 @@ export class CamusTransaction {
|
|
|
106
117
|
}
|
|
107
118
|
async startOn(target, signal) {
|
|
108
119
|
try {
|
|
109
|
-
const result = await
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
this.
|
|
114
|
-
this.startedValue = true;
|
|
120
|
+
const result = await traced(this.runtime, { operationName: 'BEGIN' }, (operation) => {
|
|
121
|
+
operation?.setEndpoint(target);
|
|
122
|
+
return this.runtime.transport.startTransaction(target, this.runtime.database, this.options, this.runtime.timeoutSeconds, signal);
|
|
123
|
+
});
|
|
124
|
+
this.seat(result, target);
|
|
115
125
|
}
|
|
116
126
|
catch (error) {
|
|
117
127
|
this.startFailed = true;
|
|
118
128
|
throw error;
|
|
119
129
|
}
|
|
120
130
|
}
|
|
131
|
+
seat(result, target) {
|
|
132
|
+
this.txnIdPTValue = result.txnIdPT;
|
|
133
|
+
this.txnIdCounterValue = result.txnIdCounter;
|
|
134
|
+
this.streamSlot = result.streamSlot;
|
|
135
|
+
this.endpointValue = target;
|
|
136
|
+
this.startedValue = true;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Several statements of this transaction, sent as one exchange and answered together. See
|
|
140
|
+
* `CamusPipeline`. A transaction begun with `deferBegin`, or with learned routing on, sends its
|
|
141
|
+
* `BEGIN` inside the first pipeline send too.
|
|
142
|
+
*/
|
|
143
|
+
pipeline() {
|
|
144
|
+
return new CamusPipeline(this, this.runtime);
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Lets a pipeline begin this transaction inside its first exchange.
|
|
148
|
+
*
|
|
149
|
+
* When nothing has begun the transaction yet, it reports a claim. The pipeline settles the claim
|
|
150
|
+
* after the server answered the `BEGIN`. When a `BEGIN` is already under way, it reports that
|
|
151
|
+
* `BEGIN` for the pipeline to await instead. When the transaction has started, it reports
|
|
152
|
+
* neither. The memoized `startPromise` is what makes a pipeline and a statement that race to be
|
|
153
|
+
* the first one agree on one `BEGIN`.
|
|
154
|
+
*
|
|
155
|
+
* @internal
|
|
156
|
+
*/
|
|
157
|
+
claimStart() {
|
|
158
|
+
if (this.startedValue)
|
|
159
|
+
return {};
|
|
160
|
+
if (this.startPromise !== undefined)
|
|
161
|
+
return { pending: this.startPromise };
|
|
162
|
+
let resolve;
|
|
163
|
+
let reject;
|
|
164
|
+
const promise = new Promise((done, fail) => {
|
|
165
|
+
resolve = done;
|
|
166
|
+
reject = fail;
|
|
167
|
+
});
|
|
168
|
+
// A claim that fails with no statement waiting on it must not be reported as unhandled. The
|
|
169
|
+
// failure reaches the pipeline's caller from the send.
|
|
170
|
+
promise.catch(() => undefined);
|
|
171
|
+
this.startPromise = promise;
|
|
172
|
+
return {
|
|
173
|
+
claim: {
|
|
174
|
+
resolve: (result, target) => {
|
|
175
|
+
this.seat(result, target);
|
|
176
|
+
resolve();
|
|
177
|
+
},
|
|
178
|
+
reject: (error) => {
|
|
179
|
+
this.startFailed = true;
|
|
180
|
+
reject(error);
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Records that a pipeline's conditional commit committed this transaction.
|
|
187
|
+
*
|
|
188
|
+
* @internal
|
|
189
|
+
*/
|
|
190
|
+
markCommittedByPipeline() {
|
|
191
|
+
this.committedByPipeline = true;
|
|
192
|
+
this.finalized = true;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* True when a pipeline committed this transaction.
|
|
196
|
+
*
|
|
197
|
+
* @internal
|
|
198
|
+
*/
|
|
199
|
+
get isCommittedByPipeline() {
|
|
200
|
+
return this.committedByPipeline;
|
|
201
|
+
}
|
|
121
202
|
/** Makes this transaction's writes durable. */
|
|
122
203
|
commit(signal) {
|
|
123
204
|
return this.finalize(true, signal);
|
|
@@ -138,6 +219,15 @@ export class CamusTransaction {
|
|
|
138
219
|
* the server sees the same `BEGIN` and finalize pair it always did.
|
|
139
220
|
*/
|
|
140
221
|
async finalize(commit, signal) {
|
|
222
|
+
// A pipeline committed this transaction already. A rollback has nothing to undo. A second
|
|
223
|
+
// commit is a mistake of the caller, and the server would only answer that it does not know
|
|
224
|
+
// the transaction.
|
|
225
|
+
if (this.committedByPipeline) {
|
|
226
|
+
if (commit) {
|
|
227
|
+
throw new CamusError(CamusErrorCode.Generic, 'A pipeline already committed this transaction.');
|
|
228
|
+
}
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
141
231
|
if (this.finalized) {
|
|
142
232
|
throw new CamusError(CamusErrorCode.Generic, 'This transaction was already committed or rolled back.');
|
|
143
233
|
}
|
|
@@ -149,21 +239,31 @@ export class CamusTransaction {
|
|
|
149
239
|
return;
|
|
150
240
|
}
|
|
151
241
|
const target = await this.ensureStarted(undefined, signal);
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
242
|
+
const name = commit ? 'COMMIT' : 'ROLLBACK';
|
|
243
|
+
// One span over every attempt. Each retry is a `camusdb.retry` event on it.
|
|
244
|
+
await traced(this.runtime, { operationName: name }, async (operation) => {
|
|
245
|
+
operation?.setEndpoint(target);
|
|
246
|
+
for (let attempt = 0;; attempt++) {
|
|
247
|
+
try {
|
|
248
|
+
await this.runtime.transport.finalizeTransaction(commit, target, this.runtime.database, this.txnIdPTValue, this.txnIdCounterValue, this.streamSlot, this.runtime.timeoutSeconds, signal);
|
|
249
|
+
this.finalized = true;
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
catch (error) {
|
|
253
|
+
if (!CamusError.is(error) ||
|
|
254
|
+
error.code !== CamusErrorCode.FinalizeUnresolved ||
|
|
255
|
+
attempt >= MAX_FINALIZE_ATTEMPTS) {
|
|
256
|
+
throw error;
|
|
257
|
+
}
|
|
258
|
+
recordRetry(CamusRetryKind.Finalize, error, {
|
|
259
|
+
database: this.runtime.database,
|
|
260
|
+
operationName: name,
|
|
261
|
+
operation,
|
|
262
|
+
});
|
|
263
|
+
await delay(finalizeDelayMs(attempt), signal);
|
|
163
264
|
}
|
|
164
|
-
await delay(finalizeDelayMs(attempt), signal);
|
|
165
265
|
}
|
|
166
|
-
}
|
|
266
|
+
});
|
|
167
267
|
}
|
|
168
268
|
/**
|
|
169
269
|
* Rolls the transaction back if it was neither committed nor rolled back, so a `using` block
|
package/dist/transaction.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../src/transaction.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../src/transaction.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAcrE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,OAAO,gBAAgB;IACV,OAAO,CAAgB;IAEhC,YAAY,GAAG,EAAE,CAAC;IAElB,iBAAiB,GAAG,CAAC,CAAC;IAEtB,aAAa,CAAqB;IAElC,YAAY,GAAG,KAAK,CAAC;IAE7B;;;;;OAKG;IACK,YAAY,CAA4B;IAExC,WAAW,GAAG,KAAK,CAAC;IAEpB,SAAS,GAAG,KAAK,CAAC;IAE1B;;;OAGG;IACK,mBAAmB,GAAG,KAAK,CAAC;IAEpC,8FAA8F;IACrF,OAAO,CAA0B;IAE1C;;;OAGG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AE,CAAC,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -6,9 +6,10 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { CamusTokenProvider } from '../auth/token-provider.js';
|
|
8
8
|
import type { CamusProtocol } from '../config.js';
|
|
9
|
+
import type { CamusNodeStats } from '../node-stats.js';
|
|
9
10
|
import type { CamusTransactionOptions } from '../options.js';
|
|
10
11
|
import type { CamusRowSource } from '../row-source.js';
|
|
11
|
-
import type { CamusBranchRow, CamusTransport, NonQueryTransportResult, PreparedStatementInfo, QueryTransportResult, StartTransactionResult, TransportInsertRequest, TransportSqlRequest } from './transport.js';
|
|
12
|
+
import type { CamusBranchRow, CamusTransport, NonQueryTransportResult, PipelineTransportResult, PreparedStatementInfo, QueryTransportResult, StartTransactionResult, TransportInsertRequest, TransportPipelineRequest, TransportSqlRequest } from './transport.js';
|
|
12
13
|
/**
|
|
13
14
|
* Wraps a transport with the reactive half of token management.
|
|
14
15
|
*
|
|
@@ -42,6 +43,12 @@ export declare class AuthenticatingTransport implements CamusTransport {
|
|
|
42
43
|
executeQuery(request: TransportSqlRequest): Promise<QueryTransportResult>;
|
|
43
44
|
executeQueryStream(request: TransportSqlRequest): Promise<CamusRowSource>;
|
|
44
45
|
executeNonQuery(request: TransportSqlRequest): Promise<NonQueryTransportResult>;
|
|
46
|
+
/**
|
|
47
|
+
* A pipeline whose `BEGIN` was refused for its token throws and does not report it, so that this
|
|
48
|
+
* replay can happen: none of it ran. A token refused later in the pipeline is reported in the
|
|
49
|
+
* result and not replayed, because the transaction it began is gone either way.
|
|
50
|
+
*/
|
|
51
|
+
executePipeline(request: TransportPipelineRequest): Promise<PipelineTransportResult>;
|
|
45
52
|
insert(request: TransportInsertRequest): Promise<number>;
|
|
46
53
|
executeDdl(request: TransportSqlRequest): Promise<boolean>;
|
|
47
54
|
prepare(endpoint: string, database: string, sql: string, timeoutSeconds: number, signal?: AbortSignal): Promise<PreparedStatementInfo>;
|
|
@@ -51,6 +58,7 @@ export declare class AuthenticatingTransport implements CamusTransport {
|
|
|
51
58
|
*/
|
|
52
59
|
closePrepared(endpoint: string, database: string, sql: string, signal?: AbortSignal): Promise<void>;
|
|
53
60
|
ping(endpoint: string, timeoutSeconds: number, signal?: AbortSignal): Promise<boolean>;
|
|
61
|
+
getNodeStats(endpoint: string, timeoutSeconds: number, signal?: AbortSignal): Promise<CamusNodeStats>;
|
|
54
62
|
createDatabase(endpoint: string, database: string, ifNotExists: boolean, timeoutSeconds: number, signal?: AbortSignal): Promise<void>;
|
|
55
63
|
createBranchDatabase(endpoint: string, branchName: string, sourceDatabaseName: string, ifNotExists: boolean, timeoutSeconds: number, signal?: AbortSignal): Promise<void>;
|
|
56
64
|
dropDatabase(endpoint: string, database: string, timeoutSeconds: number, signal?: AbortSignal): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticating-transport.d.ts","sourceRoot":"","sources":["../../src/transport/authenticating-transport.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"authenticating-transport.d.ts","sourceRoot":"","sources":["../../src/transport/authenticating-transport.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGvD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,uBAAuB,EACvB,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,E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AE,CAAC;IAI5B,aAAa,CACX,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,MAAM,EACtB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,cAAc,EAAE,CAAC;IAI5B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;YAIR,GAAG;IAyBjB,OAAO,CAAC,WAAW;CAGpB"}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { CamusError } from '../errors.js';
|
|
8
8
|
import { CamusErrorCode } from '../error-codes.js';
|
|
9
|
+
import { CamusRetryKind, recordRetry } from '../telemetry.js';
|
|
9
10
|
/**
|
|
10
11
|
* Wraps a transport with the reactive half of token management.
|
|
11
12
|
*
|
|
@@ -54,6 +55,14 @@ export class AuthenticatingTransport {
|
|
|
54
55
|
executeNonQuery(request) {
|
|
55
56
|
return this.run(() => this.inner.executeNonQuery(request));
|
|
56
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* A pipeline whose `BEGIN` was refused for its token throws and does not report it, so that this
|
|
60
|
+
* replay can happen: none of it ran. A token refused later in the pipeline is reported in the
|
|
61
|
+
* result and not replayed, because the transaction it began is gone either way.
|
|
62
|
+
*/
|
|
63
|
+
executePipeline(request) {
|
|
64
|
+
return this.run(() => this.inner.executePipeline(request));
|
|
65
|
+
}
|
|
57
66
|
insert(request) {
|
|
58
67
|
return this.run(() => this.inner.insert(request));
|
|
59
68
|
}
|
|
@@ -73,6 +82,9 @@ export class AuthenticatingTransport {
|
|
|
73
82
|
ping(endpoint, timeoutSeconds, signal) {
|
|
74
83
|
return this.run(() => this.inner.ping(endpoint, timeoutSeconds, signal));
|
|
75
84
|
}
|
|
85
|
+
getNodeStats(endpoint, timeoutSeconds, signal) {
|
|
86
|
+
return this.run(() => this.inner.getNodeStats(endpoint, timeoutSeconds, signal));
|
|
87
|
+
}
|
|
76
88
|
createDatabase(endpoint, database, ifNotExists, timeoutSeconds, signal) {
|
|
77
89
|
return this.run(() => this.inner.createDatabase(endpoint, database, ifNotExists, timeoutSeconds, signal));
|
|
78
90
|
}
|
|
@@ -109,6 +121,7 @@ export class AuthenticatingTransport {
|
|
|
109
121
|
if (presented === undefined)
|
|
110
122
|
throw error;
|
|
111
123
|
this.auth.invalidate(presented);
|
|
124
|
+
recordRetry(CamusRetryKind.TokenRenewal, error);
|
|
112
125
|
}
|
|
113
126
|
return operation();
|
|
114
127
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticating-transport.js","sourceRoot":"","sources":["../../src/transport/authenticating-transport.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"authenticating-transport.js","sourceRoot":"","sources":["../../src/transport/authenticating-transport.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAc9D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,OAAO,uBAAuB;IAClC,4FAA4F;IACnF,KAAK,CAAiB;IAEd,IAAI,CAAqB;IAE1C,YAAY,KAAqB,EAAE,IAAwB;QACzD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;IAC7B,CAAC;IAED,gBAAgB,CACd,QAAgB,EAChB,QAAgB,EAChB,OAAgC,EAChC,cAAsB,EACtB,MAAoB;QAEpB,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM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WAAW,CAAC,KAAK,CAAC;gBAAE,MAAM,KAAK,CAAC;YAE1C,2FAA2F;YAC3F,0FAA0F;YAC1F,uFAAuF;YACvF,yFAAyF;YACzF,SAAS,KAAK,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC;YAErC,IAAI,SAAS,KAAK,SAAS;gBAAE,MAAM,KAAK,CAAC;YAEzC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;YAChC,WAAW,CAAC,cAAc,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;QAClD,CAAC;QAED,OAAO,SAAS,EAAE,CAAC;IACrB,CAAC;IAEO,WAAW,CAAC,KAAc;QAChC,OAAO,UAAU,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,cAAc,CAAC,oBAAoB,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;IAC1G,CAAC;CACF"}
|
|
@@ -33,8 +33,23 @@ export declare const FRAME_HEADER = "camusdb-batch-frames";
|
|
|
33
33
|
* built before frames ignores the header.
|
|
34
34
|
*/
|
|
35
35
|
export declare const FRAME_ACCEPT_HEADER = "camusdb-batch-frames-accept";
|
|
36
|
-
/**
|
|
37
|
-
|
|
36
|
+
/**
|
|
37
|
+
* The contract version this client writes, and the highest it reads.
|
|
38
|
+
*
|
|
39
|
+
* Version 1 is frames. Version 2 adds what lets a whole transaction travel in one frame: an item
|
|
40
|
+
* can name the `Start` earlier in its frame (`txnStartRef`) instead of a handle that does not exist
|
|
41
|
+
* yet, and a `CommitIfOk` item commits only when every earlier operation of its transaction
|
|
42
|
+
* succeeded.
|
|
43
|
+
*/
|
|
44
|
+
export declare const FRAME_VERSION = 2;
|
|
45
|
+
/**
|
|
46
|
+
* The lowest announced version on which a pipelined transaction can be written.
|
|
47
|
+
*
|
|
48
|
+
* A server below it ignores `txnStartRef` and runs the operation as an autocommit statement, and
|
|
49
|
+
* it runs `CommitIfOk` as a non-query and leaves the transaction open. So the batcher never writes
|
|
50
|
+
* either one to such a stream, and the transport runs the pipeline one exchange per step instead.
|
|
51
|
+
*/
|
|
52
|
+
export declare const FRAME_PIPELINE_VERSION = 2;
|
|
38
53
|
/** The most operations one frame carries. A server refuses the operations past it. */
|
|
39
54
|
export declare const FRAME_MAX_ITEMS = 256;
|
|
40
55
|
/**
|
|
@@ -46,14 +61,17 @@ export declare const FRAME_MAX_ITEMS = 256;
|
|
|
46
61
|
* own travels as a plain single message.
|
|
47
62
|
*/
|
|
48
63
|
export declare const FRAME_MAX_BYTES: number;
|
|
64
|
+
/** True when a header value announces a contract version that this client can write frames to. */
|
|
65
|
+
export declare function announcesFrames(value: string | undefined): boolean;
|
|
49
66
|
/**
|
|
50
|
-
*
|
|
67
|
+
* The contract version a header value announces, or 0 for no announcement.
|
|
51
68
|
*
|
|
52
69
|
* The whole value must be digits. `Number.parseInt` stops at the first character it cannot read,
|
|
53
70
|
* so it would read `1x` as version 1 and treat a header this client does not understand as an
|
|
54
|
-
* announcement.
|
|
71
|
+
* announcement. A server that announces a version above `FRAME_VERSION` still reads everything
|
|
72
|
+
* this client writes, so the value is kept as announced and not clamped.
|
|
55
73
|
*/
|
|
56
|
-
export declare function
|
|
74
|
+
export declare function announcedFrameVersion(value: string | undefined): number;
|
|
57
75
|
/**
|
|
58
76
|
* An upper bound on the bytes one operation adds to a frame.
|
|
59
77
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batch-frames.d.ts","sourceRoot":"","sources":["../../../src/transport/grpc/batch-frames.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAA6B,MAAM,eAAe,CAAC;AAExF;;;;;;;;;;GAUG;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,yBAAyB,CAAC;AAEnD;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,gCAAgC,CAAC;AAEjE
|
|
1
|
+
{"version":3,"file":"batch-frames.d.ts","sourceRoot":"","sources":["../../../src/transport/grpc/batch-frames.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAA6B,MAAM,eAAe,CAAC;AAExF;;;;;;;;;;GAUG;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,yBAAyB,CAAC;AAEnD;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,gCAAgC,CAAC;AAEjE;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,IAAI,CAAC;AAE/B;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC,sFAAsF;AACtF,eAAO,MAAM,eAAe,MAAM,CAAC;AAEnC;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,QAAc,CAAC;AAE3C,kGAAkG;AAClG,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAElE;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAUvE;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,uBAAuB,GAAG,MAAM,CAElE"}
|
|
@@ -32,8 +32,23 @@ export const FRAME_HEADER = 'camusdb-batch-frames';
|
|
|
32
32
|
* built before frames ignores the header.
|
|
33
33
|
*/
|
|
34
34
|
export const FRAME_ACCEPT_HEADER = 'camusdb-batch-frames-accept';
|
|
35
|
-
/**
|
|
36
|
-
|
|
35
|
+
/**
|
|
36
|
+
* The contract version this client writes, and the highest it reads.
|
|
37
|
+
*
|
|
38
|
+
* Version 1 is frames. Version 2 adds what lets a whole transaction travel in one frame: an item
|
|
39
|
+
* can name the `Start` earlier in its frame (`txnStartRef`) instead of a handle that does not exist
|
|
40
|
+
* yet, and a `CommitIfOk` item commits only when every earlier operation of its transaction
|
|
41
|
+
* succeeded.
|
|
42
|
+
*/
|
|
43
|
+
export const FRAME_VERSION = 2;
|
|
44
|
+
/**
|
|
45
|
+
* The lowest announced version on which a pipelined transaction can be written.
|
|
46
|
+
*
|
|
47
|
+
* A server below it ignores `txnStartRef` and runs the operation as an autocommit statement, and
|
|
48
|
+
* it runs `CommitIfOk` as a non-query and leaves the transaction open. So the batcher never writes
|
|
49
|
+
* either one to such a stream, and the transport runs the pipeline one exchange per step instead.
|
|
50
|
+
*/
|
|
51
|
+
export const FRAME_PIPELINE_VERSION = 2;
|
|
37
52
|
/** The most operations one frame carries. A server refuses the operations past it. */
|
|
38
53
|
export const FRAME_MAX_ITEMS = 256;
|
|
39
54
|
/**
|
|
@@ -45,20 +60,26 @@ export const FRAME_MAX_ITEMS = 256;
|
|
|
45
60
|
* own travels as a plain single message.
|
|
46
61
|
*/
|
|
47
62
|
export const FRAME_MAX_BYTES = 1024 * 1024;
|
|
63
|
+
/** True when a header value announces a contract version that this client can write frames to. */
|
|
64
|
+
export function announcesFrames(value) {
|
|
65
|
+
return announcedFrameVersion(value) >= 1;
|
|
66
|
+
}
|
|
48
67
|
/**
|
|
49
|
-
*
|
|
68
|
+
* The contract version a header value announces, or 0 for no announcement.
|
|
50
69
|
*
|
|
51
70
|
* The whole value must be digits. `Number.parseInt` stops at the first character it cannot read,
|
|
52
71
|
* so it would read `1x` as version 1 and treat a header this client does not understand as an
|
|
53
|
-
* announcement.
|
|
72
|
+
* announcement. A server that announces a version above `FRAME_VERSION` still reads everything
|
|
73
|
+
* this client writes, so the value is kept as announced and not clamped.
|
|
54
74
|
*/
|
|
55
|
-
export function
|
|
75
|
+
export function announcedFrameVersion(value) {
|
|
56
76
|
if (value === undefined)
|
|
57
|
-
return
|
|
77
|
+
return 0;
|
|
58
78
|
const text = value.trim();
|
|
59
79
|
if (!/^\d+$/.test(text))
|
|
60
|
-
return
|
|
61
|
-
|
|
80
|
+
return 0;
|
|
81
|
+
const version = Number(text);
|
|
82
|
+
return Number.isSafeInteger(version) && version >= 1 ? version : 0;
|
|
62
83
|
}
|
|
63
84
|
/**
|
|
64
85
|
* An upper bound on the bytes one operation adds to a frame.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batch-frames.js","sourceRoot":"","sources":["../../../src/transport/grpc/batch-frames.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;;;;;;;;;GAUG;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,sBAAsB,CAAC;AAEnD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,6BAA6B,CAAC;AAEjE
|
|
1
|
+
{"version":3,"file":"batch-frames.js","sourceRoot":"","sources":["../../../src/transport/grpc/batch-frames.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;;;;;;;;;GAUG;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,sBAAsB,CAAC;AAEnD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,6BAA6B,CAAC;AAEjE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC;AAE/B;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC;AAExC,sFAAsF;AACtF,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAC;AAEnC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,GAAG,IAAI,CAAC;AAE3C,kGAAkG;AAClG,MAAM,UAAU,eAAe,CAAC,KAAyB;IACvD,OAAO,qBAAqB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAC3C,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB,CAAC,KAAyB;IAC7D,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,CAAC,CAAC;IAElC,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAE1B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE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