From 29c59c0ba82e1c70b00886f916a995d323887ef6 Mon Sep 17 00:00:00 2001 From: Zheng Wang <18031031@qq.com> Date: Sun, 24 May 2020 20:10:17 +0800 Subject: [PATCH] HBASE-24423 No need to get lock in canSplit because hasReferences will get lock too --- .../apache/hadoop/hbase/regionserver/HStore.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java index d5d8d433d8b..eee6118fab9 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java @@ -2061,17 +2061,12 @@ public class HStore implements Store, HeapSize, StoreConfigInformation, @Override public boolean canSplit() { - this.lock.readLock().lock(); - try { - // Not split-able if we find a reference store file present in the store. - boolean result = !hasReferences(); - if (!result) { - LOG.trace("Not splittable; has references: {}", this); - } - return result; - } finally { - this.lock.readLock().unlock(); + // Not split-able if we find a reference store file present in the store. + boolean result = !hasReferences(); + if (!result) { + LOG.trace("Not splittable; has references: {}", this); } + return result; } /**