You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zh...@apache.org on 2018/09/15 10:52:44 UTC

hbase git commit: HBASE-21097 Flush pressure assertion may fail in testFlushThroughputTuning

Repository: hbase
Updated Branches:
  refs/heads/master 38a697ad1 -> 9da20a411


HBASE-21097 Flush pressure assertion may fail in testFlushThroughputTuning

Amending-Author: Duo Zhang <zh...@apache.org>
Signed-off-by: Duo Zhang <zh...@apache.org>


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

Branch: refs/heads/master
Commit: 9da20a4116aea2a65b4579670718b0e94288e3ea
Parents: 38a697a
Author: Ted Yu <yu...@gmail.com>
Authored: Sat Sep 15 18:19:36 2018 +0800
Committer: zhangduo <zh...@apache.org>
Committed: Sat Sep 15 18:20:35 2018 +0800

----------------------------------------------------------------------
 .../throttle/TestFlushWithThroughputController.java          | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/9da20a41/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/throttle/TestFlushWithThroughputController.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/throttle/TestFlushWithThroughputController.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/throttle/TestFlushWithThroughputController.java
index 61f9cd4..7aaa153 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/throttle/TestFlushWithThroughputController.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/throttle/TestFlushWithThroughputController.java
@@ -177,12 +177,18 @@ public class TestFlushWithThroughputController {
       .build());
     hbtu.waitTableAvailable(tableName);
     HRegionServer regionServer = hbtu.getRSForFirstRegionInTable(tableName);
+    double pressure = regionServer.getFlushPressure();
+    LOG.debug("Flush pressure before flushing: " + pressure);
     PressureAwareFlushThroughputController throughputController =
         (PressureAwareFlushThroughputController) regionServer.getFlushThroughputController();
     for (HRegion region : regionServer.getRegions()) {
       region.flush(true);
     }
-    assertEquals(0.0, regionServer.getFlushPressure(), EPSILON);
+    // We used to assert that the flush pressure is zero but after HBASE-15787 or HBASE-18294 we
+    // changed to use heapSize instead of dataSize to calculate the flush pressure, and since
+    // heapSize will never be zero, so flush pressure will never be zero either. So we changed the
+    // assertion here.
+    assertTrue(regionServer.getFlushPressure() < pressure);
     Thread.sleep(5000);
     boolean tablesOnMaster = LoadBalancer.isTablesOnMaster(hbtu.getConfiguration());
     if (tablesOnMaster) {