@powersync/service-module-mongodb-storage 0.0.0-dev-20260803144812 → 0.0.0-dev-20260929095716
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 +129 -7
- package/dist/storage/MongoBucketStorage.d.ts +42 -5
- package/dist/storage/MongoBucketStorage.js +404 -215
- package/dist/storage/MongoBucketStorage.js.map +1 -1
- package/dist/storage/implementation/MongoBucketBatch.d.ts +39 -14
- package/dist/storage/implementation/MongoBucketBatch.js +169 -98
- package/dist/storage/implementation/MongoBucketBatch.js.map +1 -1
- package/dist/storage/implementation/MongoCompactor.d.ts +21 -79
- package/dist/storage/implementation/MongoCompactor.js +27 -238
- package/dist/storage/implementation/MongoCompactor.js.map +1 -1
- package/dist/storage/implementation/MongoIdSequence.d.ts +10 -1
- package/dist/storage/implementation/MongoIdSequence.js +14 -1
- package/dist/storage/implementation/MongoIdSequence.js.map +1 -1
- package/dist/storage/implementation/MongoOpIdAllocator.d.ts +27 -0
- package/dist/storage/implementation/MongoOpIdAllocator.js +97 -0
- package/dist/storage/implementation/MongoOpIdAllocator.js.map +1 -0
- package/dist/storage/implementation/MongoParameterCompactor.d.ts +83 -10
- package/dist/storage/implementation/MongoParameterCompactor.js +309 -96
- package/dist/storage/implementation/MongoParameterCompactor.js.map +1 -1
- package/dist/storage/implementation/MongoParsedSyncConfigSet.d.ts +9 -1
- package/dist/storage/implementation/MongoParsedSyncConfigSet.js +35 -2
- package/dist/storage/implementation/MongoParsedSyncConfigSet.js.map +1 -1
- package/dist/storage/implementation/MongoPersistedReplicationStream.d.ts +2 -1
- package/dist/storage/implementation/MongoPersistedReplicationStream.js +7 -4
- package/dist/storage/implementation/MongoPersistedReplicationStream.js.map +1 -1
- package/dist/storage/implementation/MongoPersistedSyncConfigContent.d.ts +3 -3
- package/dist/storage/implementation/MongoPersistedSyncConfigContent.js +10 -8
- package/dist/storage/implementation/MongoPersistedSyncConfigContent.js.map +1 -1
- package/dist/storage/implementation/MongoStorageProvider.js +8 -4
- package/dist/storage/implementation/MongoStorageProvider.js.map +1 -1
- package/dist/storage/implementation/MongoSyncBucketStorage.d.ts +32 -11
- package/dist/storage/implementation/MongoSyncBucketStorage.js +95 -31
- package/dist/storage/implementation/MongoSyncBucketStorage.js.map +1 -1
- package/dist/storage/implementation/MongoSyncRulesLock.d.ts +26 -2
- package/dist/storage/implementation/MongoSyncRulesLock.js +59 -10
- package/dist/storage/implementation/MongoSyncRulesLock.js.map +1 -1
- package/dist/storage/implementation/MongoWriteBatch.d.ts +49 -0
- package/dist/storage/implementation/MongoWriteBatch.js +149 -0
- package/dist/storage/implementation/MongoWriteBatch.js.map +1 -0
- package/dist/storage/implementation/MongoWriteCheckpointAPI.d.ts +9 -7
- package/dist/storage/implementation/MongoWriteCheckpointAPI.js +9 -30
- package/dist/storage/implementation/MongoWriteCheckpointAPI.js.map +1 -1
- package/dist/storage/implementation/SyncRuleStateUpdate.d.ts +11 -5
- package/dist/storage/implementation/SyncRuleStateUpdate.js +14 -6
- package/dist/storage/implementation/SyncRuleStateUpdate.js.map +1 -1
- package/dist/storage/implementation/common/MongoSyncBucketStorageCheckpoint.d.ts +22 -2
- package/dist/storage/implementation/common/PersistedBatch.d.ts +32 -4
- package/dist/storage/implementation/common/PersistedBatch.js +57 -14
- package/dist/storage/implementation/common/PersistedBatch.js.map +1 -1
- package/dist/storage/implementation/common/VersionedPowerSyncMongoBase.d.ts +3 -0
- package/dist/storage/implementation/common/VersionedPowerSyncMongoBase.js +3 -0
- package/dist/storage/implementation/common/VersionedPowerSyncMongoBase.js.map +1 -1
- package/dist/storage/implementation/db.d.ts +9 -1
- package/dist/storage/implementation/db.js +28 -1
- package/dist/storage/implementation/db.js.map +1 -1
- package/dist/storage/implementation/models.d.ts +35 -0
- package/dist/storage/implementation/models.js.map +1 -1
- package/dist/storage/implementation/v1/MongoBucketBatchV1.d.ts +11 -0
- package/dist/storage/implementation/v1/MongoBucketBatchV1.js +227 -221
- package/dist/storage/implementation/v1/MongoBucketBatchV1.js.map +1 -1
- package/dist/storage/implementation/v1/MongoCompactorV1.d.ts +38 -6
- package/dist/storage/implementation/v1/MongoCompactorV1.js +247 -20
- package/dist/storage/implementation/v1/MongoCompactorV1.js.map +1 -1
- package/dist/storage/implementation/v1/MongoParameterCompactorV1.d.ts +16 -2
- package/dist/storage/implementation/v1/MongoParameterCompactorV1.js +20 -9
- package/dist/storage/implementation/v1/MongoParameterCompactorV1.js.map +1 -1
- package/dist/storage/implementation/v1/MongoSyncBucketStorageV1.d.ts +18 -11
- package/dist/storage/implementation/v1/MongoSyncBucketStorageV1.js +66 -17
- package/dist/storage/implementation/v1/MongoSyncBucketStorageV1.js.map +1 -1
- package/dist/storage/implementation/v1/PersistedBatchV1.d.ts +7 -5
- package/dist/storage/implementation/v1/PersistedBatchV1.js +22 -28
- package/dist/storage/implementation/v1/PersistedBatchV1.js.map +1 -1
- package/dist/storage/implementation/v1/models.js +1 -0
- package/dist/storage/implementation/v1/models.js.map +1 -1
- package/dist/storage/implementation/v3/CompactionLease.d.ts +50 -0
- package/dist/storage/implementation/v3/CompactionLease.js +131 -0
- package/dist/storage/implementation/v3/CompactionLease.js.map +1 -0
- package/dist/storage/implementation/v3/MongoBucketBatchV3.d.ts +14 -2
- package/dist/storage/implementation/v3/MongoBucketBatchV3.js +261 -194
- package/dist/storage/implementation/v3/MongoBucketBatchV3.js.map +1 -1
- package/dist/storage/implementation/v3/MongoCompactorV3.d.ts +83 -25
- package/dist/storage/implementation/v3/MongoCompactorV3.js +702 -159
- package/dist/storage/implementation/v3/MongoCompactorV3.js.map +1 -1
- package/dist/storage/implementation/v3/MongoParameterCompactorV3.d.ts +18 -0
- package/dist/storage/implementation/v3/MongoParameterCompactorV3.js +23 -0
- package/dist/storage/implementation/v3/MongoParameterCompactorV3.js.map +1 -0
- package/dist/storage/implementation/v3/MongoStoppedSyncConfigCleanup.d.ts +2 -15
- package/dist/storage/implementation/v3/MongoStoppedSyncConfigCleanup.js +60 -92
- package/dist/storage/implementation/v3/MongoStoppedSyncConfigCleanup.js.map +1 -1
- package/dist/storage/implementation/v3/MongoSyncBucketStorageV3.d.ts +19 -9
- package/dist/storage/implementation/v3/MongoSyncBucketStorageV3.js +92 -32
- package/dist/storage/implementation/v3/MongoSyncBucketStorageV3.js.map +1 -1
- package/dist/storage/implementation/v3/MongoWriteCheckpointAPIV3.d.ts +26 -0
- package/dist/storage/implementation/v3/MongoWriteCheckpointAPIV3.js +82 -0
- package/dist/storage/implementation/v3/MongoWriteCheckpointAPIV3.js.map +1 -0
- package/dist/storage/implementation/v3/PersistedBatchV3.d.ts +14 -8
- package/dist/storage/implementation/v3/PersistedBatchV3.js +77 -45
- package/dist/storage/implementation/v3/PersistedBatchV3.js.map +1 -1
- package/dist/storage/implementation/v3/VersionedPowerSyncMongoV3.d.ts +12 -2
- package/dist/storage/implementation/v3/VersionedPowerSyncMongoV3.js +42 -3
- package/dist/storage/implementation/v3/VersionedPowerSyncMongoV3.js.map +1 -1
- package/dist/storage/implementation/v3/bucket-format.js +2 -0
- package/dist/storage/implementation/v3/bucket-format.js.map +1 -1
- package/dist/storage/implementation/v3/compact-utils.d.ts +108 -0
- package/dist/storage/implementation/v3/compact-utils.js +223 -0
- package/dist/storage/implementation/v3/compact-utils.js.map +1 -0
- package/dist/storage/implementation/v3/compaction-constants.d.ts +5 -0
- package/dist/storage/implementation/v3/compaction-constants.js +6 -0
- package/dist/storage/implementation/v3/compaction-constants.js.map +1 -0
- package/dist/storage/implementation/v3/models.d.ts +90 -6
- package/dist/storage/implementation/v3/models.js.map +1 -1
- package/dist/storage/implementation/v3/object-storage/BucketDataObjectStorage.d.ts +7 -8
- package/dist/storage/implementation/v3/object-storage/BucketDataObjectStorage.js +16 -5
- package/dist/storage/implementation/v3/object-storage/BucketDataObjectStorage.js.map +1 -1
- package/dist/storage/implementation/v3/object-storage/ObjectStorage.d.ts +14 -11
- package/dist/storage/implementation/v3/object-storage/ObjectStorageLifecycle.d.ts +6 -8
- package/dist/storage/implementation/v3/object-storage/ObjectStorageLifecycle.js +17 -11
- package/dist/storage/implementation/v3/object-storage/ObjectStorageLifecycle.js.map +1 -1
- package/dist/storage/implementation/v3/object-storage/ObjectStorageUsage.d.ts +38 -0
- package/dist/storage/implementation/v3/object-storage/ObjectStorageUsage.js +164 -0
- package/dist/storage/implementation/v3/object-storage/ObjectStorageUsage.js.map +1 -0
- package/dist/storage/implementation/v3/object-storage/S3ObjectStorage.d.ts +37 -12
- package/dist/storage/implementation/v3/object-storage/S3ObjectStorage.js +197 -25
- package/dist/storage/implementation/v3/object-storage/S3ObjectStorage.js.map +1 -1
- package/dist/storage/implementation/v3/source-table-utils.d.ts +15 -7
- package/dist/storage/implementation/v3/source-table-utils.js +49 -57
- package/dist/storage/implementation/v3/source-table-utils.js.map +1 -1
- package/dist/storage/storage-index.d.ts +2 -1
- package/dist/storage/storage-index.js +1 -0
- package/dist/storage/storage-index.js.map +1 -1
- package/dist/types/types.d.ts +28 -1
- package/dist/types/types.js +28 -7
- package/dist/types/types.js.map +1 -1
- package/dist/utils/test-utils.d.ts +4 -2
- package/dist/utils/test-utils.js +7 -4
- package/dist/utils/test-utils.js.map +1 -1
- package/dist/utils/util.js +3 -1
- package/dist/utils/util.js.map +1 -1
- package/package.json +10 -9
- package/src/storage/MongoBucketStorage.ts +545 -277
- package/src/storage/implementation/MongoBucketBatch.ts +258 -124
- package/src/storage/implementation/MongoCompactor.ts +37 -346
- package/src/storage/implementation/MongoIdSequence.ts +21 -1
- package/src/storage/implementation/MongoOpIdAllocator.ts +105 -0
- package/src/storage/implementation/MongoParameterCompactor.ts +388 -102
- package/src/storage/implementation/MongoParsedSyncConfigSet.ts +46 -1
- package/src/storage/implementation/MongoPersistedReplicationStream.ts +12 -4
- package/src/storage/implementation/MongoPersistedSyncConfigContent.ts +48 -29
- package/src/storage/implementation/MongoStorageProvider.ts +16 -4
- package/src/storage/implementation/MongoSyncBucketStorage.ts +133 -40
- package/src/storage/implementation/MongoSyncRulesLock.ts +78 -12
- package/src/storage/implementation/MongoWriteBatch.ts +172 -0
- package/src/storage/implementation/MongoWriteCheckpointAPI.ts +16 -46
- package/src/storage/implementation/SyncRuleStateUpdate.ts +13 -6
- package/src/storage/implementation/common/MongoSyncBucketStorageCheckpoint.ts +24 -2
- package/src/storage/implementation/common/PersistedBatch.ts +76 -20
- package/src/storage/implementation/common/VersionedPowerSyncMongoBase.ts +4 -0
- package/src/storage/implementation/db.ts +36 -2
- package/src/storage/implementation/models.ts +39 -0
- package/src/storage/implementation/v1/MongoBucketBatchV1.ts +272 -254
- package/src/storage/implementation/v1/MongoCompactorV1.ts +327 -40
- package/src/storage/implementation/v1/MongoParameterCompactorV1.ts +25 -9
- package/src/storage/implementation/v1/MongoSyncBucketStorageV1.ts +88 -28
- package/src/storage/implementation/v1/PersistedBatchV1.ts +25 -30
- package/src/storage/implementation/v1/models.ts +1 -0
- package/src/storage/implementation/v3/CompactionLease.ts +152 -0
- package/src/storage/implementation/v3/MongoBucketBatchV3.ts +339 -247
- package/src/storage/implementation/v3/MongoCompactorV3.ts +955 -225
- package/src/storage/implementation/v3/MongoParameterCompactorV3.ts +34 -0
- package/src/storage/implementation/v3/MongoStoppedSyncConfigCleanup.ts +100 -109
- package/src/storage/implementation/v3/MongoSyncBucketStorageV3.ts +112 -42
- package/src/storage/implementation/v3/MongoWriteCheckpointAPIV3.ts +111 -0
- package/src/storage/implementation/v3/PersistedBatchV3.ts +94 -51
- package/src/storage/implementation/v3/VersionedPowerSyncMongoV3.ts +55 -4
- package/src/storage/implementation/v3/bucket-format.ts +2 -0
- package/src/storage/implementation/v3/compact-utils.ts +329 -0
- package/src/storage/implementation/v3/compaction-constants.ts +5 -0
- package/src/storage/implementation/v3/models.ts +97 -4
- package/src/storage/implementation/v3/object-storage/BucketDataObjectStorage.ts +24 -9
- package/src/storage/implementation/v3/object-storage/ObjectStorage.ts +20 -5
- package/src/storage/implementation/v3/object-storage/ObjectStorageLifecycle.ts +26 -14
- package/src/storage/implementation/v3/object-storage/ObjectStorageUsage.ts +229 -0
- package/src/storage/implementation/v3/object-storage/S3ObjectStorage.ts +279 -29
- package/src/storage/implementation/v3/source-table-utils.ts +82 -76
- package/src/storage/storage-index.ts +2 -0
- package/src/types/types.ts +42 -7
- package/src/utils/test-utils.ts +9 -5
- package/src/utils/util.ts +3 -1
- package/test/src/__snapshots__/storage.test.ts.snap +25 -0
- package/test/src/__snapshots__/storage_sync.test.ts.snap +794 -205
- package/test/src/chunk_compaction_config.test.ts +38 -0
- package/test/src/cleanup-stopped-sync-configs.test.ts +59 -26
- package/test/src/compact-utils.test.ts +251 -0
- package/test/src/concurrent_writers.test.ts +599 -0
- package/test/src/connection_config.test.ts +159 -0
- package/test/src/helpers/MemoryObjectStorage.ts +14 -6
- package/test/src/helpers/concurrentWriter.mjs +29 -0
- package/test/src/helpers/s3TestFactory.ts +12 -12
- package/test/src/object_storage_usage.test.ts +268 -0
- package/test/src/parameter_compacting_v1.test.ts +120 -0
- package/test/src/parameter_compacting_v3.test.ts +192 -0
- package/test/src/parameter_compaction_fence.test.ts +276 -0
- package/test/src/storage.test.ts +280 -24
- package/test/src/storage_compacting.test.ts +1097 -253
- package/test/src/storage_object_storage_inline_threshold.test.ts +3 -3
- package/test/src/storage_s3_checksums.test.ts +6 -7
- package/test/src/storage_s3_compaction_lifecycle.test.ts +143 -17
- package/test/src/storage_s3_reading.test.ts +294 -6
- package/test/src/storage_s3_writing.test.ts +4 -3
- package/test/src/storage_sync.test.ts +412 -80
- package/test/src/storeCurrentData.test.ts +5 -5
- package/test/src/util.ts +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
SyncRuleDocumentBase,
|
|
18
18
|
WriteCheckpointDocument
|
|
19
19
|
} from './models.js';
|
|
20
|
+
import { MongoWriteBatch } from './MongoWriteBatch.js';
|
|
20
21
|
import {
|
|
21
22
|
BucketDataDocumentV1,
|
|
22
23
|
BucketParameterDocument,
|
|
@@ -24,8 +25,9 @@ import {
|
|
|
24
25
|
CurrentDataDocument
|
|
25
26
|
} from './v1/models.js';
|
|
26
27
|
import { VersionedPowerSyncMongoV1 } from './v1/VersionedPowerSyncMongoV1.js';
|
|
27
|
-
import { BucketDataDocumentV3 } from './v3/models.js';
|
|
28
|
-
import {
|
|
28
|
+
import { BucketDataDocumentV3, CustomCheckpointRequestDocumentV3 } from './v3/models.js';
|
|
29
|
+
import type { CustomCheckpointRequestCollectionSpecifier } from './v3/VersionedPowerSyncMongoV3.js';
|
|
30
|
+
import { OBJECT_STORAGE_USAGE_COLLECTION, VersionedPowerSyncMongoV3 } from './v3/VersionedPowerSyncMongoV3.js';
|
|
29
31
|
|
|
30
32
|
export interface PowerSyncMongoOptions {
|
|
31
33
|
/**
|
|
@@ -53,6 +55,19 @@ export class PowerSyncMongo {
|
|
|
53
55
|
|
|
54
56
|
readonly client: mongo.MongoClient;
|
|
55
57
|
readonly db: mongo.Db;
|
|
58
|
+
private get clientBulkWriteSupport(): boolean {
|
|
59
|
+
// The driver exposes topology at runtime, but omits this internal property
|
|
60
|
+
// from its public types. Reuse its handshake results without another command.
|
|
61
|
+
const client = this.client as mongo.MongoClient & { topology?: { description: mongo.TopologyDescription } };
|
|
62
|
+
const servers = [...(client.topology?.description.servers.values() ?? [])];
|
|
63
|
+
// MongoDB 8.0 introduced client bulkWrite at wire version 25. Unknown / mixed-version
|
|
64
|
+
// topologies use collection writes until all known servers support it.
|
|
65
|
+
return servers.length > 0 && servers.every((server) => server.maxWireVersion >= 25);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
createWriteBatch(session: mongo.ClientSession | undefined, options: { ordered: boolean }): MongoWriteBatch {
|
|
69
|
+
return new MongoWriteBatch(this.client, this.clientBulkWriteSupport, session, options);
|
|
70
|
+
}
|
|
56
71
|
|
|
57
72
|
constructor(client: mongo.MongoClient, options?: PowerSyncMongoOptions) {
|
|
58
73
|
this.client = client;
|
|
@@ -66,6 +81,7 @@ export class PowerSyncMongo {
|
|
|
66
81
|
this.bucket_data = db.collection('bucket_data');
|
|
67
82
|
this.bucket_parameters = db.collection('bucket_parameters');
|
|
68
83
|
this.op_id_sequence = db.collection('op_id_sequence');
|
|
84
|
+
// Uses legacy terminology instead of "sync config" for backwards-compatibility
|
|
69
85
|
this.sync_rules = db.collection('sync_rules');
|
|
70
86
|
this.source_tables = db.collection('source_tables');
|
|
71
87
|
this.custom_write_checkpoints = db.collection('custom_write_checkpoints');
|
|
@@ -137,6 +153,20 @@ export class PowerSyncMongo {
|
|
|
137
153
|
return `source_table_${replicationStreamId}`;
|
|
138
154
|
}
|
|
139
155
|
|
|
156
|
+
customCheckpointRequestCollectionName(options: CustomCheckpointRequestCollectionSpecifier) {
|
|
157
|
+
return `custom_checkpoint_requests_${options.replicationStreamId}_${options.eventId}`;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
async listCustomCheckpointRequestCollections(
|
|
161
|
+
replicationStreamId?: number
|
|
162
|
+
): Promise<mongo.Collection<CustomCheckpointRequestDocumentV3>[]> {
|
|
163
|
+
const prefix =
|
|
164
|
+
replicationStreamId == null
|
|
165
|
+
? 'custom_checkpoint_requests_'
|
|
166
|
+
: `custom_checkpoint_requests_${replicationStreamId}_`;
|
|
167
|
+
return this.collectionsByPrefix(prefix);
|
|
168
|
+
}
|
|
169
|
+
|
|
140
170
|
async listSourceTableCollections(
|
|
141
171
|
replicationStreamId?: number
|
|
142
172
|
): Promise<mongo.Collection<CommonSourceTableDocument>[]> {
|
|
@@ -178,6 +208,10 @@ export class PowerSyncMongo {
|
|
|
178
208
|
await this.locks.deleteMany({});
|
|
179
209
|
await this.bucket_state.deleteMany({});
|
|
180
210
|
await this.custom_write_checkpoints.deleteMany({});
|
|
211
|
+
await this.db.collection(OBJECT_STORAGE_USAGE_COLLECTION).deleteMany({});
|
|
212
|
+
for (const collection of await this.listCustomCheckpointRequestCollections()) {
|
|
213
|
+
await collection.drop();
|
|
214
|
+
}
|
|
181
215
|
}
|
|
182
216
|
|
|
183
217
|
/**
|
|
@@ -74,6 +74,12 @@ export interface BucketDataProperties {
|
|
|
74
74
|
op: OpType;
|
|
75
75
|
source_table?: bson.ObjectId;
|
|
76
76
|
source_key?: ReplicaId;
|
|
77
|
+
/**
|
|
78
|
+
* Stable identifier for the source record in the client protocol.
|
|
79
|
+
*
|
|
80
|
+
* This is derived from (source_table, source_key), so persistence is optional but preferred.
|
|
81
|
+
*/
|
|
82
|
+
subkey?: string;
|
|
77
83
|
table?: string;
|
|
78
84
|
row_id?: string;
|
|
79
85
|
checksum: bigint;
|
|
@@ -110,6 +116,10 @@ export interface SourceTableDocument {
|
|
|
110
116
|
replica_id_columns2: { name: string; type_oid?: number; type?: string }[] | undefined;
|
|
111
117
|
snapshot_done: boolean | undefined;
|
|
112
118
|
snapshot_status: SourceTableDocumentSnapshotStatus | undefined;
|
|
119
|
+
/**
|
|
120
|
+
* Source-specific metadata. Absent for legacy records.
|
|
121
|
+
*/
|
|
122
|
+
source_metadata?: storage.JsonValue;
|
|
113
123
|
}
|
|
114
124
|
|
|
115
125
|
export interface SourceTableDocumentSnapshotStatus {
|
|
@@ -211,6 +221,34 @@ export interface SyncRuleDocumentBase {
|
|
|
211
221
|
} | null;
|
|
212
222
|
|
|
213
223
|
storage_version?: number;
|
|
224
|
+
|
|
225
|
+
/** Optional operator-supplied label identifying the sync config version. */
|
|
226
|
+
version_label?: string | null;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Incremental parameter compaction state for the replication stream.
|
|
230
|
+
*
|
|
231
|
+
* Operation ids are allocated across all parameter indexes of a stream, so this is
|
|
232
|
+
* stream-level state, shared by all sync configs of the stream.
|
|
233
|
+
*/
|
|
234
|
+
parameter_compaction?: {
|
|
235
|
+
/**
|
|
236
|
+
* The exclusive operation-id boundary through which every parameter index in this stream has
|
|
237
|
+
* been compacted.
|
|
238
|
+
*/
|
|
239
|
+
compacted_before: InternalOpId;
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Parameter entries below this boundary may no longer be available for checkpoint change
|
|
243
|
+
* detection, since compaction may have deleted them.
|
|
244
|
+
*
|
|
245
|
+
* This is advanced before the first delete of a compaction pass, while
|
|
246
|
+
* {@link compacted_before} is only advanced after every delete of the pass completed.
|
|
247
|
+
* A checkpoint transition starting below this boundary must conservatively invalidate all
|
|
248
|
+
* parameter buckets, since the individual changes may no longer be available.
|
|
249
|
+
*/
|
|
250
|
+
checkpoint_changes_invalid_before?: InternalOpId;
|
|
251
|
+
};
|
|
214
252
|
}
|
|
215
253
|
|
|
216
254
|
export interface SyncRuleCheckpointFields {
|
|
@@ -270,6 +308,7 @@ export interface CustomWriteCheckpointDocument {
|
|
|
270
308
|
_id: bson.ObjectId;
|
|
271
309
|
user_id: string;
|
|
272
310
|
checkpoint: bigint;
|
|
311
|
+
// Uses the legacy field name "sync_rules_id" for backwards-compatibility. See AGENTS.md.
|
|
273
312
|
sync_rules_id: number;
|
|
274
313
|
/**
|
|
275
314
|
* Unlike managed write checkpoints, custom write checkpoints are flushed together with
|