[SERVER-77428] DeleteStage will omit returning deleted document if WCE occurs when restoring its children Created: 24/May/23  Updated: 27/Oct/23  Resolved: 14/Jul/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 4.4.0, 5.0.0, 6.0.0, 7.0.0-rc0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Jordi Serra Torrens Assignee: Denis Grebennicov
Resolution: Gone away Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-78470 Prevent multi-false UpdateStage/Delet... Closed
Assigned Teams:
Query Execution
Operating System: ALL
Sprint: QE 2023-07-24
Participants:

 Description   

DeleteStage handles WriteConflictExceptions/TemporarilyUnavailableExceptions when restoring its children state by returning NEED_YIELD. If the stage needs to return the deleted document, it annotates it on `_idReturning` so that on the next `doWork` it is returned. However, if the delete was "justOne: true", the next `doWork` will immediately return EOF instead of the pending document.

If this happened, findAndModify would delete the document but not return it.



 Comments   
Comment by Jordi Serra Torrens [ 31/May/23 ]

amr.elhelw@mongodb.com it is my understanding that WT calls can fail with TemporarilyUnavaliable exception when under cache pressure. The storage execution team may know how to induce that situation. Alternatively, one could use a failpoint to throw TemporarilyUnavailable here.

Comment by Amr Elhelw [ 30/May/23 ]

jordi.serra-torrens@mongodb.com Do you have a way to reproduce this behavior?

Generated at Thu Feb 08 06:35:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.