@powersync/service-core 1.15.7 → 1.15.8
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/CHANGELOG.md +13 -0
- package/dist/entry/commands/compact-action.js +1 -1
- package/dist/entry/commands/compact-action.js.map +1 -1
- package/dist/storage/SyncRulesBucketStorage.d.ts +12 -1
- package/dist/storage/SyncRulesBucketStorage.js.map +1 -1
- package/package.json +6 -6
- package/src/entry/commands/compact-action.ts +1 -1
- package/src/storage/SyncRulesBucketStorage.ts +14 -1
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @powersync/service-core
|
|
2
2
|
|
|
3
|
+
## 1.15.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- da7ecc6: Upgrade mongodb driver to improve stability.
|
|
8
|
+
- 5328802: [MongoDB Storage] Only compact modified buckets. Add index on bucket_state to handle large numbers of buckets when pre-calculating checksums or compacting, and skip small buckets.
|
|
9
|
+
- Updated dependencies [a98cecb]
|
|
10
|
+
- Updated dependencies [da7ecc6]
|
|
11
|
+
- Updated dependencies [704553e]
|
|
12
|
+
- @powersync/service-sync-rules@0.29.5
|
|
13
|
+
- @powersync/service-rsocket-router@0.2.5
|
|
14
|
+
- @powersync/lib-services-framework@0.7.8
|
|
15
|
+
|
|
3
16
|
## 1.15.7
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -18,7 +18,7 @@ const COMPACT_MEMORY_LIMIT_MB = Math.min(HEAP_LIMIT / 1024 / 1024 - 128, 1024);
|
|
|
18
18
|
export function registerCompactAction(program) {
|
|
19
19
|
const compactCommand = program
|
|
20
20
|
.command(COMMAND_NAME)
|
|
21
|
-
.option(`-b, --buckets [buckets]`, 'Bucket
|
|
21
|
+
.option(`-b, --buckets [buckets]`, 'Bucket name (optional, comma-separate multiple names)');
|
|
22
22
|
wrapConfigCommand(compactCommand);
|
|
23
23
|
return compactCommand.description('Compact storage').action(async (options) => {
|
|
24
24
|
const buckets = options.buckets?.split(',');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compact-action.js","sourceRoot":"","sources":["../../../src/entry/commands/compact-action.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,MAAM,MAAM,8BAA8B,CAAC;AACvD,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE9E,MAAM,YAAY,GAAG,SAAS,CAAC;AAE/B;;GAEG;AACH,MAAM,UAAU,GAAG,EAAE,CAAC,iBAAiB,EAAE,CAAC,eAAe,CAAC;AAE1D;;;;GAIG;AACH,MAAM,uBAAuB,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,GAAG,EAAE,IAAI,CAAC,CAAC;AAE/E,MAAM,UAAU,qBAAqB,CAAC,OAAgB;IACpD,MAAM,cAAc,GAAG,OAAO;SAC3B,OAAO,CAAC,YAAY,CAAC;SACrB,MAAM,CAAC,yBAAyB,EAAE,
|
|
1
|
+
{"version":3,"file":"compact-action.js","sourceRoot":"","sources":["../../../src/entry/commands/compact-action.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,MAAM,MAAM,8BAA8B,CAAC;AACvD,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,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orage extends ObserverClient<SyncRulesBucketSt
|
|
|
49
49
|
/**
|
|
50
50
|
* Lightweight "compact" process to populate the checksum cache, if any.
|
|
51
51
|
*/
|
|
52
|
-
populatePersistentChecksumCache(options
|
|
52
|
+
populatePersistentChecksumCache(options: PopulateChecksumCacheOptions): Promise<PopulateChecksumCacheResults>;
|
|
53
53
|
getCheckpoint(): Promise<ReplicationCheckpoint>;
|
|
54
54
|
/**
|
|
55
55
|
* Given two checkpoints, return the changes in bucket data and parameters that may have occurred
|
|
@@ -179,6 +179,17 @@ export interface CompactOptions {
|
|
|
179
179
|
compactParameterCacheLimit?: number;
|
|
180
180
|
signal?: AbortSignal;
|
|
181
181
|
}
|
|
182
|
+
export interface PopulateChecksumCacheOptions {
|
|
183
|
+
maxOpId: util.InternalOpId;
|
|
184
|
+
minBucketChanges?: number;
|
|
185
|
+
signal?: AbortSignal;
|
|
186
|
+
}
|
|
187
|
+
export interface PopulateChecksumCacheResults {
|
|
188
|
+
/**
|
|
189
|
+
* Number of buckets we have calculated checksums for.
|
|
190
|
+
*/
|
|
191
|
+
buckets: number;
|
|
192
|
+
}
|
|
182
193
|
export interface ClearStorageOptions {
|
|
183
194
|
signal?: AbortSignal;
|
|
184
195
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SyncRulesBucketStorage.js","sourceRoot":"","sources":["../../src/storage/SyncRulesBucketStorage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SyncRulesBucketStorage.js","sourceRoot":"","sources":["../../src/storage/SyncRulesBucketStorage.ts"],"names":[],"mappings":"AA+TA,MAAM,CAAC,MAAM,yBAAyB,GAAsB;IAC1D,kBAAkB,EAAE,IAAI,GAAG,EAAU;IACrC,qBAAqB,EAAE,IAAI;IAC3B,uBAAuB,EAAE,IAAI,GAAG,EAAU;IAC1C,0BAA0B,EAAE,IAAI;CACjC,CAAC"}
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
|
-
"version": "1.15.
|
|
8
|
+
"version": "1.15.8",
|
|
9
9
|
"main": "dist/index.js",
|
|
10
10
|
"license": "FSL-1.1-ALv2",
|
|
11
11
|
"type": "module",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@opentelemetry/sdk-metrics": "^2.0.1",
|
|
19
19
|
"async": "^3.2.4",
|
|
20
20
|
"async-mutex": "^0.5.0",
|
|
21
|
-
"bson": "^6.10.
|
|
21
|
+
"bson": "^6.10.4",
|
|
22
22
|
"commander": "^12.0.0",
|
|
23
23
|
"cors": "^2.8.5",
|
|
24
24
|
"ipaddr.js": "^2.1.0",
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
"uuid": "^11.1.0",
|
|
34
34
|
"winston": "^3.13.0",
|
|
35
35
|
"yaml": "^2.3.2",
|
|
36
|
-
"@powersync/lib-services-framework": "0.7.
|
|
36
|
+
"@powersync/lib-services-framework": "0.7.8",
|
|
37
37
|
"@powersync/service-jsonbig": "0.17.11",
|
|
38
|
-
"@powersync/service-rsocket-router": "0.2.
|
|
39
|
-
"@powersync/service-
|
|
40
|
-
"@powersync/service-
|
|
38
|
+
"@powersync/service-rsocket-router": "0.2.5",
|
|
39
|
+
"@powersync/service-types": "0.13.0",
|
|
40
|
+
"@powersync/service-sync-rules": "0.29.5"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/async": "^3.2.24",
|
|
@@ -25,7 +25,7 @@ const COMPACT_MEMORY_LIMIT_MB = Math.min(HEAP_LIMIT / 1024 / 1024 - 128, 1024);
|
|
|
25
25
|
export function registerCompactAction(program: Command) {
|
|
26
26
|
const compactCommand = program
|
|
27
27
|
.command(COMMAND_NAME)
|
|
28
|
-
.option(`-b, --buckets [buckets]`, 'Bucket
|
|
28
|
+
.option(`-b, --buckets [buckets]`, 'Bucket name (optional, comma-separate multiple names)');
|
|
29
29
|
|
|
30
30
|
wrapConfigCommand(compactCommand);
|
|
31
31
|
|
|
@@ -65,7 +65,7 @@ export interface SyncRulesBucketStorage
|
|
|
65
65
|
/**
|
|
66
66
|
* Lightweight "compact" process to populate the checksum cache, if any.
|
|
67
67
|
*/
|
|
68
|
-
populatePersistentChecksumCache(options
|
|
68
|
+
populatePersistentChecksumCache(options: PopulateChecksumCacheOptions): Promise<PopulateChecksumCacheResults>;
|
|
69
69
|
|
|
70
70
|
// ## Read operations
|
|
71
71
|
|
|
@@ -225,6 +225,19 @@ export interface CompactOptions {
|
|
|
225
225
|
signal?: AbortSignal;
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
+
export interface PopulateChecksumCacheOptions {
|
|
229
|
+
maxOpId: util.InternalOpId;
|
|
230
|
+
minBucketChanges?: number;
|
|
231
|
+
signal?: AbortSignal;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
export interface PopulateChecksumCacheResults {
|
|
235
|
+
/**
|
|
236
|
+
* Number of buckets we have calculated checksums for.
|
|
237
|
+
*/
|
|
238
|
+
buckets: number;
|
|
239
|
+
}
|
|
240
|
+
|
|
228
241
|
export interface ClearStorageOptions {
|
|
229
242
|
signal?: AbortSignal;
|
|
230
243
|
}
|