mirror of
https://github.com/wekan/wekan.git
synced 2026-11-08 11:25:19 -05:00
With FerretDB there is no MongoDB oplog, so Meteor observed every live query by poll-and-diff, pinning FerretDB CPU at 100-390% on busy boards (#6480, #6481). FerretDB v1 now ships an OpLog (wekan/FerretDB: auto-created capped local.oplog.rs + replica-set hello handshake), so every FerretDB launch path now: - starts ferretdb with --repl-set-name=rs0 (snap ferretdb-control, docker entrypoint + docker-compose service, bundle start-wekan.sh/.bat), which makes FerretDB auto-create the OpLog and advertise the replica set; and - points WeKan at it with MONGO_OPLOG_URL=.../local?replicaSet=rs0 (docker-compose also switches METEOR_REACTIVITY_ORDER to oplog,polling), so Meteor TAILS the OpLog instead of polling. Enabled by default with a kill-switch: WEKAN_FERRETDB_OPLOG=false forces the old polling-only behaviour. The calmer polling defaults remain as the fallback for queries Meteor cannot observe via the OpLog. The transient migration ferretdb (migration-control) deliberately stays oplog-free so bulk inserts are not slowed. Also cut the client activity feed page from 500 to 50 rows: 500 was far more than the sidebar/card feed shows and, under polling, was re-fetched and re-diffed on every poll; infinite scroll still loads more on demand (the server cursor is index-bounded either way). Tests: tests/ferretdbOplog.test.cjs source-guards every launch path (repl-set arg, MONGO_OPLOG_URL, kill-switch) plus the activity page size, and a negative test that migration-control stays oplog-free. Thanks to uusijani, Nissulya and xet7 ! Fixes #6480, Fixes #6481.