[SERVER-6054] Improve uniqueness of ObjectIds Created: 10/Jun/12 Updated: 10/May/22 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | Concurrency |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Glenn Maynard | Assignee: | DO NOT USE - Backlog - Platform Team |
| Resolution: | Unresolved | Votes: | 3 |
| Labels: | move-sa, platforms-re-triaged | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Participants: | |||||||||
| Description |
|
(This would include both drivers and core.) Currently, two bytes are used in ObjectId to store the PID. This seems to be meant to make ObjectIds not collide if multiple processes on the same server generate ObjectIds. However, many environments will only ever have a single process per server. In that case this wastes two bytes, particularly when running imaged servers that will always boot in the same way (resulting in the same PIDs across all servers). This can be improved. In http://www.mongodb.org/display/DOCS/Object+IDs#ObjectIDs-BSONObjectIDSpecification:
MD5(HostName + PID)[0:3]
This preserves the separation of different processes on the same server, while giving 40 bits of randomness (assuming the "inc" field is initialized to a random value, which it always should be) rather than just 24. This change should cause no compatibility issues with existing ObjectIds, and improve the uniqueness guarantees of ObjectId. |
| Comments |
| Comment by Steven Vannelli [ 10/May/22 ] |
|
Moving this ticket to the Backlog and removing the "Backlog" fixVersion as per our latest policy for using fixVersions. |
| Comment by Samantha Ritter (Inactive) [ 16/Jun/17 ] |
|
I am moving this ticket out of the Logical Sessions epic, since we have addressed session ids in a way that does not involve ObjectIds. |
| Comment by Glenn Maynard [ 10/Jun/12 ] |
|
See the first June 10 post at https://groups.google.com/forum/?fromgroups#!topic/mongodb-user/ajgO9wUxbos for an example of why this is important. (Sorry, I can't find any way to link to a specific post on Groups.) |