[SERVER-69794] Investigate support for excluding sharding critical section checks in AutoGet Created: 19/Sep/22  Updated: 24/Jul/23  Resolved: 24/Jul/23

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

Type: Improvement Priority: Major - P3
Reporter: Jordi Olivares Provencio Assignee: Jordi Olivares Provencio
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-69530 Skip sharding DB check during index b... Closed
related to SERVER-79150 Reduce ScopedSetShardRole scope to se... Closed
Assigned Teams:
Sharding EMEA
Participants:

 Description   

As part of SERVER-69530 we discovered that Index builds need to be excluded from the critical section check of a database during commit time.

One of the alternatives discussed was the possibility of adding support to the AutoGet RAII types. These currently perform a sharding check when acquiring the DB lock. This would better document places where it is safe to not do these checks. Currently the recommended choice is to manually acquire a DBLock or CollectionLock to skip them.

If adding support to the AutoGet methods is the option considered, a follow-up ticket should work on removing current manual lock acquisition in favour of AutoGet.



 Comments   
Comment by Yujin Kang Park [ 21/Jul/23 ]

jordi.serra-torrens@mongodb.com Yes, assuming this request might not be useful elsewhere, I think we should be able to close it after SERVER-79150 is done. Will do so after finishing SERVER-79150.

Comment by Jordi Serra Torrens [ 21/Jul/23 ]

yujin.kang@mongodb.com My understanding is that this request was related to index builds, and SERVER-79150 is addressing the problem in such a way that SERVER-69794 won't be needed. Can you confirm and close this ticket?

Comment by Jordi Serra Torrens [ 22/Sep/22 ]

I don't think we should skip dbVersion checks in some particular occasions. If the client declared a dbVersion, it should be always checked.
The problem SERVVER-69530 encountered is that the opCtx that is performing the background index build has a dbVersion attached. This makes AutoGetDB perform the dbVersion check, because the opCtx declared a placement concern. If we don't want that background thread to be doing the check, we should not be emplacing the `ScopedSetShardRole` then. I'm not very familiar with the index build code, but perhaps the dbVersion check should be done before starting the index build, rather than on the background build thread.

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