Rishabh Daim created OAK-12438:
----------------------------------

             Summary: Store cache metadata alongside the corresponding cache 
entry
                 Key: OAK-12438
                 URL: https://issues.apache.org/jira/browse/OAK-12438
             Project: Jackrabbit Oak
          Issue Type: Task
            Reporter: Rishabh Daim


h3. Summary
Store oak-store-document persistent-cache metadata with the exact in-memory 
cache entry it describes.

h3. Context
The async persistent-cache wrapper currently keeps access and 
persistence-origin metadata in a separate map keyed by cache key. A delayed 
eviction callback can race with a replacement entry, and the metadata map can 
retain a strong reference to the cached value. Move this metadata into an 
internal entry wrapper while preserving the existing Cache<K,V> API and 
persistent-cache file format.

h3. Acceptance Criteria
# Access count and persistent-cache-origin state are stored with the 
corresponding in-memory cache entry.
# Eviction handling uses metadata from the exact evicted entry, including when 
callbacks are delayed and the same key is replaced or reinserted.
# Cache<K,V> callers continue to observe raw V values, including through a live 
asMap view.
# Cache weights continue to reflect the cached value, and the persistent 
on-disk format is unchanged.
# Existing behavioral tests for persistence eligibility, invalidation, 
replacement, bulk access, and load/eviction races pass.
# Tests exercise the implementation with both SYNC and ASYNC maintenance modes.




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to