[
https://issues.apache.org/jira/browse/OAK-12437?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Rishabh Daim updated OAK-12437:
-------------------------------
Description:
h3. Summary
Add optional per-cache asynchronous Caffeine maintenance together with
entry-owned persistent-cache metadata. Gate the complete ASYNC implementation
behind disabled-by-default FT_OAK-12437.
h3. Scope
Build on OAK-12425's minimal FT-gated Caffeine SYNC migration. Caffeine must
also be enabled. When FT_OAK-12437 is off, even explicit ASYNC requests use the
exact OAK-12425 SYNC cache/wrapper/metadata path. When enabled, only explicitly
selected CacheTypes use ASYNC; unconfigured caches remain SYNC. Standalone
ASYNC requires both -Doak.documentMK.caffeineCache=true and
-Doak.documentMK.asyncCacheMaintenance=true.
Only persistent caches actually selected as ASYNC use entry-owned access count,
persistence-origin, retirement and invalidation-generation metadata, live
raw-value adapters, per-key mutation coordination and guarded persistence
writes. Preserve the original NodeCache and CacheMetadata for SYNC and
CacheLIRS. FT-off operation must not add ASYNC entry overhead or use the new
wrapper and guarded-write protocol. Keep the persisted value format unchanged.
A builder snapshots feature selection once. Existing caches retain their
implementation and mode. Recreate the builder and DocumentNodeStore after
changing either feature; preserve desired toggle state across service
stop/start. Segment Tar remains independent.
h3. Acceptance Criteria
* Default FT-off behavior is the parent SYNC behavior, including wrapper
identity, raw map behavior and exact custom weights.
* ASYNC requires the Caffeine FT, the ASYNC FT and explicit per-cache selection
together.
* Caffeine-off ASYNC requests retain CacheLIRS and resolve to SYNC.
* Entry metadata follows the exact cache entry; delayed callbacks cannot
consume replacement metadata or persist invalidated/stale entries.
* Async-only loading and guarded-write changes cannot affect the legacy/SYNC
path.
* Tests cover all feature/mode combinations, toggle transitions/restart, actual
callback threads, production persistent caches, raw map mutations and delayed
persistence ordering. Existing legacy persistence tests continue passing
unchanged.
* [PR #3190|https://github.com/apache/jackrabbit-oak/pull/3190] directly
depends on [PR #3176|https://github.com/apache/jackrabbit-oak/pull/3176].
OAK-12426 / PR #3174 compares the legacy-metadata SYNC path against the
entry-metadata ASYNC path and must rerun measurements after this rescope.
was:
h3. Summary
Add an explicit, per-CacheType ASYNC maintenance opt-in for oak-store-document
Caffeine caches, guarded by a disabled-by-default feature toggle.
h3. Scope
Build directly on OAK-12425, which migrates DocumentNodeStore caches to
Caffeine with SYNC maintenance and entry-owned persistent-cache metadata.
Restore the builder-level per-cache maintenance override in this follow-up.
Register bundle-local FT_OAK-12437 from oak-store-document. The FT is disabled
by default. When disabled, every newly constructed Document cache must use SYNC
even if its builder requests ASYNC. When enabled, only explicitly configured
cache types use ASYNC; all others remain SYNC. Caffeine fixes a cache's
maintenance policy at construction, so recreate the DocumentNodeStore after
changing the FT for the new state to apply to all caches. Segment Tar's
separate FT_OAK-12290 remains local to its own bundle and caches.
h3. Acceptance Criteria
* FT_OAK-12437 is registered disabled by default and removed when the
DocumentNodeStore service deactivates.
* With the FT disabled, explicit ASYNC configuration for any Document cache
still constructs SYNC maintenance.
* With the FT enabled, explicitly selected cache types use ASYNC and
unconfigured types use SYNC.
* Tests verify callback execution mode, independent cache selection,
concurrency behavior, persistence behavior, and FT lifecycle.
* Existing default behavior remains SYNC; no Document cache uses ASYNC unless
both the FT is enabled and that cache is explicitly selected.
* This work is a follow-up PR directly based on OAK-12425 and precedes the
OAK-12426 benchmark PR.
Summary: Opt into Document Caffeine ASYNC maintenance with entry-owned
metadata (was: Enable per-cache asynchronous maintenance in oak-store-document)
> Opt into Document Caffeine ASYNC maintenance with entry-owned metadata
> ----------------------------------------------------------------------
>
> Key: OAK-12437
> URL: https://issues.apache.org/jira/browse/OAK-12437
> Project: Jackrabbit Oak
> Issue Type: Task
> Reporter: Rishabh Daim
> Priority: Major
>
> h3. Summary
> Add optional per-cache asynchronous Caffeine maintenance together with
> entry-owned persistent-cache metadata. Gate the complete ASYNC implementation
> behind disabled-by-default FT_OAK-12437.
> h3. Scope
> Build on OAK-12425's minimal FT-gated Caffeine SYNC migration. Caffeine must
> also be enabled. When FT_OAK-12437 is off, even explicit ASYNC requests use
> the exact OAK-12425 SYNC cache/wrapper/metadata path. When enabled, only
> explicitly selected CacheTypes use ASYNC; unconfigured caches remain SYNC.
> Standalone ASYNC requires both -Doak.documentMK.caffeineCache=true and
> -Doak.documentMK.asyncCacheMaintenance=true.
> Only persistent caches actually selected as ASYNC use entry-owned access
> count, persistence-origin, retirement and invalidation-generation metadata,
> live raw-value adapters, per-key mutation coordination and guarded
> persistence writes. Preserve the original NodeCache and CacheMetadata for
> SYNC and CacheLIRS. FT-off operation must not add ASYNC entry overhead or use
> the new wrapper and guarded-write protocol. Keep the persisted value format
> unchanged.
> A builder snapshots feature selection once. Existing caches retain their
> implementation and mode. Recreate the builder and DocumentNodeStore after
> changing either feature; preserve desired toggle state across service
> stop/start. Segment Tar remains independent.
> h3. Acceptance Criteria
> * Default FT-off behavior is the parent SYNC behavior, including wrapper
> identity, raw map behavior and exact custom weights.
> * ASYNC requires the Caffeine FT, the ASYNC FT and explicit per-cache
> selection together.
> * Caffeine-off ASYNC requests retain CacheLIRS and resolve to SYNC.
> * Entry metadata follows the exact cache entry; delayed callbacks cannot
> consume replacement metadata or persist invalidated/stale entries.
> * Async-only loading and guarded-write changes cannot affect the legacy/SYNC
> path.
> * Tests cover all feature/mode combinations, toggle transitions/restart,
> actual callback threads, production persistent caches, raw map mutations and
> delayed persistence ordering. Existing legacy persistence tests continue
> passing unchanged.
> * [PR #3190|https://github.com/apache/jackrabbit-oak/pull/3190] directly
> depends on [PR #3176|https://github.com/apache/jackrabbit-oak/pull/3176].
> OAK-12426 / PR #3174 compares the legacy-metadata SYNC path against the
> entry-metadata ASYNC path and must rerun measurements after this rescope.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)