Anyway to limit OpLog in MongoDB 4.2

We have MongoDB 4.2.11 with 3 Nodes in replica set - Primary, Secondary and Arbiter.
With a recent incidence in Production, we had Primary node down which caused the Secondary Node to become primary. However in about 5hours the oplog collection almost rose to 15GB causing no free disk space for the current Primary Node. Eventually MongoDB Primary crashed due to no disk space issue.

Question is if there is any way to limit Oplog space in MongoDB 4.2.11? Or the only way forward is to upgrade MongoDB to 4.4 and above.

Here is the link to documentation that clarifies no way to limit oplog in 4.2.

Hope to hear some feedback or any old thread that addresses this. Thanks.

Welcome to the MongoDB community @Mohzim_Shaikh !

The procedure you linked to is for changing the size of the replication oplog.

I suspect the issue you are experiencing is due to:

  • use of an arbiter which cannot acknowledge writes

  • secondary member down for an extended period of time which can cause the primary oplog to grow past the configured size limit:

Starting in MongoDB 4.0, the oplog can grow past its configured size limit to avoid deleting the majority commit point .

There are two suggestions to avoid this issue: