[ 
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
Move oak-store-document's Caffeine-backed caches to synchronous maintenance 
while keeping eviction metadata attached to the exact cache entry.

h3. Scope
PR #3176 migrates DocumentNodeStore to Caffeine and implements entry-owned 
access and persistence-origin metadata. Every Document cache uses SYNC 
maintenance in this step. Document-level ASYNC selection and its production 
integration tests are delivered separately by 
[OAK-12437|https://issues.apache.org/jira/browse/OAK-12437] on top of this 
change.

Preserve raw Cache<K,V> values, live map operations, weighing, statistics, 
persistent serialization and the on-disk format. Remove the separate 
value-retaining metadata map and its coordination protocol.

  was:
oak-store-document uses CacheLIRS as its internal cache.

Now since we are moving forward with caffeine cache, we need to make caffeine 
as default cache for oak-store-document bundle as well.

However, there is one concern here i.e. maintainence. CacheLIRS does 
maintainence in sync mode whereas caffeine does it in async mode and we must 
consider this while moving ahead with caffeine.

h3. Metadata correctness and dependencies
Store access and persistence-origin metadata with each in-memory cache entry. 
Remove the separate value-retaining metadata map, preserving raw Cache<K,V> and 
live map behavior, weights, statistics and the persistent file format. Validate 
delayed eviction, replacement/reinsertion, bulk lookup, loading, broadcast and 
invalidation under both SYNC and ASYNC. Per-cache mode selection is provided by 
OAK-12436. Segment Tar integration is a separate OAK-12438 PR.


h3. Configuration and behavioral acceptance criteria
# DocumentNodeStoreBuilder supports an independent maintenance mode per 
CacheType; unconfigured caches default to SYNC. A bundle-owned override is 
applied through this per-cache API, without changing other bundles' caches.
# Entry-owned access and persistence-origin metadata replace the separate 
metadata map. Metadata is released with its entry and a delayed eviction 
callback refers to that exact entry, including same-object reinsertion.
# Preserve the raw Cache<K,V> API and live asMap behavior for putIfAbsent, 
replace, conditional remove, compute, iterator removal and clear. Include entry 
memory overhead in weighing while serializing only the original value.
# Validate used/unused entries, persistent origin, bulk hits/misses, null and 
failed loaders, eviction before a loader returns, replacement, delayed 
callbacks, broadcasts, explicit invalidation and queued-write ordering under 
both maintenance modes.
# Update tests coupled to the removed metadata implementation and remove only 
obsolete implementation-specific tests. Retain behavioral assertions and add 
regression coverage for the new entry design.
# Deliver this PR above OAK-12438 in the gh stack. Finish the full planned 
implementation before the final reviews; validate with java17.


h3. Bundle default
Oak Store Document selects SYNC maintenance by default, with explicit per-cache 
ASYNC overrides. The shared CacheBuilder API remains ASYNC by default. Caller 
configuration belongs in this PR, not OAK-12436 / PR 3185.



> oak-store-document should use caffeine by default instead of cachelirs
> ----------------------------------------------------------------------
>
>                 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
> Move oak-store-document's Caffeine-backed caches to synchronous maintenance 
> while keeping eviction metadata attached to the exact cache entry.
> h3. Scope
> PR #3176 migrates DocumentNodeStore to Caffeine and implements entry-owned 
> access and persistence-origin metadata. Every Document cache uses SYNC 
> maintenance in this step. Document-level ASYNC selection and its production 
> integration tests are delivered separately by 
> [OAK-12437|https://issues.apache.org/jira/browse/OAK-12437] on top of this 
> change.
> Preserve raw Cache<K,V> values, live map operations, weighing, statistics, 
> persistent serialization and the on-disk format. Remove the separate 
> value-retaining metadata map and its coordination protocol.



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

Reply via email to