Repository: hbase
Updated Branches:
  refs/heads/branch-1.3 5e144fc01 -> 8653245e7


HBASE-15691 ConcurrentModificationException in BucketAllocator


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/8653245e
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/8653245e
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/8653245e

Branch: refs/heads/branch-1.3
Commit: 8653245e7d20610c616f114cc4eac30f8a8bcb48
Parents: 5e144fc
Author: Stephen Yuan Jiang <[email protected]>
Authored: Wed Jun 21 15:23:59 2017 -0700
Committer: Stephen Yuan Jiang <[email protected]>
Committed: Wed Jun 21 15:38:11 2017 -0700

----------------------------------------------------------------------
 .../apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.java   | 6 +++---
 .../org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java   | 2 ++
 2 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/8653245e/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.java
index 73197b9..a6c84d0 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketAllocator.java
@@ -188,7 +188,7 @@ public final class BucketAllocator {
       this.sizeIndex = sizeIndex;
     }
 
-    public void instantiateBucket(Bucket b) {
+    public synchronized void instantiateBucket(Bucket b) {
       assert b.isUninstantiated() || b.isCompletelyFree();
       b.reconfigure(sizeIndex, bucketSizes, bucketCapacity);
       bucketList.put(b, b);
@@ -240,7 +240,7 @@ public final class BucketAllocator {
       return b;
     }
 
-    private void removeBucket(Bucket b) {
+    private synchronized void removeBucket(Bucket b) {
       assert b.isCompletelyFree();
       bucketList.remove(b);
       freeBuckets.remove(b);
@@ -256,7 +256,7 @@ public final class BucketAllocator {
       if (b.isCompletelyFree()) completelyFreeBuckets.put(b, b);
     }
 
-    public IndexStatistics statistics() {
+    public synchronized IndexStatistics statistics() {
       long free = 0, used = 0;
       for (Object obj : bucketList.keySet()) {
         Bucket b = (Bucket) obj;

http://git-wip-us.apache.org/repos/asf/hbase/blob/8653245e/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java
index 9c075c6..7aabb5c 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java
@@ -754,6 +754,8 @@ public class BucketCache implements BlockCache, HeapSize {
         }
       }
 
+    } catch (Throwable t) {
+      LOG.warn("Failed freeing space", t);
     } finally {
       cacheStats.evict();
       freeInProgress = false;

Reply via email to