[SERVER-80423] Make the preImage document always available to OplogDeleteEntryArgs Created: 25/Aug/23 Updated: 29/Oct/23 Resolved: 15/Sep/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Write Ops |
| Affects Version/s: | None |
| Fix Version/s: | 7.2.0-rc0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Max Hirschhorn | Assignee: | Benety Goh |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||
| Assigned Teams: |
Storage Execution NAMER
|
||||||||||||||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||||||||||||||
| Sprint: | Execution NAMR Team 2023-09-18, Execution NAMR Team 2023-10-02 | ||||||||||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||||||||||
| Description |
|
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(). |
| Comments |
| Comment by Githook User [ 15/Sep/23 ] |
|
Author: {'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}Message: |
| Comment by Githook User [ 15/Sep/23 ] |
|
Author: {'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}Message: |
| Comment by Githook User [ 15/Sep/23 ] |
|
Author: {'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}Message: |
| Comment by Githook User [ 15/Sep/23 ] |
|
Author: {'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}Message: |