EHC ❯ Premature eviction notifications
-
Bug
-
Status: Resolved
-
2 Major
-
Resolution: Duplicate
-
-
-
alexsnaps
-
Reporter: alexsnaps
-
March 07, 2012
-
0
-
Watchers: 2
-
March 01, 2013
-
December 13, 2012
Description
The disk store, the authority when persistent, will notify eviction regardless whether the entry is still present in the FrontEndCacheTier’s cache. While this probably isn’t an issue for a cache under heavy access, it is one say for instance when populating the cache with more entries than the DiskStore should hold or when the limit of the disk is close to the memory store’s… In all cases we can’t guarantee that, on eviction notification’s callback, the following code never throws in a single threaded env. or one that never puts back an evicted entry “unsafely”:
public void notifyElementEvicted(Ehcache cache, Element element) {
Element o = cache.get(element.getKey());
if (element != null) {
new RuntimeException().printStackTrace();
}
}
Comments
Alexander Snaps 2012-03-07
Alexander Snaps 2012-03-07
I already had fixed that in the OffheapStore. This is all really ugly code and DEV-5996 is the real fix to all this. Will address it here as well in the meantime
Alexander Snaps 2012-12-13
This is being fixed by the Montreal design. The problem just goes away, as only the authority notifies now and will not evict things present higher
From http://forums.terracotta.org/forums/posts/list/6745.page