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

Time-series insertBatch should find eligible existing buckets to insert into

    • Type: Icon: Task Task
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Execution
    • Execution Team 2025-01-20

      In insertBatch as of SERVER-98477, when we are finding an initial bucket to insert into we default to allocating a new bucket. For more optimal bucketing, and to follow the same logic that we do for the normal insert path, we should:

      1) Try to find an existing, allocated open bucket on disk to insert into

      2) If there are none, try to find an existing bucket on disk to reopen and insert into. Note that if we actually do perform a query to find a bucket on disk, we should release our stripe mutex while performing the query, then reacquire the lock when we return from the query. We also should not hold on to the lock in the case of waiting for an insertWaiter to resolve.

      3) If we do find a bucket to reopen and insert into, we perform one more check to see if there's a newly allocated bucket in memory to use (if a new one had been allocated in between us signaling that we want to query for a bucket on disk and us finding one); if there is one, use it. Otherwise, insert into the reopened bucket if possible

      4) Fall through and allocate a new bucket to insert into.

      We should also likely do this when we find that inserting a measurement into an eligible bucket would cause it to be rolled over.

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

              Created:
              Updated:
              Resolved: