[SERVER-68776] Cancel range deleter service's waits for ongoing queries in case of stepdown Created: 12/Aug/22 Updated: 27/Oct/23 Resolved: 19/Oct/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Pierlauro Sciarelli | Assignee: | Pierlauro Sciarelli |
| Resolution: | Gone away | Votes: | 0 |
| Labels: | pm-2849-optimizations | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Sprint: | Sharding EMEA 2022-10-03, Sharding EMEA 2022-10-17, Sharding EMEA 2022-10-31 | ||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
When a range deletion task is waiting for ongoing queries to finish, such wait is independent from the executor the chain is scheduled on. As a result, invalidating the executor on stepdown does not cause the wait to end. In order to don't leave dangling waits around, add a cancellation source member to the range deleter service that is initialized on step-up and invalidated on stepdown, then wait on the future with cancellation.
PS: if the ticket will be done after SERVER-68580, it will not be needed to provide a custom implementation of the cancellation source as it will already be available since the range deleter service is a replica set aware service. |
| Comments |
| Comment by Pierlauro Sciarelli [ 19/Oct/22 ] |
|
Closing as "gone away" because range deletions are not scheduled anymore on the executor but happen within a different thread. |