-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Catalog and Routing
-
1
-
None
-
3
-
TBD
-
🟦 Shard Catalog
-
None
-
None
-
None
-
None
-
None
-
None
When we acquire, promote, or release the critical section, we must first take the database or collection lock in MODE_X for the target resource. Taking this lock drains any in-flight operations and guarantees that the current thread is the only one that can access the resource. Today we obtain the lock through AutoGetDb / AutoGetCollection.
Those RAII objects both
- acquire the requested lock, and
- return a reference to the database/collection, which triggers placement version checks.
For the critical section, step 2) is unnecessary—we only need Lock::DBLock or Lock::CollectionLock. Leaving the placement version check in place can lead to surprising failures.