There was a race condition in the manipulation of the write fence by the
drop collection code. Specifically, when seeing a "drop collection"
oplog entry, OplogObserveDriver took no immediate action and instead
deferred some "should I re-poll now or later?" logic.
This allowed the write fence's oplogHandle.waitUntilCaughtUp code to
think that everything was "caught up" even though the effects of the
"drop collection" entry had not yet affected the cursor's state (by
transitioning it away from the STEADY state). The fix is to ensure that
the state-change aspects of processing the entry occur immediately; the
actual re-query is still deferred in order to not block the oplog tailer
from continuing.
Reported by: @awwx
(The previous failure can made consistently reproducible by replacing the
`Meteor.defer` that is removed by this commit with a
`Meteor.setTimeout(,200)`.)
OplogObserveDriver cannot try to directly apply these
representation-level mutations; it needs to get the entire custom type.
This implementation is overly conservative, but in practice
Meteor-originated writes shouldn't mutate EJSON custom types
anyway (they should treat them as atomic).
Make autopublish internal, as it is part of standard-app-packages
and not something we want users to think about.
Tweak the string for facts package. 'and custom' was a bit awkward.
We were previously doing this with a fork of Node in the dev bundle, but
that wouldn't help users in production.
We now expect users to use precisely v0.10.22 in production. When new
versions of Node come out, if users choose to use them before we get a
chance to put out a new Meteor, we disable websockets to work around the
most common effect of the issue instead of monkey-patching.
This uses less space on disk and starts up faster. It might mean
people hit the end of the oplog if the server gets really slow.
But, hey, then we can debug and test more oplog error modes.
Also upgrade to 2.4.8 while we're at it.
(In the meteor/mongo repository, we've created an ssl-2.4.8 branch, and
also added a backported-from-Mongo-2.5 change to poll the repl set
config more often on startup.)