With dropTarget : True, the renameCollection command will generate two oplog entries.
One use of renameCollection is to atomically replace a collection x with an updated version of that collection. However, a read on a secondary could fail to see any version of x at all. Similarly, a crash at that point in time on the primary could result in the secondary taking over without a collection x present. Instead, we should not write the oplog entry for the implicit dropCollection.
- is related to
-
SERVER-27989 Add collection UUIDs to oplog entries
- Closed
- related to
-
SERVER-30371 Separate renameCollection across DB commands into individual oplog entries
- Closed