collection_internal::deleteDocument() always receives an owned BSONObj when the storage engine supports document-level concurrency. This is because either (a) DeleteStage and BatchedDeleteStage will have called WorkingSetMember::makeObjOwnedIfNeeded() or (b) collection_internal::deleteDocument(const RecordId& loc) will have called CollectionPtr::docFor() which copies the contents out of the storage engine. This means that, since the removal of the MMAPv1 storage engine in MongoDB 4.2, OplogDeleteEntryArgs::deletedDoc can be non-nullptr BSONObj.
Furthermore, OpObserver::aboutToDelete() no longer serves a meaningful purpose because the memory for the copied deletedDoc is guaranteed to outlive the contents of the storage engine. We can therefore simplify the pattern of using decorations to propagate state between OpObserver::aboutToDelete() and OpObserver::onDelete() by instead using local variables within OpObserver::onDelete().
- is related to
-
SERVER-16049 Replicate capped collection deletes explicitly
- Closed
-
SERVER-68205 Pull capped collection maintenance out of CollectionImpl
- Closed
-
SERVER-17148 Remove plans do not need a FETCH stage
- Blocked
-
SERVER-60602 Delete code for unreplicated capped deletes
- Closed
-
SERVER-69237 Make the preImage document always available to CollectionUpdateArgs from UpdateStage
- Closed
-
SERVER-77484 migrate OperationContext decorations to OplogDeleteEntryArgs for delete operations
- Closed
- related to
-
SERVER-80680 remove no-op MigrationChunkClonerSourceOpObserver::aboutToDelete(
- Closed
-
SERVER-80956 remove OpObserver::aboutToDelete
- Closed
-
SERVER-81080 rename OplogDeleteEntryArgs::oplogSlots to clarify retryable findAndModify usage
- Closed