Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-78080

Use fully random bytes for 8 low-order bytes of OID value for time series bucket _id

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.1.0-rc0, 6.3.2, 6.0.7, 5.0.19, 7.0.0-rc5
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Fully Compatible
    • v7.0, v6.3, v6.0, v5.0
    • Execution NAMR Team 2023-06-26
    • 124

      The current implementation for time series bucket _id generation follows this process:

      1. Generate an OID.
      2. Replace the 4 high-order timestamp bytes of the OID with a rounded version of the user-specified timestamp from the first measurement that lands in the bucket.
      3. Add the difference between the original timestamp and the rounded version to the next five bytes of the OID (the cluster-unique bytes).

      This process was devised originally to deal with coarse granularity in SERVER-61194, but is still susceptible to collisions when many buckets are opened using the exact same initial timestamp.

      In order to further reduce the chances of collisions in these cases, we should simply generate the OID from scratch by filling in the 4 high-order with the rounded timestamp as we currently do, then fill in the remaining 8 low-order bytes with a randomly generated number.

            dan.larkin-york@mongodb.com Dan Larkin-York
            dan.larkin-york@mongodb.com Dan Larkin-York
            0 Vote for this issue
            5 Start watching this issue