[SERVER-78226] Add type to refer to NamespaceString and UUID Created: 20/Jun/23  Updated: 27/Jun/23

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

Type: Improvement Priority: Major - P3
Reporter: Matt Broadstone Assignee: Backlog - Storage Execution Team
Resolution: Unresolved Votes: 0
Labels: neweng, techdebt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Storage Execution
Participants:

 Description   

From a recent code review for SERVER-77348:

The way I see it, there should be only the following ways to ask for a namespace and either it should be just 1 or all, but not some combination of the three:

Either I give you the namespace (db.coll) and I don't care what's behind, which should be 99% of the cases
OR I give you the DB+UUID and I don't care what's the name
OR I give you all of the above and I want them all to match

There are a few places where we track an optional nss, dbName, and uuid, which look deceptively similar to a NamespaceStringOrUUID. We should consider introducing a new type to express the case that NamespaceStringOrUUID cannot currently handle: NamespaceString and UUID. Another choice might be to support a third state in the NamespaceStringOrUUID union (and perhaps rename that type to something like CollectionOrViewLocator).

Examples:



 Comments   
Comment by Cris Insignares Cuello [ 22/Jun/23 ]

In the presence of all the 3 fields: nss, dbName, and uuid; we will have to verify using the local catalog whether the UUID associated with the collection name actually matches the UUID provided by the user.

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