SOLR-10141: Upgrade to Caffeine 2.3.5 to fix issues with removal listener

This commit is contained in:
yonik 2017-02-17 12:50:30 -05:00
parent 907c43ce7a
commit 6804f36942
5 changed files with 7 additions and 4 deletions

View File

@ -23,7 +23,7 @@ com.fasterxml.jackson.core.version = 2.5.4
/com.fasterxml.jackson.core/jackson-databind = ${com.fasterxml.jackson.core.version}
/com.fasterxml.jackson.dataformat/jackson-dataformat-smile = ${com.fasterxml.jackson.core.version}
/com.github.ben-manes.caffeine/caffeine = 1.0.1
/com.github.ben-manes.caffeine/caffeine = 2.3.5
/com.google.guava/guava = 14.0.1

View File

@ -162,6 +162,9 @@ Bug Fixes
* SOLR-10121: Fix race conditions in HDFS BlockCache that can contribute to corruption in high
concurrency situations. (yonik)
* SOLR-10141: Upgrade to Caffeine 2.3.5 since v1.0.1 contributed to BlockCache corruption because the
removal listener was called more than once for some items and not at all for other items. (Ben Manes, yonik)
Optimizations
----------------------

View File

@ -75,8 +75,8 @@ public class BlockCache {
lockCounters[i] = new AtomicInteger();
}
RemovalListener<BlockCacheKey,BlockCacheLocation> listener =
notification -> releaseLocation(notification.getKey(), notification.getValue());
RemovalListener<BlockCacheKey,BlockCacheLocation> listener = (blockCacheKey, blockCacheLocation, removalCause) -> releaseLocation(blockCacheKey, blockCacheLocation);
cache = Caffeine.newBuilder()
.removalListener(listener)
.maximumSize(maxEntries)

View File

@ -1 +0,0 @@
eb95a1eb55cb02018b8e0bc1609ce569b455ea98

View File

@ -0,0 +1 @@
672d74bd3fb0611f671ea4bf65e278c8a5d4af3c