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