[SERVER-60837] CollectionUUID and OptionalCollectionUUID add more confusion than benefit Created: 20/Oct/21  Updated: 29/Oct/23  Resolved: 02/Dec/21

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

Type: Improvement Priority: Major - P3
Reporter: Kaloian Manassiev Assignee: Daniel Gomez Ferro
Resolution: Fixed Votes: 0
Labels: neweng, techdebt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2021-11-29, Execution Team 2021-12-13
Participants:
Linked BF Score: 136

 Description   

In the codebase we have defined aliases for UUID and boost::optional<UUID>, but the compiler doesn't ensure at all that they are used properly. For example, there are many places which use boost::optional<UUID> directly as a way to indicate an optional collection UUID.

Because of this I found myself grepping for CollectionUUID and OptionalCollectionUUID with the expectation I will find all the usages referred to by SERVER-31540 until I realised that this is not enough.

Generally aliasing common types is not very useful, unless it is constrained to a very small piece of code (like a class).



 Comments   
Comment by Githook User [ 02/Dec/21 ]

Author:

{'name': 'Daniel Gómez Ferro', 'email': 'daniel.gomezferro@mongodb.com', 'username': 'dgomezferro'}

Message: SERVER-60837 Remove CollectionUUID and OptionalCollectionUUID aliases
Branch: master
https://github.com/mongodb/mongo/commit/a51938f6f77a6c4934c0cc91bca31cebb6af62e5

Comment by Githook User [ 02/Dec/21 ]

Author:

{'name': 'Daniel Gómez Ferro', 'email': 'daniel.gomezferro@mongodb.com', 'username': 'dgomezferro'}

Message: SERVER-60837 Remove CollectionUUID and OptionalCollectionUUID aliases
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/5f4954fd9acead226c768f099190f58c1c8bcdb8

Generated at Thu Feb 08 05:50:52 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.