-
Type:
Bug
-
Status: CLOSED
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 2.9.x
-
Component/s: Kernel
-
Labels:
-
10 status:Resolved
-
Previous Issue Keys:KNL-1162
Goal here is to remove direct bindings to Ehcache from the code so that other caching mechanisms can be swapped around under the covers. This means:
- Remove all ehcache defs from spring configs
- Remove ehcachemanager from central spring config
- Move Ehcache based impl so it is not always deployed and can be replaced (it will remain the default implementation for now though)
- Ensure all caches can be controlled via Sakai properties settings (since that will be the only way)
NOTES:
BasicMemoryService currently uses Ehcache directly.
This is a ticket to rewrite Sakai's MemoryService to allow pluggable caching implementations.
Maybe we change our MemoryService to use JCache (JSR 107) and then single nodes can use ehcache-jcache and clusters can use hazelcast-jcache?
We want to get this done before Sakai 10
MULTIREFCACHE:
The multiref cache is meant to be a way to automatically handle the case where there is a cache full of entries which are linked to another single cache entry that contains a set of cache keys. When one of the single entries expires then it should also expire the linked set or vice versa. The way this is implemented, the set of keys are stored in the cache object on each server so it is not cluster safe and should no longer be used. I have deprecated it to make this clear.
It still works the way it used to but it should simply be rewritten to handle this special case using 2 caches.
Used in BaseAliasService.java and SakaiSecurity.java
See KNL-1230 for removing this
CACHE LOADER (CacheRefresher):
This is simply a cache miss loader (also known as a blocking cache listener or cache warmer). This defines a kind of listener method which will be called whenever a cache miss occurs. In other words, if the cache is asked to retrieve an object by a key which does not exist in the cache then this method will be called if defined for that cache. Then the returned value will be returned from the lookup (or a null if no new value was found) and
also inserted into the cache (unless the value was null).
Similar to https://github.com/jsr107/jsr107spec/blob/master/src/main/java/javax/cache/integration/CacheLoader.java from the JSR-107 specification.
See KNL-1226 but this functionality is broken in Sakai trunk and 2.9 (at least)
PATTERN CACHE:
The caching pattern (which is optionally configured when a cache is created) was meant to be a way to automatically remove entries in a cache when a change event occurs which matches the start of the pattern. In practice, this means the ref from the Event is checked against the pattern and if the ref startsWith the same chars then the cache entry that has a key matching that Event ref will be removed from the cache.
This is probably better handled in each service using the cache (and in some cases it is also handled in the service). For now, I am marking the pattern as deprecated but keeping the functionality in place.
See KNL-1229 for removing this
CACHE LISTENERS:
The existing MemCache impl (DerivedCache is the listener API) uses Observers (which are local to one server) to notify the cache listeners that something has changed. This won't work across a cluster. The way the DerivedCache API works it only knows about put (add but not update) and remove and clear events (so no info about expires) and ONLY on the current server.
I am going to leave the current stuff in place in the MemCache but then rewrite the Ehcache based one to only use the supported events that it understands.
I removed the DerivedCache (and all uses of it) because it does NOT align with the actions in the JSR-107 cache listeners notifications. I have added in a new JSR-107 derived interface called CacheEventListener to replace it.
JSR-107 CACHE LISTENER NOTES:
JSR-107 deals with CacheEntryEvent.
CacheEntryEvent(Cache source, EventType eventType) - sometimes has oldValue
METHODS:
void onCreated(Iterable<CacheEntryEvent<? extends K, ? extends V>> events)
void onExpired(Iterable<CacheEntryEvent<? extends K, ? extends V>> events)
void onRemoved(Iterable<CacheEntryEvent<? extends K, ? extends V>> events)
void onUpdated(Iterable<CacheEntryEvent<? extends K, ? extends V>> events)
- depends on
-
SAK-38781 CacheRefresher no longer working for any cases (though it could work for MRC)
-
- CLOSED
-
-
SAK-39355 Sakai getAll caching is dangerous and cannot be supported by the Java cache standard (JSR-107)
-
- CLOSED
-
-
SAK-39033 ResourceLoader structure unhelpful in debugging and unit tests
-
- CLOSED
-
-
SAK-39418 Option to send and retrieve events (via cluster mechanism) without going to the database
-
- CLOSED
-
- is depended on by
-
SAK-38505 Cache APIs do not support atomic actions from JSR-107
-
- Awaiting Review
-
-
SAK-26088 Cannot log in to trunk as admin
-
- CLOSED
-
-
SAK-38594 circular dependency between old memory service, ETS, UDS causes NPE on startup
-
- CLOSED
-
-
SAK-26107 Remove all ehcache specific beans from Sakai core
-
- CLOSED
-
-
SAK-38666 Remove all ehcache specific beans from Sakai kernel
-
- CLOSED
-
-
SAK-39219 Cache APIs do not support bulk operations from JSR-107
-
- CLOSED
-
-
SAK-39679 Remove legacy caching code and options from trunk (Sakai 11+) before release
-
- RESOLVED
-
-
SAK-25488 Expose cache statistics via REST (EntityBroker)
-
- OPEN
-
-
SAK-39395 Implement hazelcast caching
-
- In Progress
-
- is related to
-
SAK-38592 ConcurrentModificationException in BaseSitePage with memory.use.legacy=false
-
- RESOLVED
-
-
RPLAY-9 Update to build with Sakai 10
-
- RESOLVED
-
-
SAK-38687 Cache invalidation not working correctly with EhcacheMemoryService
-
- CLOSED
-
-
SAK-26160 Tool permission changes are not reflected/activated immediately
-
- CLOSED
-
-
SAK-39418 Option to send and retrieve events (via cluster mechanism) without going to the database
-
- CLOSED
-
-
SAK-39467 Switch distributed caching from DB based to Network based and make it use standard technologies
-
- CLOSED
-
- relates to
-
SAK-39351 Remove deprecated method from MemoryService
-
- OPEN
-
-
SAK-38861 Remove deprecated use of MultiRefCache
-
- CLOSED
-
-
SAK-39097 Remove deprecated "pattern" cache update event handling
-
- CLOSED
-
-
SAK-39150 SiteCacheImpl is incompatible with distributed/JSR-107 caching
-
- CLOSED
-
- mentioned in
-
Page Loading...