Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-80423

Make the preImage document always available to OplogDeleteEntryArgs

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 7.2.0-rc0
    • None
    • Write Ops
    • None
    • Storage Execution NAMER
    • Fully Compatible
    • Execution NAMR Team 2023-09-18, Execution NAMR Team 2023-10-02

    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().

      Attachments

        Activity

          People

            benety.goh@mongodb.com Benety Goh
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: