[DOCS-11330] single-threaded generation of ObjectIds can be non-monotonic Created: 15/Feb/18  Updated: 30/Oct/23  Resolved: 27/Mar/18

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Improvement Priority: Major - P3
Reporter: Kelsey Schubert Assignee: Andrew Aldridge
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
is documented by DOCS-8668 Revise cursor.skip() docs Closed
Participants:
Days since reply: 5 years, 51 weeks, 6 days ago
Story Points: 0.5

 Description   

We should clarify that even single-threaded generation of ObjectIds will sometimes be non-monotonic.

From kevin.pulo,

The ObjectId definition says that the 3-byte counter starts at a random value (and implicitly is incremented with each generated ObjectId). The current behaviour (in the server/shell at least) is to roll back to 0 after reaching 0xffffff. Unfortunately, when this happens any further ObjectIds generated by that thread during the same second will have a lower sort order (compared to the previously-generated ObjectIds during that second) — that is, single-threaded ObjectId generation is not always monotonic.


Generated at Thu Feb 08 08:02:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.