[ 
https://issues.apache.org/jira/browse/OAK-12425?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rishabh Daim updated OAK-12425:
-------------------------------
    Description: 
h3. Summary
Allow oak-store-document to opt into Caffeine with synchronous maintenance 
while preserving the existing CacheLIRS persistent-cache implementation and 
metadata flow.

h3. Scope
Build on OAK-12436 and OAK-12438. Gate Caffeine selection behind 
FT_CAFFEINE_CACHE_OAK-12425, disabled by default. Standalone processes 
explicitly opt in using -Doak.documentMK.caffeineCache=true. Select SYNC 
maintenance for all Document caches. Snapshot implementation selection once per 
builder and require a replacement builder/DocumentNodeStore after a feature 
change. Register the eviction listener before the persistent wrapper attaches 
its callback.

Keep NodeCache, CacheMetadata, raw values, live maps, custom weights, cache 
statistics, the persistent file format and persistent-write behavior unchanged. 
Entry-owned metadata, new mutation monitors and guarded persistence belong 
exclusively to OAK-12437's optional ASYNC path. Add further production fixes 
here only when a test demonstrates a Caffeine SYNC compatibility issue.

h3. Acceptance Criteria
* Default feature-off behavior retains CacheLIRS and the original 
persistent-cache wrapper.
* Feature-on behavior uses Caffeine SYNC with the original metadata 
representation and no new entry overhead.
* Implementation selection remains stable across caches constructed by the same 
builder; feature changes require restart/recreation.
* Persistent size evictions reach the existing wrapper, including when the 
listener is attached after memory-cache construction.
* Existing persistence, broadcast, compatibility, loader and raw-value/weight 
tests pass with both CacheLIRS and Caffeine SYNC under Java 17.
* [PR #3176|https://github.com/apache/jackrabbit-oak/pull/3176] contains the 
minimal SYNC migration. Optional ASYNC and entry-owned metadata are in 
[OAK-12437|https://issues.apache.org/jira/browse/OAK-12437] / PR #3190; 
comparative measurements follow in OAK-12426 / PR #3174.


  was:
h3. Summary
Migrate oak-store-document caches to Caffeine while keeping maintenance 
synchronous and storing persistent-cache metadata with each cache entry.

h3. Scope
Build on the per-cache maintenance API from OAK-12436 and Segment Tar changes 
from OAK-12438. Replace the DocumentNodeStore cache implementation with 
Caffeine. Keep every Document cache in SYNC mode in this change; Document-level 
ASYNC opt-in is tracked separately by OAK-12437. Store persistence-origin 
metadata in the cache entry itself rather than a coordinated side map. Preserve 
raw values through cache APIs and live maps, weights, statistics, eviction 
behavior, and the persistent file format.

h3. Acceptance Criteria
* All DocumentNodeStore Caffeine caches use SYNC maintenance in this change.
* Entry-owned metadata handles load, replacement, invalidation, eviction and 
persistence without a parallel metadata map or coordination protocol.
* Existing cache API and asMap behavior, weighting, statistics, and 
persistent-cache compatibility remain intact.
* Relevant document-store tests pass under Java 17.
* This work is PR #3176, based on #3186; async opt-in and comparative 
benchmarks are separate dependent PRs.


        Summary: Opt into Caffeine SYNC maintenance in oak-store-document  
(was: oak-store-document should use caffeine by default instead of cachelirs)

> Opt into Caffeine SYNC maintenance in oak-store-document
> --------------------------------------------------------
>
>                 Key: OAK-12425
>                 URL: https://issues.apache.org/jira/browse/OAK-12425
>             Project: Jackrabbit Oak
>          Issue Type: Technical task
>            Reporter: Rishabh Daim
>            Assignee: Rishabh Daim
>            Priority: Major
>
> h3. Summary
> Allow oak-store-document to opt into Caffeine with synchronous maintenance 
> while preserving the existing CacheLIRS persistent-cache implementation and 
> metadata flow.
> h3. Scope
> Build on OAK-12436 and OAK-12438. Gate Caffeine selection behind 
> FT_CAFFEINE_CACHE_OAK-12425, disabled by default. Standalone processes 
> explicitly opt in using -Doak.documentMK.caffeineCache=true. Select SYNC 
> maintenance for all Document caches. Snapshot implementation selection once 
> per builder and require a replacement builder/DocumentNodeStore after a 
> feature change. Register the eviction listener before the persistent wrapper 
> attaches its callback.
> Keep NodeCache, CacheMetadata, raw values, live maps, custom weights, cache 
> statistics, the persistent file format and persistent-write behavior 
> unchanged. Entry-owned metadata, new mutation monitors and guarded 
> persistence belong exclusively to OAK-12437's optional ASYNC path. Add 
> further production fixes here only when a test demonstrates a Caffeine SYNC 
> compatibility issue.
> h3. Acceptance Criteria
> * Default feature-off behavior retains CacheLIRS and the original 
> persistent-cache wrapper.
> * Feature-on behavior uses Caffeine SYNC with the original metadata 
> representation and no new entry overhead.
> * Implementation selection remains stable across caches constructed by the 
> same builder; feature changes require restart/recreation.
> * Persistent size evictions reach the existing wrapper, including when the 
> listener is attached after memory-cache construction.
> * Existing persistence, broadcast, compatibility, loader and raw-value/weight 
> tests pass with both CacheLIRS and Caffeine SYNC under Java 17.
> * [PR #3176|https://github.com/apache/jackrabbit-oak/pull/3176] contains the 
> minimal SYNC migration. Optional ASYNC and entry-owned metadata are in 
> [OAK-12437|https://issues.apache.org/jira/browse/OAK-12437] / PR #3190; 
> comparative measurements follow in OAK-12426 / PR #3174.



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

Reply via email to