[SERVER-57126] Don't invariant that resharding machine completion promises are fulfilled on destruction Created: 21/May/21  Updated: 29/Oct/23  Resolved: 25/May/21

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 5.0.0-rc1, 5.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Blake Oler Assignee: Blake Oler
Resolution: Fixed Votes: 0
Labels: PM-234-M3, PM-234-T-autocommits, post-rc0
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v5.0
Sprint: Sharding 2021-05-31
Participants:
Linked BF Score: 50
Story Points: 1

 Description   

Background:

 

Quote from Max Hirschhorn on Slack:

 

I noticed while debugging a unit test failure for one of the resharding primary-only services that Instance::run() is scheduled as a task within the _scopedExecutor. This means it is possible for the following sequence to occur:

  1. getOrCreate() is called and caller now holds shared_ptr<Instance>
  2. _insertNewInstance() schedules task to call Instance::run() but it doesn't run yet due to thread scheduling
  3. stepdown occurs
  4. _scopedExecutor is shut down and won't run any tasks
  5. Instance::run() is never called

 

Symptoms:

The completion promise is never fulfilled because Instance::run() is never called. This trips the invariant that the completion promise is fulfilled.

Solution:

Remove the invariant. It's okay for the completion promise to not be fulfilled if the _scopedExecutor has not called Instance::run().



 Comments   
Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 25/May/21 ]

Author:

{'name': 'Blake Oler', 'email': 'blake.oler@mongodb.com', 'username': 'BlakeIsBlake'}

Message: SERVER-57126 Don't invariant that resharding machine completion promises are fulfilled on destruction

(cherry picked from commit 559c162eb6e0fe63d556bf146b5f7898bede9c9d)
Branch: v5.0
https://github.com/mongodb/mongo/commit/b5b8f334eb6dee426636c74e3cb9a90edb152078

Comment by Githook User [ 25/May/21 ]

Author:

{'name': 'Blake Oler', 'email': 'blake.oler@mongodb.com', 'username': 'BlakeIsBlake'}

Message: SERVER-57126 Don't invariant that resharding machine completion promises are fulfilled on destruction
Branch: master
https://github.com/mongodb/mongo/commit/559c162eb6e0fe63d556bf146b5f7898bede9c9d

Generated at Thu Feb 08 05:41:02 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.