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

Make LRUkeyValue exception safe again

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization
    • Fully Compatible
    • QO 2024-03-04, QO 2024-03-18
    • 5

      The LRU key value holds data in two internal containers: KVList which is the source of truth - it stores the data in LRU order and KVMap which provides quick access to the data in KVList.

      After a fix, which was intended to reduce memory usage in LRUKeyValue, the contract described above has been broken: KVList now stores a pointer to the key, not the key itself, as the result of the change, it became impossible to maintain exception safety in the class, since both internal containers of it contain pointers to each other: KVList points to the key stored in KVMap and KVMap points to the data in KVList and there is no correct order of clearing data in the containters without risk of creating dangling pointers. 

            Assignee:
            alexander.ignatyev@mongodb.com Alexander Ignatyev
            Reporter:
            alexander.ignatyev@mongodb.com Alexander Ignatyev
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: