OpObserverImpl::onDelete() is always called with engaged deletedDoc value for findAndModify deletes.
- https://github.com/mongodb/mongo/blob/49f6fcebd3c4a97abcd05c862ad1204eed9d66ef/src/mongo/db/op_observer_impl.cpp#L671-L673
- https://github.com/mongodb/mongo/blob/49f6fcebd3c4a97abcd05c862ad1204eed9d66ef/src/mongo/db/catalog/collection_impl.cpp#L1062-L1073
- https://github.com/mongodb/mongo/blob/49f6fcebd3c4a97abcd05c862ad1204eed9d66ef/src/mongo/db/exec/delete.cpp#L204-L205
- https://github.com/mongodb/mongo/blob/49f6fcebd3c4a97abcd05c862ad1204eed9d66ef/src/mongo/db/commands/find_and_modify.cpp#L189
The consequences of this are two-fold:
- findAndModify deletes within a multi-statement transaction write preImage no-op oplog entries, even when the recordPreImages collection option is set to false (the default). This leads to write amplification akin to
SERVER-45442. - preImage no-oplog entries from multi-statement transaction deletes do not include session information. This leads donor shards in chunk migrations to crash when parsing them.
- depends on
-
SERVER-56375 [RRFaM] Have delete path write to config.transactions
- Closed
- is caused by
-
SERVER-45806 Record pre-images on updates and deletes when recordPreImage is enabled
- Closed