[SERVER-67850] AutoGetCollection doesn't always take db lock Created: 07/Jul/22 Updated: 27/Oct/23 Resolved: 07/Jul/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Louis Williams | Assignee: | Kaloian Manassiev |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Operating System: | ALL | ||||||||
| Sprint: | Sharding EMEA 2022-07-11 | ||||||||
| Participants: | |||||||||
| Description |
|
AutoGetCollection (AGC) accepts a NamespaceStringOrUUID which can either store a full namespace string or a database name and UUID. This call to NamespaceStringOrUUID::db() does not consider the case where AGC is constructed with a full namespace string. As a result, it takes a database lock on an empty namespace. |
| Comments |
| Comment by Janna Golden [ 07/Jul/22 ] |
|
There's a ticket to remove dbname() ( |
| Comment by Kaloian Manassiev [ 07/Jul/22 ] |
|
We should probably get rid of these functions. I think they are vestiges of the transformation to move to Tenant-including namespaces. |
| Comment by Louis Williams [ 07/Jul/22 ] |
|
I apologize, the db() function does the correct thing and handles both the namespace string and dbname + UUID case. The dbname() and dbName() functions do not do the correct thing. Sorry to raise any alarms! |
| Comment by Louis Williams [ 07/Jul/22 ] |
|
CC kaloian.manassiev@mongodb.com, I believe this change was introduced by |