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

Time-series measurement deletes update the minTime of a bucket

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 7.0.0, 8.0.0-rc0, 7.3.0
    • Component/s: None
    • None
    • Storage Execution
    • ALL
    • Execution Team 2024-09-16, Execution Team 2024-09-30
    • 200

      Time-series measurement deletes will perform a replacement-style update where they will replace the old bucket with a new bucket that only has the remaining, unaffected buckets. As part of creating this new bucket, the bucket max and min time are recalculated based on the remaining measurements. This means that if the measurements remaining in a bucket are all later in time than the earliest measurement in the bucket, the minTime will be updated.

      However, the process of archiving buckets and reopening archived buckets depends on the minTime of a bucket never changing. When we archive a bucket we emplace it into the set of archivedBuckets with the minTime at that point as the key. If a measurement delete is performed on an archived bucket, and then later we reopen this bucket for more inserts, we will try to remove it from the set of archived buckets based on the minTime - but the minTime will have been changed, so we cannot find it and the bucket remains in the set.

      Because it remains in the set, another thread can come along and close the archived bucket as part of the effort to get under the memory usage threshold. This removes the bucket's state from the bucketStateRegistry.

      Then, when the thread that reopened the bucket to insert into it goes to prepare the commit/finish the write, it will invariant because the bucket's state will no longer be tracked in the bucket state registry.

            Assignee:
            damian.wasilewicz@mongodb.com Damian Wasilewicz
            Reporter:
            damian.wasilewicz@mongodb.com Damian Wasilewicz
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: