File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
modules/module-mongodb/src/replication Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -442,6 +442,17 @@ export class ChangeStream {
442442 } ) ;
443443 }
444444 }
445+
446+ // When we have a large number of collections, the performance of the pipeline
447+ // depends a lot on how the filters here are specified.
448+ // Currently, only the multipleDatabases == false case is optimized, and the
449+ // wildcard matching version is not tested (but we assume that will be more
450+ // limited in the number of them).
451+ // Specifically, the `ns: {$in: [...]}` version can lead to PSYNC_S1345 timeouts in
452+ // some cases when we have a large number of collections.
453+ // For details, see:
454+ // https://github.com/powersync-ja/powersync-service/pull/417
455+ // https://jira.mongodb.org/browse/SERVER-114532
445456 const nsFilter = multipleDatabases
446457 ? // cluster-level: filter on the entire namespace
447458 { ns : { $in : $inFilters } }
You can’t perform that action at this time.
0 commit comments