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

Time-series tests can retrieve buckets out of order

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Fully Compatible
    • ALL
    • Execution Team 2021-05-17

      In some of our time-series tests, we check the underlying buckets and expect a certain order by sorting by _id. Note that the timestamp in the _id is only precise to the second. This is typically fine, as the counter at the end of the _id will ensure the bucket order is maintained. However, consider the case where the counter overflows back to 0 across two buckets whose minimum time are within the same second. In this scenario, the second bucket will end up sorting before the first, breaking this bucket ordering assumption.

      Two potential solutions are:

      • Sort by control.min[timeFieldName], which maintains the original millisecond precision of the timestamps, or by control.min._id (assuming the individual documents' ids are ordered), rather than _id.
      • Manually select the timestamps so that the buckets are always at least one second apart.

            Assignee:
            benety.goh@mongodb.com Benety Goh
            Reporter:
            gregory.noma@mongodb.com Gregory Noma
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: