Patch release: fixes the remaining "Mongo server and the Meteor query disagree"
oplog warning on filtered / paginated joins. Drop-in upgrade — no API changes.
Highlights — fixes the "disagree on how many documents" oplog warning
3.0.0 fixed leaked observers and unbounded $in growth, but the warning
The Mongo server and the Meteor query disagree on how many documents match your query
could still appear on busy filtered / sorted / paginated joins. The remaining
root cause was a shared, mutable $in:
- The join passed its live
this.dataarray to the observe by reference and
mutated it in place (push/ removal) as the result set changed. - minimongo compiles a
$inmatcher by snapshotting the array at observe
creation, while the Mongo query re-reads the live array on every poll. Since
the observe restart is deferred, a live observe could match against the frozen
$inwhile Mongo queried the already-mutated one — the two disagreed on the
count, which is exactly what the oplog driver logs.
3.0.2 hands each observe its own snapshot of the joined ids
(this.data.slice()), so the compiled matcher and the Mongo query always agree.
In-place mutations now only affect the next observe, created on restart.
Performance
- Released ids are now dropped from the
$inin a singlefilterpass (O(n))
instead ofindexOf+spliceper id (O(k·n)).
Upgrading
Drop-in from 3.0.1 — no API changes.