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

ephemeralForTest needs to keep track of the available history based on the oldest timestamp

    • Fully Compatible
    • Execution Team 2020-07-27, Execution Team 2020-08-10
    • 0

      We need a way to keep track of the available history which allows us to open a snapshot at a point-in-time for new storage transactions. Ideally, the best spot for this would be in the KVEngine as a sorted map keyed with a Timestamp that holds a shared_ptr to the StringStore.

      Having this available history also lets us determine what the oldest timestamp should be.

      As long as there are other open storage transactions with active snapshots, those snapshots must be kept in the available history map until the last storage transaction closes its snapshot and notifies the KVEngine to allow the KVEngine to clean up the available history map appropriately based on the reference count and oldest timestamp.

      When a transaction closes its snapshot, it's also going to drop its shared_ptr references to any StringStores it held onto. If the snapshot that's being closed was the last reference (excluding the reference from the available history map) to any of the StringStores it held onto, then we must notify the KVEngine so that it can remove the appropriate StringStores from the available history and update the oldest timestamp appropriately.

      Note: As StringStore's aren't timestamped when merged in today, we can temporarily assign each consecutive merge an incrementing timestamp to be able to avoid collisions in the available history map.



            bynn.lee@mongodb.com Bynn Lee
            gregory.wlodarek@mongodb.com Gregory Wlodarek
            0 Vote for this issue
            2 Start watching this issue