[SERVER-57378] Fix data-race in the resharding commit monitor unit-tests Created: 02/Jun/21  Updated: 29/Oct/23  Resolved: 03/Jun/21

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

Type: Bug Priority: Major - P3
Reporter: Amirsaman Memaripour Assignee: Amirsaman Memaripour
Resolution: Fixed Votes: 0
Labels: servicearch-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Gantt Dependency
has to be done before SERVER-56215 Ensure current client is set in Coord... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v5.0
Sprint: Sharding 2021-06-14
Participants:
Linked BF Score: 33
Story Points: 1

 Description   

The UnblocksWhenCancellationTokenIsCancelled test (defined here) may hang due to the following:

  • The main-thread proceeds with running commands for the mocked network interface (here), but is scheduled out after running the first command, which cancels the cancelation token.
  • The commit monitor is notified about the cancelation, by checking the cancelation token in here, and returns from the function that queries the shards. As a result, the instance of ARS goes out of scope, and the destructor for ARS cancels any pending network operations.
  • The main thread is scheduled again to run commands on behalf of the mocked network interface, but since the pending commands are canceled, it will stay blocked forever.

The simple fix for this data-race is to create a new fail-point that blocks the commit-monitor in here, and unblocks it after canceling the cancelation token. This change obviates the need for the main thread to serve any commands for the mocked network interface.



 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 [ 07/Jun/21 ]

Author:

{'name': 'Amirsaman Memaripour', 'email': 'amirsaman.memaripour@mongodb.com', 'username': 'samanca'}

Message: SERVER-57378 Fix data-race in the resharding commit monitor unit-tests

(cherry picked from commit 30dff6a113de31eecf54a0721da61f6d3e781ffa)
Branch: v5.0
https://github.com/mongodb/mongo/commit/b9b9650937fe86dbfef773aa9447c571c22ac137

Comment by Githook User [ 03/Jun/21 ]

Author:

{'name': 'Amirsaman Memaripour', 'email': 'amirsaman.memaripour@mongodb.com', 'username': 'samanca'}

Message: SERVER-57378 Fix data-race in the resharding commit monitor unit-tests
Branch: master
https://github.com/mongodb/mongo/commit/30dff6a113de31eecf54a0721da61f6d3e781ffa

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