[SERVER-69678] Range deleter observers must register tasks after the oplog entry is committed Created: 14/Sep/22  Updated: 29/Oct/23  Resolved: 16/Sep/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.2.0-rc0

Type: Bug Priority: Major - P3
Reporter: Pierlauro Sciarelli Assignee: Silvia Surroca
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding EMEA 2022-09-19
Participants:

 Description   

The range deleter observer is currently registering tasks on insert and on update , slightly before the entry oplog entry is actually committed.

This may lead to an improbable but still possible race condition:

  1. The observer registers the task with "whenToClean=now"
  2. The range deleter service executor picks the task and executes it right away
  3. No orphan gets deleted because the range deletion document is not visible yet, the task gets unscheduled
  4. The range deletion document gets committed

Purpose of this ticket is to delay the registration after the commit actually happens (basically making sure 4 always happens first). This can be done by registering an onCommit event similarly to the way it's done for the critical section.



 Comments   
Comment by Aaron Morand (Inactive) [ 14/Feb/23 ]

Replacing incorrectly removed fixVersion

Comment by Githook User [ 15/Sep/22 ]

Author:

{'name': 'Silvia Surroca', 'email': 'silvia.surroca@mongodb.com', 'username': 'silviasuhu'}

Message: SERVER-68660 + SERVER-69678 register range deletion tasks with ongoing queries future after the oplog entry is committed
Branch: master
https://github.com/mongodb/mongo/commit/df3e7c75ed9f70ce38bbc886c3861141c07ddd08

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