Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-9216

Duplicate writes to Redis in the persistent cache if segment is loaded from Azure

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.34.0
    • 1.36.0
    • segment-tar
    • None

    Description

      In the persistent cache implementation we changed the behavior of the cache when reading segments [0] so that if a segment is not available in the first cache (disk), it will be then looked in the next one (Redis), and finally loaded from Azure. Then, the same segment will be written [1] in Redis and then disk cache once loaded.

      The problem is that we already cover the chaining of writes from both caches in each implementation [2] [3], which results in writing the same segment two times in Redis: first time after it's firstly loaded from Azure and the second time as a result of nextCache.writeSegment(msb, lsb, buffer) call from disk cache.

      I propose to remove the "chaining writes" functionality from both caches, since we have that in AbastractPersistentCache.

      [0] https://github.com/apache/jackrabbit-oak/blob/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/spi/persistence/persistentcache/AbstractPersistentCache.java#L79

      [1] https://github.com/apache/jackrabbit-oak/blob/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/spi/persistence/persistentcache/AbstractPersistentCache.java#L83

      [2] https://github.com/apache/jackrabbit-oak/blob/trunk/oak-segment-remote/src/main/java/org/apache/jackrabbit/oak/segment/remote/persistentcache/PersistentDiskCache.java#L171

      [3] https://github.com/apache/jackrabbit-oak/blob/trunk/oak-segment-remote/src/main/java/org/apache/jackrabbit/oak/segment/remote/persistentcache/PersistentRedisCache.java#L188

      Attachments

        1. OAK-9216.patch
          2 kB
          Andrei Dulceanu

        Activity

          People

            adulceanu Andrei Dulceanu
            adulceanu Andrei Dulceanu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: