[SERVER-42851] fix race condition in the TransactionCoordinatorCatalog.CoordinatorsRemoveThemselvesFromCatalogWhenTheyComplete test Created: 16/Aug/19  Updated: 29/Oct/23  Resolved: 21/Aug/19

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.3.1

Type: Bug Priority: Minor - P4
Reporter: Lamont Nelson Assignee: Matthew Saltz (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

build/ninja/mongo/db/s/db_s_transaction_coordinator_test --filter CoordinatorsRemoveThemselvesFromCatalogWhenTheyComplete --suite TransactionCoordinatorCatalogTest --repeat=100000

Sprint: Sharding 2019-08-26
Participants:
Linked BF Score: 11

 Description   

This ticket is filed in response to BF-14376. The test assertion, and the code that removes the coordinator from the catalog are not synchronized, and could lead to the an execution where the assertion runs before the coordinator is removed.

The CoordinatorsRemoveThemselvesFromCatalogWhenTheyComplete test waits on the future for the coordinator to complete and then checks if it is removed from the catalog. There is no coordination between the code that removes the coordinator from the catalog, which is an async callback that executes after the onCompletion future is ready, and the test assertion. Therefore, there are no ordering guarantees between the removal callback and the assertion code, which is what we see as the result of this build failure.



 Comments   
Comment by Matthew Saltz (Inactive) [ 21/Aug/19 ]

Fixed as part of the following commit since it was required for the other ticket:

Author:

{'username': 'saltzm', 'email': 'matthew.saltz@mongodb.com', 'name': 'Matthew Saltz'}

Message: SERVER-42772 Return transaction commit decision from onCompletion future in TransactionCoordinator
Branch: master
https://github.com/mongodb/mongo/commit/05a99879a6369d6220356d099ac5625d359ffd4d

Comment by Matthew Saltz (Inactive) [ 20/Aug/19 ]

This is required for another ticket I'm working on (SERVER-42772) so I'll just do the fix as part of that ticket.

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