SERVER-137801Open

Ensure applyOps delete cannot crash the server if it fails to find preimage

The delete branch of applyOperation_inlock in src/mongo/db/repl/oplog.cpp decides whether to record a change-stream pre-image *before* it runs the delete, then asserts that a pre-image was produced. The decision helper shouldRecordChangeStreamPreImage() (src/mongo/db/repl/oplog.cpp:2579-2591) looks only at whether the collection has changeStreamPreAndPostImages enabled and at the oplog application mode; it never checks that the document being deleted exists. When the delete matches nothing, dele

Affected Versions
Versions known to exhibit this issue

No affected versions recorded.

Fixed Versions
Versions that include the fix

No fix available yet.

Components
Server components related to this issue

No components specified.

Labels
Tags and classification

No labels assigned.