Meteor > 3.0.3 with Mongo 6 driver - infinite Mongo cursor creation?

Hello,

We recently updated from Meteor 3.0.3 to Meteor 3.2.2 and we found a bit of a worrying thing - every 30 seconds a new Mongo cursor is being created for OP Log tailing purposes and the old one is never closed on Mongo server side.

After a bit of an investigation I got to the part where I think I see two problems:

All in all this results in a new cursor being added to Mongo every 30s and it grows and grows and slowly kills the database, which makes the release unusable.

Now, I know that I am asking for trouble even with using the OPLog tailing, but we do not have time/resources to implement Redis OPLog currently so we’re stuck with OPLog tailing. In Meteor 3.0.3 everything worked correctly, because Mongo 4.17 driver had a completely different mechanism of cleaning up cursors and session management.

If more details are needed, I am happy to provide them.

Looking for advice on how to proceed (other than downgrading back to Meteor 3.0.3).

1 Like

Steps to reproduce the issue:

  1. Create meteor app using meteor create meteor-oplog-issue --typescript
  2. Set MONGO_URL and MONGO_OPLOG_URL to your Mongo instance
  3. Start app via npm run start
  4. After a minute or so, start executing db.serverStatus().metrics.cursor command on your Mongo server every 30 seconds and check the open.total value in the returned object
3 Likes

thank you for the reproduction steps, i’ll take a look on it soon

@italojs - Curious if you were able to look into this one yet?

Created a github issue for easier tracking of the problem: OPLog tailing in Meteor 3.1 and 3.2 results in infinite number of cursors in Mongo database server · Issue #13783 · meteor/meteor · GitHub

1 Like