diff --git a/.changeset/gentle-coins-lie.md b/.changeset/gentle-coins-lie.md new file mode 100644 index 000000000..b8942822c --- /dev/null +++ b/.changeset/gentle-coins-lie.md @@ -0,0 +1,7 @@ +--- +'@powersync/service-module-mongodb-storage': patch +'@powersync/service-core': patch +'@powersync/service-image': patch +--- + +Fix slow clearing of bucket_parameters collection. diff --git a/modules/module-mongodb-storage/src/storage/implementation/MongoSyncBucketStorage.ts b/modules/module-mongodb-storage/src/storage/implementation/MongoSyncBucketStorage.ts index c2679fc68..8c6945b99 100644 --- a/modules/module-mongodb-storage/src/storage/implementation/MongoSyncBucketStorage.ts +++ b/modules/module-mongodb-storage/src/storage/implementation/MongoSyncBucketStorage.ts @@ -571,7 +571,7 @@ export class MongoSyncBucketStorage ); await this.db.bucket_parameters.deleteMany( { - key: idPrefixFilter({ g: this.group_id }, ['t', 'k']) + 'key.g': this.group_id }, { maxTimeMS: lib_mongo.db.MONGO_CLEAR_OPERATION_TIMEOUT_MS } );