[SERVER-34615] find by UUID can return NamespaceNotFound for a collection that is concurrently renamed Created: 23/Apr/18 Updated: 29/Oct/23 Resolved: 07/Jun/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Storage |
| Affects Version/s: | None |
| Fix Version/s: | 4.0.0-rc5, 4.1.1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | William Schultz (Inactive) | Assignee: | Maria van Keulen |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||||||||||
| Backport Requested: |
v4.0
|
||||||||||||||||||||||||||||
| Sprint: | Storage NYC 2018-05-21, Storage NYC 2018-06-04, Storage NYC 2018-06-18 | ||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||
| Linked BF Score: | 63 | ||||||||||||||||||||||||||||
| Description |
|
The find command (and presumably any other command that needs to resolve UUIDs to namespaces), can return a NamespaceNotFound error on a collection that is concurrently renamed within the same database. If we try to execute a find command by UUID for a collection that exists but is being concurrently renamed, there is a race condition due to the fact that the find command resolves UUIDs to namespaces outside of its locks. For example, consider the following execution for a find and renameCollection command running on separate threads: Although accesses to the UUIDCatalog are made atomic by the catalog lock, different commands may still interleave their operations on the catalog in an arbitrary order, if not protected by stronger (database or collection level) locks. Attached is a repro (find_by_uuid_and_rename.js |
| Comments |
| Comment by Githook User [ 07/Jun/18 ] |
|
Author: {'username': 'mvankeulen94', 'name': 'Maria van Keulen', 'email': 'maria@mongodb.com'}Message: (cherry picked from commit 7c12245583958023e35bce05d6b2212dcd7f24e3) |
| Comment by Githook User [ 06/Jun/18 ] |
|
Author: {'username': 'mvankeulen94', 'name': 'Maria van Keulen', 'email': 'maria@mongodb.com'}Message: |
| Comment by William Schultz (Inactive) [ 23/Apr/18 ] |
|
This issue is to some extent already described in the comment thread on |