Can you clarify what you mean by “oplog replay”? Are you referring to a secondary pulling updates from another member of your replica set? Can you provide an example of the operations you are looking at?
For a description of the general processes of initial sync and ongoing replication, please review Replication Set Data Synchronisation.
local database removes the collections and configuration it contains (
system.replset, …). but does not affect data in other databases.
However, replica set members rely on the oplog to determine the provenance of data. If you drop the
local database (or the
local.oplog.rs collection) for a replica set member, it cannot rejoin the same replica set without resyncing all data. If a replica set member has an oplog but no longer has an entry in common with the oplog of another member of the replica set, a resync will also be required.
If there are data changes you want to preserve on a replica set member that you are about to resync, you should take a backup of the relevant data before starting the resync process. The resync process replaces all data and indexes with a fresh copy (and known state) from another replica set member.