[SERVER-31026] log UUIDs in consistent format Created: 11/Sep/17  Updated: 30/Oct/23  Resolved: 19/Oct/17

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 3.6.0-rc1

Type: Improvement Priority: Major - P3
Reporter: Judah Schvimer Assignee: Geert Bosch
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Storage 2017-10-23
Participants:

 Description   

UUIDs are sometimes logged as

{uuid: BinData(4, E91A2A2690EE4F35A8AADFE0509B319F)}

and sometimes logged as e91a2a26-90ee-4f35-a8aa-dfe0509b319f. We should be consistent how we log them so that it's easier to look for them in logs.



 Comments   
Comment by Githook User [ 19/Oct/17 ]

Author:

{'email': 'geert@mongodb.com', 'name': 'Geert Bosch', 'username': 'GeertBosch'}

Message: SERVER-31026 Fix Windows zero-length array error
Branch: master
https://github.com/mongodb/mongo/commit/6459867cc36f379d01f2f99642f6edcabdd3c1ce

Comment by Githook User [ 19/Oct/17 ]

Author:

{'email': 'geert@mongodb.com', 'name': 'Geert Bosch', 'username': 'GeertBosch'}

Message: SERVER-31026 Properly format UUIDs in BSONElement::toString
Branch: master
https://github.com/mongodb/mongo/commit/aeb400b70f31c77109c12a3dfd1539e0c4e995e6

Comment by Geert Bosch [ 10/Oct/17 ]

The output BinData(4, E91A2A2690EE4F35A8AADFE0509B319F) has nothing to do with the BSON format, but rather is just an ad-hoc string version implemented in BSONElement::toString() in the server. Note that the output is inconsistent with that generated by or accepted by the Mongo shell, or drivers such as the Python driver. These use the UUID('e91a2a26-90ee-4f35-a8aa-dfe0509b319f'). I already have a patch to fix this, so will assign to myself.

Comment by Judah Schvimer [ 10/Oct/17 ]

After discussing with geert.bosch, we will go with the dashed format.

Comment by Judah Schvimer [ 11/Sep/17 ]

We cannot change the BSON representation, so I recommend we just change UUID::toString() and UUID::parse() to match the all-caps, no-dash BSON representation.

Generated at Thu Feb 08 04:25:46 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.