[SERVER-73293] Make sure range deleter service is up before accessing `_rangeDeletionTasks` Created: 25/Jan/23  Updated: 29/Oct/23  Resolved: 30/Jan/23

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

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

Issue Links:
Backports
Depends
Problem/Incident
is caused by SERVER-70964 Do not wait for range deletion thread... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v6.2
Sprint: Sharding EMEA 2023-02-06
Participants:
Linked BF Score: 130

 Description   

During stepUp of RangeDeleterService we call _joinAndResetState() without the class mutex. As part of this function we also clear _rangeDeletionTasks.

In general the public API of this service calls _acquireMutexFailIfServiceNotUp so we would expect that no external thread would access the _rangeDeletionTasks before the service initialization is completed and the _state is set to kUp.

There are two special public API that uses _acquireMutexUnconditionally and then access the _rangeDeletionTasks object:

This means that these two functions can access the _rangeDeletionTasks object while the service is still down and potentially at the same time that the _joinAndResetState() is clearing it.



 Comments   
Comment by Githook User [ 30/Jan/23 ]

Author:

{'name': 'Pierlauro Sciarelli', 'email': 'pierlauro.sciarelli@mongodb.com', 'username': 'pierlauro'}

Message: SERVER-73293 Make sure range deleter service is up before accessing `_rangeDeletionTasks`
Branch: master
https://github.com/mongodb/mongo/commit/0de85d50a1d7a1c3b3f2dd73145b7dd55b37b56a

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