Rishabh Daim created OAK-12367:
----------------------------------

             Summary: SegmentCache: Disable flacky test added for L1 hits 
should notify L2 (caffeine)
                 Key: OAK-12367
                 URL: https://issues.apache.org/jira/browse/OAK-12367
             Project: Jackrabbit Oak
          Issue Type: Task
            Reporter: Rishabh Daim
            Assignee: Rishabh Daim
             Fix For: 2.2.0


*Segment cache (L2)*: Caffeine W-TinyLFU and Guava LRU only learn about 
accesses that go through _SegmentCache.getSegment()_. Production traffic often 
hits _SegmentId.getSegment()_ and returns the memoized segment from L1 without 
touching L2. That made eviction policies act on stale frequency/recency while 
the JVM was still reading “hot” segments from L1 — wrong evictions, extra TAR 
reads, and skewed benchmarks vs reality.

This was working for Guava, since it was using the LRU eviction policy.

*Fix*: On every L1 hit, call _SegmentCache.recordHit(SegmentId)_, which 
performs _cache.getIfPresent(id)_ on the backing L2 so policies see real usage, 
plus existing hit accounting.



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

Reply via email to