You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Andrei Dulceanu (Jira)" <ji...@apache.org> on 2020/09/21 11:47:00 UTC

[jira] [Created] (OAK-9216) Duplicate writes to Redis in the persistent cache if segment is loaded from Azure

Andrei Dulceanu created OAK-9216:
------------------------------------

             Summary: Duplicate writes to Redis in the persistent cache if segment is loaded from Azure
                 Key: OAK-9216
                 URL: https://issues.apache.org/jira/browse/OAK-9216
             Project: Jackrabbit Oak
          Issue Type: Bug
          Components: segment-tar
            Reporter: Andrei Dulceanu
            Assignee: Andrei Dulceanu


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]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)