Implement caching of deltas on the write path

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Block Cache
    • Storage Engines, Storage Engines - Persistence
    • None
    • None

      The block cache currently caches the full page image + the chain of subsequent deltas on the read path.

      We should extend this to also work on the write path: When writing a full page image, we should just add a cache entry for the page image as usual (this should already work). When writing a page delta, we should check if the cache contains an entry for the previous version of the page, which would consist of the full page image + a sequence of deltas:

      • If it does not, we should probably just ignore the put.
      • If it does, we can (1) remove the old entry from the cache, (2) extend the entry with the new delta and the corresponding block_meta, and (3) re-insert it into the cache with the updated key.

      Note that finding the previous version of the key would most likely require WT-14808. (However, if we can think of a design where this is not necessary, we should definitely consider it.)

      Removing the old entry and adding a new entry with the extra delta should work well for the leader, because the leader node always operates on the most recent versions of the tree. If the node is running as a follower, it is possible that a cursor that is positioned on an older version of the tree could benefit from having older cache entries for the given page, but such node would not be writing to shared storage, so we would not need to worry about supporting this case with writes.

              Assignee:
              Yury Ershov
              Reporter:
              Etienne Petrel
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: