Anyway to limit OpLog in MongoDB 4.2

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:

Regards,
Stennie