From 9f12ef07723c16fa4c9189847d035004beb40b70 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 Signed-off-by: Bharath Vissapragada --- .../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 5e86c883209..eb2cd60fd6e 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 @@ -2160,17 +2160,12 @@ public class HStore implements Store { @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.isDebugEnabled()) { - LOG.debug("Cannot split region due to reference files being there"); - } - 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.isTraceEnabled()) { + LOG.trace(String.format("Not splittable; has references: %s", this)); } + return result; } @Override