HBASE-8547. Fix java.lang.RuntimeException: Cached an already cached block (Addendum3 to remove assertion)
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1484032 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
aec1857b37
commit
2a5c92c084
|
@ -302,7 +302,6 @@ public class LruBlockCache implements BlockCache, HeapSize {
|
||||||
String msg = "Cached an already cached block: " + cacheKey + " cb:" + cb.getCacheKey();
|
String msg = "Cached an already cached block: " + cacheKey + " cb:" + cb.getCacheKey();
|
||||||
msg += ". This is harmless and can happen in rare cases (see HBASE-8547)";
|
msg += ". This is harmless and can happen in rare cases (see HBASE-8547)";
|
||||||
LOG.warn(msg);
|
LOG.warn(msg);
|
||||||
assert false : msg;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
cb = new CachedBlock(cacheKey, buf, count.incrementAndGet(), inMemory);
|
cb = new CachedBlock(cacheKey, buf, count.incrementAndGet(), inMemory);
|
||||||
|
|
|
@ -118,17 +118,6 @@ public class TestLruBlockCache {
|
||||||
assertEquals(buf.heapSize(), block.heapSize());
|
assertEquals(buf.heapSize(), block.heapSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Re-add same blocks and ensure nothing has changed
|
|
||||||
for (CachedItem block : blocks) {
|
|
||||||
try {
|
|
||||||
cache.cacheBlock(block.cacheKey, block);
|
|
||||||
assertTrue("Cache should not allow re-caching a block", false);
|
|
||||||
} catch(AssertionError re) {
|
|
||||||
// expected
|
|
||||||
assertTrue(re.getMessage().contains("Cached an already cached block"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Verify correctly calculated cache heap size
|
// Verify correctly calculated cache heap size
|
||||||
assertEquals(expectedCacheSize, cache.heapSize());
|
assertEquals(expectedCacheSize, cache.heapSize());
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue