From d2d8058ab35ec16e1f27a117aee8baa18e52a136 Mon Sep 17 00:00:00 2001 From: Yu Li Date: Sat, 19 Mar 2016 21:24:07 +0800 Subject: [PATCH] HBASE-15451 Remove unnecessary wait in MVCC --- .../hbase/regionserver/MultiVersionConcurrencyControl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MultiVersionConcurrencyControl.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MultiVersionConcurrencyControl.java index bf295e7d543..7424e4ebe5c 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MultiVersionConcurrencyControl.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MultiVersionConcurrencyControl.java @@ -145,8 +145,9 @@ public class MultiVersionConcurrencyControl { * of the passed in WriteEntry. Thus, the write is visible to MVCC readers. */ public void completeAndWait(WriteEntry e) { - complete(e); - waitForRead(e); + if (!complete(e)) { + waitForRead(e); + } } /**