Skip to content
This repository has been archived by the owner on Mar 29, 2024. It is now read-only.

WIP: backport SOLR-15555, async caching #170

Open
wants to merge 5 commits into
base: release/8.8
Choose a base branch
from

Conversation

magibney
Copy link

See SOLR-15555.

This is not immediately/directly necessary, but it makes sense for any work on upstream caching to incorporate these changes first (to minimize potential for merge conflicts, etc.).

There is no rush to merge this -- it's mainly here to provide a stable base for other caching work, but it could benefit some use cases (and issues introduced locally by this, if any, would be encountered anyway soon enough with the next local solr version upgrade).

Create a new cache mode for CaffeineCache where we can optionally use an
async cache instead of the synchronous implementation. This is useful
for cases (esp FilterQuery) where many identical requests come in near
the same time and they would otherwise race to fill the same cache slot.

CaffeineCache computeIfAbsent now accepts an IOFunction instead of
the non-throwing java.util.Function interface.

This required an update to CaffeineCache 2.9, which updates putIfAbsent
with an optimistic get.

Also incidentally fixes a rare bug where cache ramBytesUsed would be
incorrectly reported under heavy cache contention/eviction loads.

Makes Async Caches the default.

(cherry picked from commit ac5df22)
@magibney magibney changed the title backport SOLR-15555, async caching WIP: backport SOLR-15555, async caching Jul 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants