@spine-event-engine/storage-mysql 2.0.0-snapshot.23 → 2.0.0-snapshot.24
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 +5 -5
- package/REFERENCE.md +25 -18
- package/dist/mysql/agent-execution.d.ts +5 -7
- package/dist/mysql/agent-execution.d.ts.map +1 -1
- package/dist/mysql/agent-execution.js +5 -13
- package/dist/mysql/agent-execution.js.map +1 -1
- package/dist/mysql/agent-transaction.d.ts +50 -0
- package/dist/mysql/agent-transaction.d.ts.map +1 -0
- package/dist/mysql/{entity-commit.js → agent-transaction.js} +18 -45
- package/dist/mysql/agent-transaction.js.map +1 -0
- package/dist/mysql/entity-history.d.ts +44 -35
- package/dist/mysql/entity-history.d.ts.map +1 -1
- package/dist/mysql/entity-history.js +282 -84
- package/dist/mysql/entity-history.js.map +1 -1
- package/dist/mysql/errors.d.ts +3 -2
- package/dist/mysql/errors.d.ts.map +1 -1
- package/dist/mysql/errors.js +3 -2
- package/dist/mysql/errors.js.map +1 -1
- package/dist/mysql/record-storage.d.ts +67 -38
- package/dist/mysql/record-storage.d.ts.map +1 -1
- package/dist/mysql/record-storage.js +195 -154
- package/dist/mysql/record-storage.js.map +1 -1
- package/dist/mysql/storage-factory.d.ts +2 -7
- package/dist/mysql/storage-factory.d.ts.map +1 -1
- package/dist/mysql/storage-factory.js +75 -54
- package/dist/mysql/storage-factory.js.map +1 -1
- package/dist/mysql/table-resolver.d.ts +6 -0
- package/dist/mysql/table-resolver.d.ts.map +1 -1
- package/dist/mysql/table-resolver.js +18 -11
- package/dist/mysql/table-resolver.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/dist/mysql/delivery-cleanup.d.ts +0 -37
- package/dist/mysql/delivery-cleanup.d.ts.map +0 -1
- package/dist/mysql/delivery-cleanup.js +0 -108
- package/dist/mysql/delivery-cleanup.js.map +0 -1
- package/dist/mysql/entity-commit.d.ts +0 -79
- package/dist/mysql/entity-commit.d.ts.map +0 -1
- package/dist/mysql/entity-commit.js.map +0 -1
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ see the [coding-agent reference](REFERENCE.md) for database requirements.
|
|
|
18
18
|
## 💡 Why use it?
|
|
19
19
|
|
|
20
20
|
- ✅ Stores Spine records durably in a MySQL database.
|
|
21
|
-
- ✅ Manages a bounded `mysql2` connection pool
|
|
21
|
+
- ✅ Manages a bounded `mysql2` connection pool and atomic single-record conditions.
|
|
22
22
|
- ✅ Supports declared-column filters, sorting, offsets, limits, and
|
|
23
23
|
continuations.
|
|
24
24
|
- ✅ Keeps adapter tables private behind the common `RecordStorage` API.
|
|
@@ -118,10 +118,10 @@ pnpm typecheck:build
|
|
|
118
118
|
## ✨ Supported records and queries
|
|
119
119
|
|
|
120
120
|
The adapter performs record CRUD, payload-based compare-and-set, named-column
|
|
121
|
-
queries, sort order, offsets, limits, and keyset continuations.
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
121
|
+
queries, sort order, offsets, limits, and keyset continuations. Batches and
|
|
122
|
+
Entity commits use independent ordered records on InnoDB, MyISAM, and Aria.
|
|
123
|
+
A failed operation can leave its completed prefix; an identical Entity retry
|
|
124
|
+
reuses prepared versions and Event IDs. It supports primitive and structured
|
|
125
125
|
storage IDs. Declared columns support strings, booleans, integral Protobuf
|
|
126
126
|
numbers, enums, bytes, messages, `Timestamp`, and `Version`. Spine JVM JDBC
|
|
127
127
|
does not support `float` or `double` record columns, so this adapter rejects
|
package/REFERENCE.md
CHANGED
|
@@ -62,17 +62,19 @@ complete generated `TenantId` on each operation and routes it to its configured
|
|
|
62
62
|
database. Bounded Context names are diagnostic only and never partition rows,
|
|
63
63
|
tables, locks, or queries.
|
|
64
64
|
|
|
65
|
-
Each Entity source and history family has an independent table.
|
|
66
|
-
|
|
65
|
+
Each Entity source and history family has an independent table. Top-level
|
|
66
|
+
provider error messages and public responses omit connection URLs,
|
|
67
|
+
credentials, and driver details. The original driver failure remains available
|
|
68
|
+
as the internal `cause`; do not expose it in public responses or unfiltered
|
|
69
|
+
logs.
|
|
67
70
|
|
|
68
71
|
## Records and queries
|
|
69
72
|
|
|
70
|
-
CRUD operations use normal statements. Payload-based compare-and-set uses
|
|
71
|
-
|
|
72
|
-
`writeAll` encodes
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
identical retry. Repeated storage slots in a batch leave the last entry as the
|
|
73
|
+
CRUD operations use normal statements. Payload-based compare-and-set uses
|
|
74
|
+
atomic conditional statements for one storage slot on InnoDB, MyISAM, and Aria.
|
|
75
|
+
`writeAll` encodes input first and writes entries in input order; a later failure
|
|
76
|
+
leaves completed rows in place on every engine. Repeated storage slots in a
|
|
77
|
+
batch leave the last completed entry as the
|
|
76
78
|
stored value. IDs are declared as generated message IDs or the supported
|
|
77
79
|
primitive `string`, `int32`, and `int64` kinds. Primitive IDs use native MySQL
|
|
78
80
|
values; message IDs use their reversible stringifier, compact Proto JSON by
|
|
@@ -121,17 +123,18 @@ acquired.
|
|
|
121
123
|
## Entity history seam
|
|
122
124
|
|
|
123
125
|
The provider/framework Entity handle returns current records plus immutable
|
|
124
|
-
state and event history. It is not a remote application history API. State
|
|
125
|
-
|
|
126
|
+
state and event history. It is not a remote application history API. State and
|
|
127
|
+
diagnostic append use immutable per-record insertion. Trim and truncate use
|
|
126
128
|
fixed-size chunks. A failed chunk can leave earlier chunks durable, so callers
|
|
127
129
|
retry maintenance. Current-record and history actions are separate calls, not
|
|
128
130
|
one cross-storage transaction.
|
|
129
131
|
|
|
130
|
-
The internal
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
operations remain separate
|
|
132
|
+
The internal Entity commit port writes state history, diagnostic Events,
|
|
133
|
+
framework delivery Events, then current state as independent records. A failure
|
|
134
|
+
can leave a completed prefix on every engine. One classified deadlock retry
|
|
135
|
+
replays captured input with unchanged versions and Event IDs. Standalone
|
|
136
|
+
history operations remain separate; a delivery Event alone does not prove the
|
|
137
|
+
current-state write completed.
|
|
135
138
|
|
|
136
139
|
## Agent history
|
|
137
140
|
|
|
@@ -160,7 +163,9 @@ families are unchanged. Execution and per-instance pending records use complete
|
|
|
160
163
|
binary ordering keys and validated composite indexes.
|
|
161
164
|
|
|
162
165
|
One connection transaction checks the claim and initial Entity Version, then
|
|
163
|
-
writes state, mandatory history, preferences and outgoing
|
|
166
|
+
writes state, mandatory history, preferences and outgoing Command obligations. Emitted
|
|
167
|
+
domain Events enter immutable Agent history and are handed to the normal EventBus
|
|
168
|
+
after completion without a saved delivery phase. Connection
|
|
164
169
|
binding is scoped to that asynchronous operation. Encoded execution,
|
|
165
170
|
per-instance, and Agent history records must each fit the 65,535-byte BLOB limit. The runtime must
|
|
166
171
|
check its response reservation against the provider limits before inference.
|
|
@@ -171,5 +176,7 @@ a model request.
|
|
|
171
176
|
`MysqlStorageDataError` reports stored bytes that cannot be decoded, and
|
|
172
177
|
`MysqlStorageOperationError` reports sanitized bounds, query, collision, and
|
|
173
178
|
driver-operation failures. Custom creation uses `useOperationFactory()`; its
|
|
174
|
-
resolved `MysqlTableSpec` has the same native column types and
|
|
175
|
-
as default DDL
|
|
179
|
+
resolved `MysqlTableSpec` has the same native column types and family-specific
|
|
180
|
+
naming as default DDL. A grouped family uses its explicit grouped override or
|
|
181
|
+
grouped default; an ungrouped family uses its explicit record override or
|
|
182
|
+
ungrouped default. An ungrouped override never aliases a grouped family.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type Message } from "@bufbuild/protobuf";
|
|
2
2
|
import type { Timestamp } from "@bufbuild/protobuf/wkt";
|
|
3
|
-
import type { Event, EventId } from "@spine-event-engine/proto";
|
|
4
|
-
import { type AgentAcceptedInvocation, type AgentExecutionHead, type AgentExecutionRecord, type AgentInvocationKey
|
|
3
|
+
import type { CommandId, Event, EventId } from "@spine-event-engine/proto";
|
|
4
|
+
import { type AgentAcceptedInvocation, type AgentExecutionHead, type AgentExecutionRecord, type AgentInvocationKey } from "@spine-event-engine/proto/generated/spine/server/agent/execution_record_pb.js";
|
|
5
5
|
import type { AgentHistoryRecord } from "@spine-event-engine/proto/generated/spine/server/agent/history_record_pb.js";
|
|
6
6
|
import { type AgentExecutionStorage, type AgentExecutionCapacity, type AgentExecutionStorageInput, type AgentExecutionClaim, type AgentExecutionUpdate, type AgentExecutionComplete, type AgentPendingRead, type AgentPendingPage } from "@spine-event-engine/storage/provider";
|
|
7
|
-
import {
|
|
7
|
+
import { MysqlAgentTransaction } from "./agent-transaction.js";
|
|
8
8
|
import { MysqlEntityStorage } from "./entity-history.js";
|
|
9
9
|
import { MysqlRecordStorage } from "./record-storage.js";
|
|
10
10
|
/**
|
|
@@ -31,7 +31,6 @@ export declare class MysqlAgentExecution<I, S extends Message> implements AgentE
|
|
|
31
31
|
private readonly input;
|
|
32
32
|
private readonly rows;
|
|
33
33
|
private readonly coordinator;
|
|
34
|
-
private readonly databaseName;
|
|
35
34
|
/**
|
|
36
35
|
* Native BLOB row limits for complete internal Protobuf wrappers.
|
|
37
36
|
*/
|
|
@@ -40,11 +39,10 @@ export declare class MysqlAgentExecution<I, S extends Message> implements AgentE
|
|
|
40
39
|
* Binds tenant-scoped record families and the native transaction coordinator.
|
|
41
40
|
*
|
|
42
41
|
* @param coordinator Native transaction coordinator.
|
|
43
|
-
* @param databaseName Tenant database name.
|
|
44
42
|
* @param input Requested fenced execution change.
|
|
45
43
|
* @param rows Provider record handles bound to the tenant.
|
|
46
44
|
*/
|
|
47
|
-
constructor(input: AgentExecutionStorageInput<I, S>, rows: ExecutionRows<I, S>, coordinator:
|
|
45
|
+
constructor(input: AgentExecutionStorageInput<I, S>, rows: ExecutionRows<I, S>, coordinator: MysqlAgentTransaction);
|
|
48
46
|
/**
|
|
49
47
|
* Persists original accepted work once under the per-instance row lock.
|
|
50
48
|
*
|
|
@@ -133,7 +131,7 @@ export declare class MysqlAgentExecution<I, S extends Message> implements AgentE
|
|
|
133
131
|
* @param token Exclusive claim token.
|
|
134
132
|
* @returns Completion after original output IDs are marked delivered.
|
|
135
133
|
*/
|
|
136
|
-
markDelivered(key: AgentInvocationKey, token: string, expectedRecordBytes: Uint8Array, signals: readonly
|
|
134
|
+
markDelivered(key: AgentInvocationKey, token: string, expectedRecordBytes: Uint8Array, signals: readonly CommandId[]): Promise<void>;
|
|
137
135
|
/**
|
|
138
136
|
* Marks exact saved output IDs within the current per-instance transaction.
|
|
139
137
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-execution.d.ts","sourceRoot":"","sources":["../../src/mysql/agent-execution.ts"],"names":[],"mappings":"AAcA,OAAO,EAAoB,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"agent-execution.d.ts","sourceRoot":"","sources":["../../src/mysql/agent-execution.ts"],"names":[],"mappings":"AAcA,OAAO,EAAoB,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAE3E,OAAO,EAIL,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACxB,MAAM,+EAA+E,CAAC;AACvF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6EAA6E,CAAC;AACtH,OAAO,EAML,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,EAC/B,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACtB,MAAM,sCAAsC,CAAC;AAG9C,OAAO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AC,aAAa;IAarB;;;;;OAKG;YACW,QAAQ;IAStB;;;;;;OAMG;YACW,SAAS;IAmCvB;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IAKtB;;;;;;;OAOG;YACW,gBAAgB;IAU9B;;;;;;OAMG;YACW,OAAO;IAcrB;;;;;;OAMG;YACW,QAAQ;IAetB;;;;;;OAMG;YACW,aAAa;IAe3B;;;;;;OAMG;YACW,cAAc;IA6B5B;;;;;;OAMG;IACH,OAAO,CAAC,kBAAkB;IA+B1B;;;;OAIG;IACH,OAAO,CAAC,cAAc;IAUtB;;;;OAIG;IACH,OAAO,CAAC,YAAY;CAarB"}
|
|
@@ -16,7 +16,7 @@ import { Time } from "@spine-event-engine/core";
|
|
|
16
16
|
import { AgentExecutionHeadSchema, AgentExecutionRecordSchema, AgentInvocationStatus, } from "@spine-event-engine/proto/generated/spine/server/agent/execution_record_pb.js";
|
|
17
17
|
import { AgentExecutionRecords, AgentExecutionSizes, AgentExecutionTransitions, AgentExecutionValues, AgentHistoryRecords, } from "@spine-event-engine/storage/provider";
|
|
18
18
|
import { AgentHistoryHash } from "./agent-history.js";
|
|
19
|
-
import {
|
|
19
|
+
import { MysqlAgentTransaction } from "./agent-transaction.js";
|
|
20
20
|
import { MysqlEntityStorage } from "./entity-history.js";
|
|
21
21
|
import { MysqlRecordStorage } from "./record-storage.js";
|
|
22
22
|
import { AgentExecutionIndexBytes } from "./table-spec.js";
|
|
@@ -30,7 +30,6 @@ export class MysqlAgentExecution {
|
|
|
30
30
|
input;
|
|
31
31
|
rows;
|
|
32
32
|
coordinator;
|
|
33
|
-
databaseName;
|
|
34
33
|
/**
|
|
35
34
|
* Native BLOB row limits for complete internal Protobuf wrappers.
|
|
36
35
|
*/
|
|
@@ -45,15 +44,13 @@ export class MysqlAgentExecution {
|
|
|
45
44
|
* Binds tenant-scoped record families and the native transaction coordinator.
|
|
46
45
|
*
|
|
47
46
|
* @param coordinator Native transaction coordinator.
|
|
48
|
-
* @param databaseName Tenant database name.
|
|
49
47
|
* @param input Requested fenced execution change.
|
|
50
48
|
* @param rows Provider record handles bound to the tenant.
|
|
51
49
|
*/
|
|
52
|
-
constructor(input, rows, coordinator
|
|
50
|
+
constructor(input, rows, coordinator) {
|
|
53
51
|
this.input = input;
|
|
54
52
|
this.rows = rows;
|
|
55
53
|
this.coordinator = coordinator;
|
|
56
|
-
this.databaseName = databaseName;
|
|
57
54
|
}
|
|
58
55
|
/**
|
|
59
56
|
* Persists original accepted work once under the per-instance row lock.
|
|
@@ -311,7 +308,7 @@ export class MysqlAgentExecution {
|
|
|
311
308
|
AgentExecutionTransitions.assertDelivery(pair.record, signals);
|
|
312
309
|
for (const signal of signals)
|
|
313
310
|
AgentExecutionValues.markSignal(AgentExecutionValues.requiredCompletion(pair.record), signal);
|
|
314
|
-
if (pair.record.completion.
|
|
311
|
+
if (pair.record.completion.commands.every((item) => item.delivered)) {
|
|
315
312
|
pair.record.status = AgentInvocationStatus.AGENT_INVOCATION_COMPLETED;
|
|
316
313
|
await this.advanceCandidate(pair.head, key, AgentExecutionValues.requiredOrder(pair.record));
|
|
317
314
|
}
|
|
@@ -382,12 +379,7 @@ export class MysqlAgentExecution {
|
|
|
382
379
|
...rows.entity.tableNames(),
|
|
383
380
|
rows.events.tableName,
|
|
384
381
|
];
|
|
385
|
-
|
|
386
|
-
databaseName: this.databaseName,
|
|
387
|
-
entityKey: AgentExecutionRecords.scope(AgentExecutionValues.requiredScope(key)),
|
|
388
|
-
sourceTypeName: this.input.stateType,
|
|
389
|
-
});
|
|
390
|
-
return this.coordinator.commit(tables, lock, (connection) => rows.invocation.withConnection(connection, () => rows.head.withConnection(connection, () => rows.history.withConnection(connection, () => rows.entity.withConnection(connection, () => rows.events.withConnection(connection, work))))), { requireTransaction: true });
|
|
382
|
+
return this.coordinator.commit(tables, (connection) => rows.invocation.withConnection(connection, () => rows.head.withConnection(connection, () => rows.history.withConnection(connection, () => rows.entity.withConnection(connection, () => rows.events.withConnection(connection, work))))));
|
|
391
383
|
}
|
|
392
384
|
/**
|
|
393
385
|
* Reads a head under the transaction lock and verifies the full scope.
|
|
@@ -590,7 +582,7 @@ export class MysqlAgentExecution {
|
|
|
590
582
|
if (prior.status !== AgentInvocationStatus.AGENT_INVOCATION_ACTIVE ||
|
|
591
583
|
![
|
|
592
584
|
AgentInvocationStatus.AGENT_INVOCATION_COMPLETED,
|
|
593
|
-
AgentInvocationStatus.
|
|
585
|
+
AgentInvocationStatus.AGENT_INVOCATION_COMPLETED_PENDING_COMMANDS,
|
|
594
586
|
].includes(input.next.status))
|
|
595
587
|
throw new Error("Agent completion requires active work and completed status.");
|
|
596
588
|
const initial = completion.initialVersion.number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-execution.js","sourceRoot":"","sources":["../../src/mysql/agent-execution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAgB,MAAM,oBAAoB,CAAC;AAEpE,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAGhD,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,qBAAqB,GAMtB,MAAM,+EAA+E,CAAC;AAEvF,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,yBAAyB,EACzB,oBAAoB,EACpB,mBAAmB,GASpB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAgB3D;;;;;GAKG;AACH,MAAM,OAAO,mBAAmB;IA4BX;IACA;IACA;IACA;IA9BnB;;OAEG;IACM,QAAQ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GAEG;AACH,SAAS,YAAY,CAAC,GAAuB;IAC3C,OAAO,gBAAgB,CAAC,KAAK,CAAC,qBAAqB,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;AACvE,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { PoolConnection } from "mysql2/promise";
|
|
2
|
+
/**
|
|
3
|
+
* Coordinates native MySQL Agent execution transactions.
|
|
4
|
+
*/
|
|
5
|
+
export declare class MysqlAgentTransaction {
|
|
6
|
+
private readonly connections;
|
|
7
|
+
/**
|
|
8
|
+
* Creates an Agent execution transaction helper.
|
|
9
|
+
*
|
|
10
|
+
* @param connections Acquires and releases MySQL connections.
|
|
11
|
+
*/
|
|
12
|
+
constructor(connections: {
|
|
13
|
+
acquire(): Promise<PoolConnection>;
|
|
14
|
+
release(connection: PoolConnection): void;
|
|
15
|
+
});
|
|
16
|
+
/**
|
|
17
|
+
* Commits one fenced Agent mutation in a native transaction.
|
|
18
|
+
*
|
|
19
|
+
* @param tables Lists participating physical tables.
|
|
20
|
+
* @param work Performs the connection-bound mutation.
|
|
21
|
+
* @typeParam T The mutation result type.
|
|
22
|
+
* @returns Returns the work result.
|
|
23
|
+
*/
|
|
24
|
+
commit<T>(tables: readonly string[], work: (connection: PoolConnection) => Promise<T>): Promise<T>;
|
|
25
|
+
/**
|
|
26
|
+
* Determines whether every participating table supports transactions.
|
|
27
|
+
*
|
|
28
|
+
* @param connection Provides the connection used for metadata inspection.
|
|
29
|
+
* @param tables Lists participating physical tables.
|
|
30
|
+
* @returns Resolves whether every table uses InnoDB.
|
|
31
|
+
*/
|
|
32
|
+
private allTransactional;
|
|
33
|
+
/**
|
|
34
|
+
* Commits transactional work and retries one deadlock.
|
|
35
|
+
*
|
|
36
|
+
* @param connection Provides the transaction connection.
|
|
37
|
+
* @param work Performs the connection-bound mutation.
|
|
38
|
+
* @typeParam T The mutation result type.
|
|
39
|
+
* @returns Resolves to the mutation result.
|
|
40
|
+
*/
|
|
41
|
+
private commitTransaction;
|
|
42
|
+
/**
|
|
43
|
+
* Checks whether a failed transaction may be retried once after a deadlock.
|
|
44
|
+
*
|
|
45
|
+
* @param error Native MySQL failure.
|
|
46
|
+
* @returns Whether the error identifies an InnoDB deadlock.
|
|
47
|
+
*/
|
|
48
|
+
private isDeadlock;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=agent-transaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-transaction.d.ts","sourceRoot":"","sources":["../../src/mysql/agent-transaction.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,cAAc,EAAiB,MAAM,gBAAgB,CAAC;AAEpE;;GAEG;AACH,qBAAa,qBAAqB;IAS9B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAN9B;;;;OAIG;gBAEgB,WAAW,EAAE;QAC5B,OAAO,IAAI,OAAO,CAAC,cAAc,CAAC,CAAC;QACnC,OAAO,CAAC,UAAU,EAAE,cAAc,GAAG,IAAI,CAAC;KAC3C;IAGH;;;;;;;OAOG;IACG,MAAM,CAAC,CAAC,EACZ,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,IAAI,EAAE,CAAC,UAAU,EAAE,cAAc,KAAK,OAAO,CAAC,CAAC,CAAC,GAC/C,OAAO,CAAC,CAAC,CAAC;IAYb;;;;;;OAMG;YACW,gBAAgB;IAa9B;;;;;;;OAOG;YACW,iBAAiB;IAmB/B;;;;;OAKG;IACH,OAAO,CAAC,UAAU;CAOnB"}
|
|
@@ -11,26 +11,14 @@
|
|
|
11
11
|
* or implied. See the License for the specific language governing permissions and limitations under
|
|
12
12
|
* the License.
|
|
13
13
|
*/
|
|
14
|
-
import { createHash } from "node:crypto";
|
|
15
14
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* @param identity Identifies the Entity commit.
|
|
19
|
-
* @returns Returns the advisory-lock key.
|
|
15
|
+
* Coordinates native MySQL Agent execution transactions.
|
|
20
16
|
*/
|
|
21
|
-
export
|
|
22
|
-
return createHash("sha256")
|
|
23
|
-
.update([identity.databaseName, identity.sourceTypeName, identity.entityKey].join("\u0000"))
|
|
24
|
-
.digest("hex");
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Coordinates one-connection Entity commits.
|
|
28
|
-
*/
|
|
29
|
-
export class MysqlEntityCommitCoordinator {
|
|
17
|
+
export class MysqlAgentTransaction {
|
|
30
18
|
connections;
|
|
31
19
|
// prettier-ignore
|
|
32
20
|
/**
|
|
33
|
-
* Creates an
|
|
21
|
+
* Creates an Agent execution transaction helper.
|
|
34
22
|
*
|
|
35
23
|
* @param connections Acquires and releases MySQL connections.
|
|
36
24
|
*/
|
|
@@ -38,31 +26,22 @@ export class MysqlEntityCommitCoordinator {
|
|
|
38
26
|
this.connections = connections;
|
|
39
27
|
}
|
|
40
28
|
/**
|
|
41
|
-
* Commits one
|
|
29
|
+
* Commits one fenced Agent mutation in a native transaction.
|
|
42
30
|
*
|
|
43
31
|
* @param tables Lists participating physical tables.
|
|
44
|
-
* @param key Identifies the advisory lock.
|
|
45
32
|
* @param work Performs the connection-bound mutation.
|
|
46
|
-
* @param options Requires a transaction when the caller cannot use an advisory lock.
|
|
47
33
|
* @typeParam T The mutation result type.
|
|
48
34
|
* @returns Returns the work result.
|
|
49
35
|
*/
|
|
50
|
-
async commit(tables,
|
|
36
|
+
async commit(tables, work) {
|
|
51
37
|
const connection = await this.connections.acquire();
|
|
52
|
-
let locked = false;
|
|
53
38
|
try {
|
|
54
39
|
const transactional = await this.allTransactional(connection, tables);
|
|
55
|
-
if (!transactional
|
|
56
|
-
throw new Error("MySQL
|
|
57
|
-
|
|
58
|
-
return await this.commitTransaction(connection, work);
|
|
59
|
-
await this.acquireLock(connection, key);
|
|
60
|
-
locked = true;
|
|
61
|
-
return await work(connection, false);
|
|
40
|
+
if (!transactional)
|
|
41
|
+
throw new Error("MySQL Agent execution requires transactional record tables.");
|
|
42
|
+
return await this.commitTransaction(connection, work);
|
|
62
43
|
}
|
|
63
44
|
finally {
|
|
64
|
-
if (locked)
|
|
65
|
-
await connection.execute("SELECT RELEASE_LOCK(?)", [key]).catch(() => undefined);
|
|
66
45
|
this.connections.release(connection);
|
|
67
46
|
}
|
|
68
47
|
}
|
|
@@ -89,13 +68,13 @@ export class MysqlEntityCommitCoordinator {
|
|
|
89
68
|
for (let attempt = 0; attempt < 2; attempt += 1) {
|
|
90
69
|
try {
|
|
91
70
|
await connection.beginTransaction();
|
|
92
|
-
const result = await work(connection
|
|
71
|
+
const result = await work(connection);
|
|
93
72
|
await connection.commit();
|
|
94
73
|
return result;
|
|
95
74
|
}
|
|
96
75
|
catch (error) {
|
|
97
76
|
await connection.rollback().catch(() => undefined);
|
|
98
|
-
if (attempt === 0 && isDeadlock(error))
|
|
77
|
+
if (attempt === 0 && this.isDeadlock(error))
|
|
99
78
|
continue;
|
|
100
79
|
throw error;
|
|
101
80
|
}
|
|
@@ -103,21 +82,15 @@ export class MysqlEntityCommitCoordinator {
|
|
|
103
82
|
throw new Error("Unreachable InnoDB commit retry.");
|
|
104
83
|
}
|
|
105
84
|
/**
|
|
106
|
-
*
|
|
85
|
+
* Checks whether a failed transaction may be retried once after a deadlock.
|
|
107
86
|
*
|
|
108
|
-
* @param
|
|
109
|
-
* @
|
|
110
|
-
* @returns Resolves after the lock is acquired.
|
|
87
|
+
* @param error Native MySQL failure.
|
|
88
|
+
* @returns Whether the error identifies an InnoDB deadlock.
|
|
111
89
|
*/
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
90
|
+
isDeadlock(error) {
|
|
91
|
+
return (typeof error === "object" &&
|
|
92
|
+
error !== null &&
|
|
93
|
+
error.code === "ER_LOCK_DEADLOCK");
|
|
116
94
|
}
|
|
117
95
|
}
|
|
118
|
-
|
|
119
|
-
return (typeof error === "object" &&
|
|
120
|
-
error !== null &&
|
|
121
|
-
error.code === "ER_LOCK_DEADLOCK");
|
|
122
|
-
}
|
|
123
|
-
//# sourceMappingURL=entity-commit.js.map
|
|
96
|
+
//# sourceMappingURL=agent-transaction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-transaction.js","sourceRoot":"","sources":["../../src/mysql/agent-transaction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH;;GAEG;AACH,MAAM,OAAO,qBAAqB;IASb;IARnB,kBAAkB;IAElB;;;;OAIG;IACH,YACmB,WAGhB;QAHgB,gBAAW,GAAX,WAAW,CAG3B;IACA,CAAC;IAEJ;;;;;;;OAOG;IACH,KAAK,CAAC,MAAM,CACV,MAAyB,EACzB,IAAgD;QAEhD,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;QACpD,IAAI,CAAC;YACH,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;YACtE,IAAI,CAAC,aAAa;gBAChB,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAC;YACjF,OAAO,MAAM,IAAI,CAAC,iBAAiB,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QACxD,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QACvC,CAAC;IACH,CAAC;IAED;;;;;;OAMG;IACK,KAAK,CAAC,gBAAgB,CAC5B,UAA0B,EAC1B,MAAyB;QAEzB,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,UAAU,CAAC,KAAK,CACnC,4GAA4G,EAC5G,CAAC,MAAM,CAAC,CACT,CAAC;QACF,OAAO,CACL,IAAI,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,QAAQ,CAAC,CAC7F,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACK,KAAK,CAAC,iBAAiB,CAC7B,UAA0B,EAC1B,IAAgD;QAEhD,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,GAAG,CAAC,EAAE,OAAO,IAAI,CAAC,EAAE,CAAC;YAChD,IAAI,CAAC;gBACH,MAAM,UAAU,CAAC,gBAAgB,EAAE,CAAC;gBACpC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,CAAC;gBACtC,MAAM,UAAU,CAAC,MAAM,EAAE,CAAC;gBAC1B,OAAO,MAAM,CAAC;YAChB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,UAAU,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;gBACnD,IAAI,OAAO,KAAK,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;oBAAE,SAAS;gBACtD,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACtD,CAAC;IAED;;;;;OAKG;IACK,UAAU,CAAC,KAAc;QAC/B,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;YACzB,KAAK,KAAK,IAAI;YACb,KAA4B,CAAC,IAAI,KAAK,kBAAkB,CAC1D,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -4,17 +4,28 @@ import type { EntityRecord } from "@spine-event-engine/proto/generated/spine/ser
|
|
|
4
4
|
import { RecordSpec } from "@spine-event-engine/storage";
|
|
5
5
|
import { type EntityEventHistoryPort, type EntityRecordStorage, type EntityStateHistoryPort, type EntityStorageInput } from "@spine-event-engine/storage/provider";
|
|
6
6
|
import { MysqlRecordStorage } from "./record-storage.js";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
/**
|
|
8
|
+
|
|
9
|
+
* Opens one MySQL record family for Entity storage.
|
|
10
|
+
|
|
11
|
+
*/
|
|
12
|
+
interface OpenRecords {
|
|
13
|
+
/**
|
|
14
|
+
* Creates a scoped record handle.
|
|
15
|
+
*
|
|
16
|
+
* @typeParam Id Record identifier type.
|
|
17
|
+
* @typeParam R Stored record message type.
|
|
18
|
+
* @param spec Defines the record family.
|
|
19
|
+
* @param group Selects an optional history group.
|
|
20
|
+
* @returns The MySQL record handle.
|
|
21
|
+
*/
|
|
22
|
+
<Id, R extends Message>(spec: RecordSpec<Id, R>, group?: import("@spine-event-engine/storage").StorageGroup): MysqlRecordStorage<Id, R>;
|
|
15
23
|
}
|
|
16
24
|
/**
|
|
17
25
|
* Describes MySQL-backed Entity record-family handles.
|
|
26
|
+
*
|
|
27
|
+
* @typeParam I Entity identifier type.
|
|
28
|
+
* @typeParam S Entity state message type.
|
|
18
29
|
*/
|
|
19
30
|
export interface MysqlEntityStorageHandle<I, S extends Message> {
|
|
20
31
|
/**
|
|
@@ -42,6 +53,9 @@ export interface MysqlEntityStorageHandle<I, S extends Message> {
|
|
|
42
53
|
}
|
|
43
54
|
/**
|
|
44
55
|
* Provides MySQL-backed Entity current and history storage.
|
|
56
|
+
*
|
|
57
|
+
* @typeParam I Entity identifier type.
|
|
58
|
+
* @typeParam S Entity state message type.
|
|
45
59
|
*/
|
|
46
60
|
export declare class MysqlEntityStorage<I, S extends Message> implements MysqlEntityStorageHandle<I, S> {
|
|
47
61
|
#private;
|
|
@@ -65,14 +79,7 @@ export declare class MysqlEntityStorage<I, S extends Message> implements MysqlEn
|
|
|
65
79
|
* @param open Opens one record-family storage handle.
|
|
66
80
|
* @param onClose Removes this Entity handle from its factory.
|
|
67
81
|
*/
|
|
68
|
-
constructor(input: EntityStorageInput<I, S>, open:
|
|
69
|
-
/**
|
|
70
|
-
* Reads the current Entity record while the coordinator owns its row lock.
|
|
71
|
-
*
|
|
72
|
-
* @param id Identifies the Entity.
|
|
73
|
-
* @returns Resolves to the current record when present.
|
|
74
|
-
*/
|
|
75
|
-
readCurrentLocked(id: I): Promise<EntityRecord | undefined>;
|
|
82
|
+
constructor(input: EntityStorageInput<I, S>, open: OpenRecords, onClose?: () => void);
|
|
76
83
|
/**
|
|
77
84
|
* Returns whether this Entity storage handle accepts operations.
|
|
78
85
|
*
|
|
@@ -84,40 +91,42 @@ export declare class MysqlEntityStorage<I, S extends Message> implements MysqlEn
|
|
|
84
91
|
*/
|
|
85
92
|
close(): void;
|
|
86
93
|
/**
|
|
87
|
-
*
|
|
94
|
+
* Prepares every Entity record-family table.
|
|
88
95
|
*
|
|
89
|
-
* @
|
|
90
|
-
* @param work Performs the bound storage work.
|
|
91
|
-
* @returns Returns the work result.
|
|
96
|
+
* @returns Resolves after the tables are ready.
|
|
92
97
|
*/
|
|
93
|
-
|
|
98
|
+
prepare(): Promise<void>;
|
|
94
99
|
/**
|
|
95
|
-
* Returns
|
|
100
|
+
* Returns physical Entity-family tables for an Agent transaction.
|
|
96
101
|
*
|
|
97
|
-
* @returns
|
|
102
|
+
* @returns Current and configured history table names.
|
|
98
103
|
*/
|
|
99
104
|
tableNames(): readonly string[];
|
|
100
105
|
/**
|
|
101
|
-
*
|
|
106
|
+
* Binds Entity-family work to the Agent transaction connection.
|
|
102
107
|
*
|
|
103
|
-
* @
|
|
108
|
+
* @typeParam T Result of the bound work.
|
|
109
|
+
* @param connection Active Agent transaction connection.
|
|
110
|
+
* @param work Entity work to run on that connection.
|
|
111
|
+
* @returns Result of the work.
|
|
104
112
|
*/
|
|
105
|
-
|
|
113
|
+
withConnection<T>(connection: import("mysql2/promise").PoolConnection, work: () => Promise<T>): Promise<T>;
|
|
106
114
|
/**
|
|
107
|
-
*
|
|
115
|
+
* Reads current Entity state with the Agent transaction lock.
|
|
108
116
|
*
|
|
109
|
-
* @param
|
|
110
|
-
* @
|
|
111
|
-
* @returns Resolves when every record is compatible.
|
|
117
|
+
* @param id Typed Entity ID.
|
|
118
|
+
* @returns Current record when present.
|
|
112
119
|
*/
|
|
113
|
-
|
|
120
|
+
readCurrentLocked(id: I): Promise<EntityRecord | undefined>;
|
|
114
121
|
/**
|
|
115
|
-
*
|
|
122
|
+
* Returns configured Entity history writers for the Agent transaction.
|
|
116
123
|
*
|
|
117
|
-
* @
|
|
118
|
-
* @returns Returns the private Entity-family commit capability.
|
|
124
|
+
* @returns Transaction-bound immutable history appenders.
|
|
119
125
|
*/
|
|
120
|
-
commitCapability():
|
|
126
|
+
commitCapability(): {
|
|
127
|
+
appendStateImmutable(record: EntityRecord): Promise<void>;
|
|
128
|
+
appendDiagnosticImmutable(record: Event): Promise<void>;
|
|
129
|
+
};
|
|
121
130
|
}
|
|
122
131
|
export {};
|
|
123
132
|
//# sourceMappingURL=entity-history.d.ts.map
|