[SERVER-81487] Add comments that acquireCollection() and AutoGet() can throw WriteConflictExceptions Created: 27/Sep/23  Updated: 03/Nov/23

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Haley Connelly Assignee: Backlog - Catalog and Routing
Resolution: Unresolved Votes: 0
Labels: car-qw
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Assigned Teams:
Catalog and Routing
Participants:
Linked BF Score: 133
Story Points: 1

 Description   

SERVER-71287 changed the behavior of verifyDbAndCollection() to throw a WriteConflictException rather than SnapshotUnavailable when there is a write request.

This means acquireCollection() and AutoGetCollection() can both throw WriteConflictException when establishing a collection snapshot. 

There are several places in the code that don't wrap acquireCollection() in a writeConflictRetry(), but use writeConflictRetry() in the lines following the acquisition.



 Comments   
Comment by Haley Connelly [ 28/Sep/23 ]

We should probably update the code to internally handle WCE in the initial acquireCollection call as a part of the API.
Edit: It's not safe to retry at such a low level in case higher level operations need to be yielded to handle WCE
cc kaloian.manassiev@mongodb.com who brought this up offline.

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