@balena/pinejs 14.46.0 → 14.47.0-linear-runtime-migrator-043dcdc179048a5a4caff4efeeb9acdb4507d206
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/.versionbot/CHANGELOG.yml +32 -1
- package/CHANGELOG.md +7 -1
- package/VERSION +1 -1
- package/docs/Migrations.md +101 -1
- package/out/config-loader/config-loader.d.ts +1 -0
- package/out/config-loader/config-loader.js +90 -74
- package/out/config-loader/config-loader.js.map +1 -1
- package/out/config-loader/env.d.ts +3 -0
- package/out/config-loader/env.js +3 -0
- package/out/config-loader/env.js.map +1 -1
- package/out/migrator/async.d.ts +6 -0
- package/out/migrator/async.js +153 -0
- package/out/migrator/async.js.map +1 -0
- package/out/migrator/migrations.sbvr +66 -0
- package/out/migrator/sync.js +7 -8
- package/out/migrator/sync.js.map +1 -1
- package/out/migrator/utils.d.ts +32 -4
- package/out/migrator/utils.js +87 -14
- package/out/migrator/utils.js.map +1 -1
- package/out/sbvr-api/sbvr-utils.d.ts +4 -1
- package/out/sbvr-api/sbvr-utils.js +19 -1
- package/out/sbvr-api/sbvr-utils.js.map +1 -1
- package/package.json +3 -3
- package/src/config-loader/config-loader.ts +28 -2
- package/src/config-loader/env.ts +3 -0
- package/src/migrator/async.ts +275 -0
- package/src/migrator/migrations.sbvr +66 -0
- package/src/migrator/sync.ts +15 -14
- package/src/migrator/utils.ts +140 -22
- package/src/sbvr-api/sbvr-utils.ts +30 -0
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
- commits:
|
|
2
|
+
- subject: Add async migrator Needed for long lasting / massive data affecting
|
|
3
|
+
migrations for zero downtime of API.
|
|
4
|
+
hash: 043dcdc179048a5a4caff4efeeb9acdb4507d206
|
|
5
|
+
body: ""
|
|
6
|
+
footer:
|
|
7
|
+
Change-type: minor
|
|
8
|
+
change-type: minor
|
|
9
|
+
Signed-off-by: Harald Fischer <harald@balena.io>
|
|
10
|
+
signed-off-by: Harald Fischer <harald@balena.io>
|
|
11
|
+
author: Harald Fischer
|
|
12
|
+
nested: []
|
|
13
|
+
- subject: Add cross-usable flag for model exists before init
|
|
14
|
+
hash: 32f02f03e1d014d27c9e240a200fc99d42605344
|
|
15
|
+
body: >
|
|
16
|
+
Modules may need to know if a model existed before initialisation of the
|
|
17
|
+
instance.
|
|
18
|
+
|
|
19
|
+
Eg. migrations need to know if a model is freshly generated / executed
|
|
20
|
+
|
|
21
|
+
of if this model already existed and can be target for migrations.
|
|
22
|
+
footer:
|
|
23
|
+
Change-type: minor
|
|
24
|
+
change-type: minor
|
|
25
|
+
Signed-off-by: Harald Fischer <harald@balena.io>
|
|
26
|
+
signed-off-by: Harald Fischer <harald@balena.io>
|
|
27
|
+
author: Harald Fischer
|
|
28
|
+
nested: []
|
|
29
|
+
version: 14.47.0
|
|
30
|
+
title: "'Async runtime migrator'"
|
|
31
|
+
date: 2022-06-23T00:52:02.686Z
|
|
1
32
|
- commits:
|
|
2
33
|
- subject: Fix for passport.js update 0.6.0
|
|
3
34
|
hash: c26d33dd13e4139b970e5bd594982786a1c56cea
|
|
@@ -13,7 +44,7 @@
|
|
|
13
44
|
nested: []
|
|
14
45
|
version: 14.46.0
|
|
15
46
|
title: "'Fix for passport.js update 0.6.0'"
|
|
16
|
-
date: 2022-06-
|
|
47
|
+
date: 2022-06-21T23:27:28.468Z
|
|
17
48
|
- commits:
|
|
18
49
|
- subject: Update dependencies
|
|
19
50
|
hash: fb47772d628789b77288e7e0e90f3740f6cd27d8
|
package/CHANGELOG.md
CHANGED
|
@@ -4,8 +4,14 @@ All notable changes to this project will be documented in this file
|
|
|
4
4
|
automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY!
|
|
5
5
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
|
6
6
|
|
|
7
|
+
# v14.47.0
|
|
8
|
+
## (2022-06-23)
|
|
9
|
+
|
|
10
|
+
* Add async migrator Needed for long lasting / massive data affecting migrations for zero downtime of API. [Harald Fischer]
|
|
11
|
+
* Add cross-usable flag for model exists before init [Harald Fischer]
|
|
12
|
+
|
|
7
13
|
# v14.46.0
|
|
8
|
-
## (2022-06-
|
|
14
|
+
## (2022-06-21)
|
|
9
15
|
|
|
10
16
|
* Fix for passport.js update 0.6.0 [Harald Fischer]
|
|
11
17
|
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
14.
|
|
1
|
+
14.47.0
|
package/docs/Migrations.md
CHANGED
|
@@ -46,4 +46,104 @@ Migrations which are Node modules should export a function which will be called
|
|
|
46
46
|
|
|
47
47
|
You can execute SQL using `tx.executeSql(query)`, however note that the model for which the migration is running will *not* be available under `sbvrUtils.api`, as it has not executed yet.
|
|
48
48
|
|
|
49
|
-
You should return a promise so pinejs can wait for completion/errors.
|
|
49
|
+
You should return a promise so pinejs can wait for completion/errors.
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
## Async Migrations
|
|
53
|
+
|
|
54
|
+
Migrations that may lock tables for a long time, eg. column renames on large tables, can be run as async migrations.
|
|
55
|
+
|
|
56
|
+
Async migrations are executed in small batches within individual transactions and run concurrently while Pine is serving requests. Async migrations are multi-instance safe. They are synchronized between instances via the `migration status` database table and the minimum interval between two migration executions is guaranteed across instances.
|
|
57
|
+
|
|
58
|
+
When Pine starts and determines there are multiple async migrations to be run, it starts all migrations concurrently. These migrations however do not run in parallel: only one migration batch is executed at any given time, then another, and so on. Thus, migrations should not depend on the result a previous one.
|
|
59
|
+
Once an async migration starts, it keeps running forever until the server is shutdown. This is to guarantee that new data inserted or updated at runtime can also be migrated. The status of running migrations can be checked in `migration status` table. The configured execution parameters and the execution metrics are stored and updated after each migration batch completes.
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
Async migrations are stored in the migrations folder, alongside synchronous migrations. Their file names are significant and must contain the string `.async.` so they are treated as async migrations. They can be pure SQL (with `.sql` extension) or Typescript (with `.ts`/`.js` extensions) files.
|
|
63
|
+
|
|
64
|
+
The async migration query must have a `LIMIT` statement to limit the maximum number of affected rows per batch.
|
|
65
|
+
|
|
66
|
+
### TS migration file format with SQL query string
|
|
67
|
+
|
|
68
|
+
``` javascript
|
|
69
|
+
export = {
|
|
70
|
+
sql: `\
|
|
71
|
+
UPDATE "test"
|
|
72
|
+
SET "columnC" = "test"."columnA"
|
|
73
|
+
WHERE id IN ( SELECT id FROM (
|
|
74
|
+
SELECT id FROM "test"
|
|
75
|
+
WHERE "test"."columnA" <> "test"."columnC" OR "test"."columnC" IS NULL
|
|
76
|
+
LIMIT 1
|
|
77
|
+
|
|
78
|
+
) tmp
|
|
79
|
+
);
|
|
80
|
+
`,
|
|
81
|
+
delayMS: 100,
|
|
82
|
+
backoffDelayMS: 4000,
|
|
83
|
+
errorThreshold: 15,
|
|
84
|
+
};
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### TS migration file format with migrator funtion definition
|
|
88
|
+
|
|
89
|
+
``` javascript
|
|
90
|
+
export = {
|
|
91
|
+
fn: async (tx: any) => {
|
|
92
|
+
const staticSql = `\
|
|
93
|
+
UPDATE "test"
|
|
94
|
+
SET "columnC" = "test"."columnA"
|
|
95
|
+
WHERE id IN ( SELECT id FROM (
|
|
96
|
+
SELECT id FROM "test"
|
|
97
|
+
WHERE "test"."columnA" <> "test"."columnC" OR "test"."columnC" IS NULL
|
|
98
|
+
LIMIT 1
|
|
99
|
+
|
|
100
|
+
) tmp
|
|
101
|
+
);
|
|
102
|
+
`;
|
|
103
|
+
|
|
104
|
+
return await tx.executeSql(staticSql);
|
|
105
|
+
},
|
|
106
|
+
delayMS: 100,
|
|
107
|
+
backoffDelayMS: 4000,
|
|
108
|
+
errorThreshold: 15,
|
|
109
|
+
};
|
|
110
|
+
```
|
|
111
|
+
### SQL query file (plain text)
|
|
112
|
+
|
|
113
|
+
The default values for interval, backoff and error threshold are:
|
|
114
|
+
```js
|
|
115
|
+
{
|
|
116
|
+
asyncMigrationDefaultDelayMS: 1000,
|
|
117
|
+
asyncMigrationDefaultBackoffDelayMS: 60000,
|
|
118
|
+
asyncMigrationDefaultErrorThreshold: 10
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Some dummy data setup for explanation:
|
|
123
|
+
``` sql
|
|
124
|
+
DROP TABLE IF EXISTS "test";
|
|
125
|
+
|
|
126
|
+
CREATE TABLE IF NOT EXISTS "test" (
|
|
127
|
+
"created at" TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
|
128
|
+
, "id" BIGINT NOT NULL PRIMARY KEY
|
|
129
|
+
, "columnA" VARCHAR(255) NOT NULL UNIQUE
|
|
130
|
+
, "columnB" VARCHAR(255) NOT NULL
|
|
131
|
+
, "columnC" VARCHAR(255) NULL
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
INSERT INTO "test" ("id","columnA", "columnB", "columnC")
|
|
136
|
+
VALUES (1,'a001','b001',NULL), (2,'a002','b002', NULL), (3,'a003','b003', NULL), (4,'a004','b004', 'dummy');
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
async migration date update query. This query will be executed for 4 times with a default iteration interval of 500ms.
|
|
140
|
+
``` sql
|
|
141
|
+
UPDATE "test"
|
|
142
|
+
SET "columnC" = "test"."columnA"
|
|
143
|
+
WHERE id IN ( SELECT id FROM (
|
|
144
|
+
SELECT id FROM "test"
|
|
145
|
+
WHERE "test"."columnA" <> "test"."columnC" OR "test"."columnC" IS NULL
|
|
146
|
+
LIMIT 1
|
|
147
|
+
) tmp
|
|
148
|
+
);
|
|
149
|
+
```
|
|
@@ -35,93 +35,105 @@ const getOrCreatePermission = async (authApiTx, permissionName) => {
|
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
const setup = (app) => {
|
|
38
|
-
const loadConfig =
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
user.permissions.forEach((permissionName) => {
|
|
53
|
-
if (permissionsCache[permissionName] != null) {
|
|
38
|
+
const loadConfig = async (data) => {
|
|
39
|
+
await sbvrUtils.db.transaction(async (tx) => {
|
|
40
|
+
const authApiTx = sbvrUtils.api.Auth.clone({
|
|
41
|
+
passthrough: {
|
|
42
|
+
tx,
|
|
43
|
+
req: permissions.root,
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
const { users } = data;
|
|
47
|
+
if (users != null) {
|
|
48
|
+
const permissionsCache = {};
|
|
49
|
+
users.forEach((user) => {
|
|
50
|
+
if (user.permissions == null) {
|
|
54
51
|
return;
|
|
55
52
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const userID = await getOrCreate(authApiTx, 'user', {
|
|
62
|
-
username: user.username,
|
|
63
|
-
}, {
|
|
64
|
-
password: user.password,
|
|
53
|
+
user.permissions.forEach((permissionName) => {
|
|
54
|
+
if (permissionsCache[permissionName] != null) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
permissionsCache[permissionName] = getOrCreatePermission(authApiTx, permissionName);
|
|
65
58
|
});
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
})
|
|
59
|
+
});
|
|
60
|
+
await Promise.all(users.map(async (user) => {
|
|
61
|
+
try {
|
|
62
|
+
const userID = await getOrCreate(authApiTx, 'user', {
|
|
63
|
+
username: user.username,
|
|
64
|
+
}, {
|
|
65
|
+
password: user.password,
|
|
66
|
+
});
|
|
67
|
+
if (user.permissions != null) {
|
|
68
|
+
await Promise.all(user.permissions.map(async (permissionName) => {
|
|
69
|
+
const permissionID = await permissionsCache[permissionName];
|
|
70
|
+
await getOrCreate(authApiTx, 'user__has__permission', {
|
|
71
|
+
user: userID,
|
|
72
|
+
permission: permissionID,
|
|
73
|
+
});
|
|
74
|
+
}));
|
|
75
|
+
}
|
|
74
76
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
throw e;
|
|
79
|
-
}
|
|
80
|
-
}));
|
|
81
|
-
}
|
|
82
|
-
await Promise.all(data.models.map(async (model) => {
|
|
83
|
-
if ((model.abstractSql != null || model.modelText != null) &&
|
|
84
|
-
model.apiRoot != null) {
|
|
85
|
-
try {
|
|
86
|
-
await sbvrUtils.executeModel(tx, model);
|
|
87
|
-
const apiRoute = `/${model.apiRoot}/*`;
|
|
88
|
-
app.options(apiRoute, (_req, res) => res.status(200).end());
|
|
89
|
-
app.all(apiRoute, sbvrUtils.handleODataRequest);
|
|
90
|
-
console.info('Successfully executed ' + model.modelName + ' model.');
|
|
91
|
-
}
|
|
92
|
-
catch (err) {
|
|
93
|
-
const message = `Failed to execute ${model.modelName} model from ${model.modelFile}`;
|
|
94
|
-
if (_.isError(err)) {
|
|
95
|
-
err.message = message;
|
|
96
|
-
throw err;
|
|
77
|
+
catch (e) {
|
|
78
|
+
e.message = `Could not create or find user "${user.username}": ${e.message}`;
|
|
79
|
+
throw e;
|
|
97
80
|
}
|
|
98
|
-
|
|
99
|
-
}
|
|
81
|
+
}));
|
|
100
82
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
83
|
+
await Promise.all(data.models.map(async (model) => {
|
|
84
|
+
if ((model.abstractSql != null || model.modelText != null) &&
|
|
85
|
+
model.apiRoot != null) {
|
|
86
|
+
model.modelExistsBeforeInit =
|
|
87
|
+
await sbvrUtils.checkModelAlreadyExists(tx, model.apiRoot);
|
|
104
88
|
try {
|
|
105
|
-
|
|
89
|
+
await sbvrUtils.executeModel(tx, model);
|
|
90
|
+
const apiRoute = `/${model.apiRoot}/*`;
|
|
91
|
+
app.options(apiRoute, (_req, res) => res.status(200).end());
|
|
92
|
+
app.all(apiRoute, sbvrUtils.handleODataRequest);
|
|
93
|
+
console.info('Successfully executed ' + model.modelName + ' model.');
|
|
106
94
|
}
|
|
107
|
-
catch (
|
|
108
|
-
|
|
109
|
-
|
|
95
|
+
catch (err) {
|
|
96
|
+
const message = `Failed to execute ${model.modelName} model from ${model.modelFile}`;
|
|
97
|
+
if (_.isError(err)) {
|
|
98
|
+
err.message = message;
|
|
99
|
+
throw err;
|
|
100
|
+
}
|
|
101
|
+
throw new Error(message);
|
|
110
102
|
}
|
|
111
103
|
}
|
|
112
|
-
|
|
113
|
-
customCode
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
104
|
+
if (model.customServerCode != null) {
|
|
105
|
+
let customCode;
|
|
106
|
+
if (typeof model.customServerCode === 'string') {
|
|
107
|
+
try {
|
|
108
|
+
customCode = nodeRequire(model.customServerCode).setup;
|
|
109
|
+
}
|
|
110
|
+
catch (e) {
|
|
111
|
+
e.message = `Error loading custom server code: '${e.message}'`;
|
|
112
|
+
throw e;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
else if (_.isObject(model.customServerCode)) {
|
|
116
|
+
customCode = model.customServerCode.setup;
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
throw new Error(`Invalid type for customServerCode '${typeof model.customServerCode}'`);
|
|
120
|
+
}
|
|
121
|
+
if (typeof customCode !== 'function') {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
await customCode(app, sbvrUtils, sbvrUtils.db);
|
|
120
125
|
}
|
|
121
|
-
|
|
126
|
+
}));
|
|
127
|
+
});
|
|
128
|
+
await Promise.all(data.models.map(async (model) => {
|
|
129
|
+
if ((model.abstractSql != null || model.modelText != null) &&
|
|
130
|
+
model.migrations != null &&
|
|
131
|
+
model.apiRoot != null &&
|
|
132
|
+
Object.keys(model.migrations).includes(utils_1.MigrationCategories.async)) {
|
|
133
|
+
await sbvrUtils.executeAsyncModelMigration(model);
|
|
122
134
|
}
|
|
123
135
|
}));
|
|
124
|
-
}
|
|
136
|
+
};
|
|
125
137
|
const loadConfigFile = async (configPath) => {
|
|
126
138
|
console.info('Loading config:', configPath);
|
|
127
139
|
return await Promise.resolve().then(() => require(configPath));
|
|
@@ -182,6 +194,10 @@ const setup = (app) => {
|
|
|
182
194
|
}
|
|
183
195
|
const assignMigrationWithCategory = (newMigrationKey, newMigration) => {
|
|
184
196
|
const catMigrations = migrations[migrationCategory] || {};
|
|
197
|
+
if (typeof newMigration === 'object' &&
|
|
198
|
+
migrationCategory === 'async') {
|
|
199
|
+
newMigration.type = 'async';
|
|
200
|
+
}
|
|
185
201
|
if (typeof catMigrations === 'object') {
|
|
186
202
|
migrations[migrationCategory] = {
|
|
187
203
|
[newMigrationKey]: newMigration,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-loader.js","sourceRoot":"","sources":["../../src/config-loader/config-loader.ts"],"names":[],"mappings":";;;AAKA,6CAK2B;AAE3B,yBAAyB;AACzB,4BAA4B;AAC5B,6BAA6B;AAE7B,oDAAoD;AAEpD,uDAAuD;
|
|
1
|
+
{"version":3,"file":"config-loader.js","sourceRoot":"","sources":["../../src/config-loader/config-loader.ts"],"names":[],"mappings":";;;AAKA,6CAK2B;AAE3B,yBAAyB;AACzB,4BAA4B;AAC5B,6BAA6B;AAE7B,oDAAoD;AAEpD,uDAAuD;AAoCvD,MAAM,WAAW,GAAG,KAAK,EACxB,SAAiC,EACjC,QAAgB,EAChB,YAAuB,EACvB,WAAuB,EACtB,EAAE;IACH,MAAM,MAAM,GAAG,CAAC,MAAM,SAAS,CAAC,GAAG,CAAC;QACnC,QAAQ;QACR,EAAE,EAAE,YAAY;QAChB,OAAO,EAAE;YACR,OAAO,EAAE,IAAI;SACb;KACD,CAAC,CAA+B,CAAC;IAClC,IAAI,MAAM,IAAI,IAAI,EAAE;QACnB,OAAO,MAAM,CAAC,EAAE,CAAC;KACjB;IACD,MAAM,EAAE,EAAE,EAAE,GAAG,CAAC,MAAM,SAAS,CAAC,IAAI,CAAC;QACpC,QAAQ;QACR,IA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E,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;YAClE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SAChB;IACF,CAAC,CAAC;IAEF,OAAO;QACN,UAAU;QACV,qBAAqB;KACrB,CAAC;AACH,CAAC,CAAC;AAlRW,QAAA,KAAK,SAkRhB"}
|
|
@@ -42,5 +42,8 @@ export declare const db: {
|
|
|
42
42
|
export declare const migrator: {
|
|
43
43
|
lockTimeout: number;
|
|
44
44
|
lockFailDelay: number;
|
|
45
|
+
asyncMigrationDefaultDelayMS: number;
|
|
46
|
+
asyncMigrationDefaultBackoffDelayMS: number;
|
|
47
|
+
asyncMigrationDefaultErrorThreshold: number;
|
|
45
48
|
};
|
|
46
49
|
export {};
|
package/out/config-loader/env.js
CHANGED
|
@@ -73,5 +73,8 @@ exports.db = {
|
|
|
73
73
|
exports.migrator = {
|
|
74
74
|
lockTimeout: 5 * 60 * 1000,
|
|
75
75
|
lockFailDelay: 20 * 1000,
|
|
76
|
+
asyncMigrationDefaultDelayMS: 1000,
|
|
77
|
+
asyncMigrationDefaultBackoffDelayMS: 60000,
|
|
78
|
+
asyncMigrationDefaultErrorThreshold: 10,
|
|
76
79
|
};
|
|
77
80
|
//# sourceMappingURL=env.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/config-loader/env.ts"],"names":[],"mappings":";;;AACA,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;AACzD,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE;IAEtD,OAAO,CAAC,IAAI,CAAC,mCAAmC,YAAY,GAAG,CAAC,CAAC;CACjE;AAEY,QAAA,KAAK,GACjB,YAAY,KAAK,GAAG,IAAI,CAAC,YAAY,KAAK,GAAG,IAAI,CAAC,C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AgB,EAAE,SAA+B;IACjD,YAAY,EAAE,SAA+B;IAC7C,uBAAuB,EAAE,KAA2B;IACpD,SAAS,EAAE,IAA2B;IACtC,eAAe,EAAE,KAAK;IACtB,SAAS;IACT,OAAO,EAAE,QAAQ;IACjB,kBAAkB,EAAE,CAAC;CACrB,CAAC;AAEW,QAAA,QAAQ,GAAG;IACvB,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI;IAE1B,aAAa,EAAE,EAAE,GAAG,IAAI;IACxB,4BAA4B,EAAE,IAAI;IAClC,mCAAmC,EAAE,KAAK;IAC1C,mCAAmC,EAAE,EAAE;CACvC,CAAC"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.run = void 0;
|
|
4
|
+
const _ = require("lodash");
|
|
5
|
+
const sbvrUtils = require("../sbvr-api/sbvr-utils");
|
|
6
|
+
const utils_1 = require("./utils");
|
|
7
|
+
const run = async (model) => {
|
|
8
|
+
var _a, _b;
|
|
9
|
+
const { migrations } = model;
|
|
10
|
+
if (migrations == null || _.isEmpty(migrations)) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
const asyncMigrations = migrations[utils_1.MigrationCategories.async];
|
|
14
|
+
if (asyncMigrations == null || typeof asyncMigrations !== 'object') {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
if ((0, utils_1.isAsyncMigration)(asyncMigrations)) {
|
|
18
|
+
((_b = (_a = sbvrUtils.api.migrations) === null || _a === void 0 ? void 0 : _a.logger.info) !== null && _b !== void 0 ? _b : console.info)('Async Migration dictionary format violation.');
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
await $run(model, asyncMigrations);
|
|
22
|
+
};
|
|
23
|
+
exports.run = run;
|
|
24
|
+
const $run = async (model, migrations) => {
|
|
25
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
26
|
+
const modelName = model.apiRoot;
|
|
27
|
+
if (!model.modelExistsBeforeInit) {
|
|
28
|
+
((_b = (_a = sbvrUtils.api.migrations) === null || _a === void 0 ? void 0 : _a.logger.info) !== null && _b !== void 0 ? _b : console.info)('First time model has executed, skipping async migrations');
|
|
29
|
+
await sbvrUtils.db.transaction(async (tx) => (0, utils_1.setExecutedMigrations)(tx, modelName, Object.keys(migrations)));
|
|
30
|
+
}
|
|
31
|
+
if (!model.modelExistsBeforeInit) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const executedMigrations = (_c = (await sbvrUtils.db.transaction(async (tx) => (0, utils_1.getExecutedMigrations)(tx, modelName)))) !== null && _c !== void 0 ? _c : [];
|
|
35
|
+
const pendingMigrations = filterAndSortPendingAsyncMigrations(migrations, executedMigrations);
|
|
36
|
+
for (const [key, migration] of pendingMigrations) {
|
|
37
|
+
const initMigrationState = {
|
|
38
|
+
migration_key: key,
|
|
39
|
+
start_time: new Date(Date.now()),
|
|
40
|
+
last_run_time: new Date(Date.now()),
|
|
41
|
+
run_counter: 0,
|
|
42
|
+
migrated_rows: 0,
|
|
43
|
+
error_counter: 0,
|
|
44
|
+
error_threshold: utils_1.migratorEnv.asyncMigrationDefaultErrorThreshold,
|
|
45
|
+
delayMS: utils_1.migratorEnv.asyncMigrationDefaultDelayMS,
|
|
46
|
+
backoffDelayMS: utils_1.migratorEnv.asyncMigrationDefaultBackoffDelayMS,
|
|
47
|
+
converged_time: undefined,
|
|
48
|
+
last_error_message: undefined,
|
|
49
|
+
is_backoff: false,
|
|
50
|
+
should_stop: false,
|
|
51
|
+
};
|
|
52
|
+
let asyncRunnerMigratorFn;
|
|
53
|
+
if (typeof migration === 'object') {
|
|
54
|
+
if (migration.fn && typeof migration.fn === 'function') {
|
|
55
|
+
asyncRunnerMigratorFn = async (tx) => (await migration.fn(tx, sbvrUtils))
|
|
56
|
+
.rowsAffected;
|
|
57
|
+
}
|
|
58
|
+
else if (migration.sql && typeof migration.sql === 'string') {
|
|
59
|
+
asyncRunnerMigratorFn = async (tx) => (await tx.executeSql(migration.sql)).rowsAffected;
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
((_e = (_d = sbvrUtils.api.migrations) === null || _d === void 0 ? void 0 : _d.logger.error) !== null && _e !== void 0 ? _e : console.error)(`Invalid migration object: ${JSON.stringify(migration, null, 2)}`);
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
initMigrationState.backoffDelayMS =
|
|
66
|
+
migration.backoffDelayMS ||
|
|
67
|
+
utils_1.migratorEnv.asyncMigrationDefaultBackoffDelayMS;
|
|
68
|
+
initMigrationState.delayMS =
|
|
69
|
+
migration.delayMS || utils_1.migratorEnv.asyncMigrationDefaultDelayMS;
|
|
70
|
+
initMigrationState.error_threshold =
|
|
71
|
+
migration.errorThreshold ||
|
|
72
|
+
utils_1.migratorEnv.asyncMigrationDefaultErrorThreshold;
|
|
73
|
+
}
|
|
74
|
+
else if (typeof migration === 'string') {
|
|
75
|
+
asyncRunnerMigratorFn = async (tx) => (await tx.executeSql(migration)).rowsAffected;
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
((_g = (_f = sbvrUtils.api.migrations) === null || _f === void 0 ? void 0 : _f.logger.error) !== null && _g !== void 0 ? _g : console.error)(`Invalid async migration object: ${JSON.stringify(migration, null, 2)}`);
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
await sbvrUtils.db.transaction(async (tx) => (0, utils_1.initMigrationStatus)(tx, initMigrationState));
|
|
82
|
+
const asyncRunner = async () => {
|
|
83
|
+
await sbvrUtils.db.transaction(async (tx) => {
|
|
84
|
+
await (0, utils_1.lockMigrations)(tx, modelName, async () => {
|
|
85
|
+
var _a, _b, _c, _d;
|
|
86
|
+
const migrationState = await (0, utils_1.readMigrationStatus)(tx, key);
|
|
87
|
+
if (!migrationState || migrationState.should_stop === true) {
|
|
88
|
+
((_b = (_a = sbvrUtils.api.migrations) === null || _a === void 0 ? void 0 : _a.logger.info) !== null && _b !== void 0 ? _b : console.info)(`stopping async migration: ${key}`);
|
|
89
|
+
clearInterval(asyncScheduler);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
try {
|
|
93
|
+
clearInterval(asyncScheduler);
|
|
94
|
+
if (migrationState.last_run_time) {
|
|
95
|
+
const durationSinceLastRun = Date.now() - migrationState.last_run_time.getTime();
|
|
96
|
+
if ((migrationState.is_backoff &&
|
|
97
|
+
durationSinceLastRun < migrationState.backoffDelayMS) ||
|
|
98
|
+
(!migrationState.is_backoff &&
|
|
99
|
+
durationSinceLastRun < migrationState.delayMS)) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
migrationState.last_run_time = new Date();
|
|
104
|
+
migrationState.run_counter += 1;
|
|
105
|
+
let migratedRows = 0;
|
|
106
|
+
await sbvrUtils.db.transaction(async (migrationTx) => {
|
|
107
|
+
migratedRows = (await (asyncRunnerMigratorFn === null || asyncRunnerMigratorFn === void 0 ? void 0 : asyncRunnerMigratorFn(migrationTx))) || 0;
|
|
108
|
+
});
|
|
109
|
+
migrationState.migrated_rows += migratedRows;
|
|
110
|
+
if (migratedRows === 0) {
|
|
111
|
+
migrationState.is_backoff = true;
|
|
112
|
+
if (!migrationState.converged_time) {
|
|
113
|
+
migrationState.converged_time = new Date(Date.now());
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
migrationState.is_backoff = false;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
catch (err) {
|
|
121
|
+
migrationState.error_counter++;
|
|
122
|
+
if (migrationState.error_counter % migrationState.error_threshold ===
|
|
123
|
+
0) {
|
|
124
|
+
migrationState.last_error_message = `${err.name} ${err.message}`;
|
|
125
|
+
((_d = (_c = sbvrUtils.api.migrations) === null || _c === void 0 ? void 0 : _c.logger.error) !== null && _d !== void 0 ? _d : console.error)(`${key}: ${err.name} ${err.message}`);
|
|
126
|
+
migrationState.is_backoff = true;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
finally {
|
|
130
|
+
if (migrationState.is_backoff) {
|
|
131
|
+
asyncScheduler = setInterval(asyncRunner, migrationState.backoffDelayMS);
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
asyncScheduler = setInterval(asyncRunner, migrationState.delayMS);
|
|
135
|
+
}
|
|
136
|
+
await (0, utils_1.updateMigrationStatus)(tx, migrationState);
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
let asyncScheduler = setInterval(asyncRunner, initMigrationState.delayMS);
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
const filterAndSortPendingAsyncMigrations = (migrations, executedMigrations) => {
|
|
145
|
+
var _a;
|
|
146
|
+
const latestExecutedMigration = (_a = executedMigrations.sort().pop()) !== null && _a !== void 0 ? _a : '';
|
|
147
|
+
return _(migrations).omit(executedMigrations)
|
|
148
|
+
.toPairs()
|
|
149
|
+
.filter(([migrationKey]) => migrationKey > latestExecutedMigration)
|
|
150
|
+
.sortBy(([migrationKey]) => migrationKey)
|
|
151
|
+
.value();
|
|
152
|
+
};
|
|
153
|
+
//# sourceMappingURL=async.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async.js","sourceRoot":"","sources":["../../src/migrator/async.ts"],"names":[],"mappings":";;;AAGA,4BAA4B;AAC5B,oDAAoD;AAIpD,mCAaiB;AAEV,MAAM,GAAG,GAAG,KAAK,EAAE,KAAmB,EAAiB,EAAE;;IAC/D,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IAC7B,IAAI,UAAU,IAAI,IAAI,IAAI,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;QAChD,OAAO;KACP;IACD,MAAM,eAAe,GAAG,UAAU,CAAC,2BAAmB,CAAC,KAAK,CAAC,CAAC;IAC9D,IAAI,eAAe,IAAI,IAAI,IAAI,OAAO,eAAe,KAAK,QAAQ,EAAE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