When initializing oplog tailing, only read 'ts'

This means we read less data (yay), but more importantly it means that
if the last entry contained custom EJSON types, we don't try to parse
them. This code gets called synchronously from the first
Meteor.Collection constructor, which can legitimately be before your
EJSON.addType call.

Fixes #2018.
This commit is contained in:
David Glasser
2014-04-10 14:38:31 -07:00
parent 5345a0c78a
commit f63aeee8eb

View File

@@ -176,7 +176,7 @@ _.extend(OplogHandle.prototype, {
// Find the last oplog entry.
var lastOplogEntry = self._oplogLastEntryConnection.findOne(
OPLOG_COLLECTION, {}, {sort: {$natural: -1}});
OPLOG_COLLECTION, {}, {sort: {$natural: -1}, fields: {ts: 1}});
var oplogSelector = _.clone(self._baseOplogSelector);
if (lastOplogEntry) {