-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Query Integration
-
Fully Compatible
-
ALL
-
v8.0
The TextMatchExpression object currently attempts to acquire a collection manually in order to gather the necessary information. This has the requirement of locking the collection and following the lock hierarchy.
However, this has the unfortunate side effect of flipping the lock ordering used for the global and RSTL locks in case we're doing a lock-free read. The lock-free read only locks the global lock while the class would then proceed to lock the RSTL first followed by the global lock. That is, it breaks the ordering of first RSTL followed by Global locks.
This has the potential to cause a deadlock even if we haven't yet encountered it.
The ideal fix here would be to just replace that call with something that uses the Shard Role API so we acquire the collection in the same manner as the rest of the code path.
- is depended on by
-
SERVER-94876 Add global lock ordering check to avoid lock-free reads taking a normal lock
- Backlog
- related to
-
SERVER-93918 Parsing a $text expression should not acquire a lock
- Backlog