[SERVER-65996] Remove TODOs referencing SERVER-54284 Created: 26/Apr/22  Updated: 29/Oct/23  Resolved: 05/Jul/22

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 6.1.0-rc0

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

Issue Links:
Gantt Dependency
has to be done after SERVER-54284 ExceptionFor<ErrorCodes::WriteConflic... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding EMEA 2022-06-13, Sharding EMEA 2022-06-27, Sharding EMEA 2022-07-11
Participants:

 Description   

There are two TODOs in the core-server code that reference SERVER-54284 and concern removing writeConflictRetry upon completion of SERVER-54284. Since removing the TODOs requires some context, they are rewritten to reference this ticket instead.



 Comments   
Comment by Githook User [ 05/Jul/22 ]

Author:

{'name': 'Allison Easton', 'email': 'allison.easton@mongodb.com', 'username': 'allisoneaston'}

Message: SERVER-65996 Remove TODOs referencing SERVER-54284
Branch: master
https://github.com/mongodb/mongo/commit/2254719a6517cfec00202625bb594db6da889e54

Comment by Allison Easton [ 04/Jul/22 ]

The two updates in this ticket use the persistent task store which is a wrapper around the DBDirectClient (which automatically retries WriteConflictExceptions). The idea of these TODO statements was that after SERVER-64284 completed, the DBDirectClient would retry WriteConflictExceptions as well as ExceptionFor<ErrorCodes::WriteConflict> because they would be the same thing. This is true, but we were still seeing failures when removing the writeConflictRetry loops.
After some investigation, we found that the DBDirectClient only retries on WriteConflictExceptions if there are no strong locks held. In the updates referenced in this ticket, we are holding the ScopedRangeDeleterLock which has a resource mutex lock in mode X. Therefore the DBDirectClient update automatically uses yield policy NO_YIELD (to prevent releasing and reacquiring the X lock) which means WriteConflictRetries will not be re-executed.

Because of this, we cannot actually remove the writeConflictRetry loops around these updates.

Comment by Silvia Surroca [ 23/Jun/22 ]

Reassigning ticket to allison.easton@mongodb.com cause she has more context about the issue

Comment by Allison Easton [ 28/Apr/22 ]

Yes, the TODOs were introduced by those tickets. The idea was that once SERVER-54284 is complete, it should be as simple as removing the writeConflictRetry wrapper around each update.

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