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 2022/06/02 15:55:28 UTC

[hbase] branch master updated: HBASE-27046 The filenum in AbstractFSWAL should be monotone increasing (#4449)

This is an automated email from the ASF dual-hosted git repository.

zhangduo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/master by this push:
     new 313a37f7ac7 HBASE-27046 The filenum in AbstractFSWAL should be monotone increasing (#4449)
313a37f7ac7 is described below

commit 313a37f7ac780a36b51064372868a31849df6727
Author: Duo Zhang <zh...@apache.org>
AuthorDate: Thu Jun 2 23:55:23 2022 +0800

    HBASE-27046 The filenum in AbstractFSWAL should be monotone increasing (#4449)
    
    Signed-off-by: Xin Sun <dd...@gmail.com>
    Signed-off-by: GeorryHuang <hu...@apache.org>
---
 .../org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.java     | 6 +-----
 .../apache/hadoop/hbase/quotas/TestClusterScopeQuotaThrottle.java   | 2 --
 .../test/java/org/apache/hadoop/hbase/quotas/TestQuotaThrottle.java | 2 --
 3 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.java
index 2c0a656049c..18a4a98c81d 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.java
@@ -630,12 +630,8 @@ public abstract class AbstractFSWAL<W extends WriterBase> implements WAL {
    * retrieve the next path to use for writing. Increments the internal filenum.
    */
   private Path getNewPath() throws IOException {
-    this.filenum.set(EnvironmentEdgeManager.currentTime());
+    this.filenum.set(Math.max(getFilenum() + 1, EnvironmentEdgeManager.currentTime()));
     Path newPath = getCurrentFileName();
-    while (fs.exists(newPath)) {
-      this.filenum.incrementAndGet();
-      newPath = getCurrentFileName();
-    }
     return newPath;
   }
 
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestClusterScopeQuotaThrottle.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestClusterScopeQuotaThrottle.java
index fcc023aabea..8537d9001a7 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestClusterScopeQuotaThrottle.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestClusterScopeQuotaThrottle.java
@@ -43,11 +43,9 @@ import org.junit.After;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.ClassRule;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-@Ignore // disable for now, see HBASE-27045
 @Category({ RegionServerTests.class, LargeTests.class })
 public class TestClusterScopeQuotaThrottle {
 
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaThrottle.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaThrottle.java
index 9dc003cfa27..fdb219fe86c 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaThrottle.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaThrottle.java
@@ -44,13 +44,11 @@ import org.junit.After;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.ClassRule;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-@Ignore // Disabled because flakey. Fails ~30% on a resource constrained GCE though not on Apache.
 @Category({ RegionServerTests.class, MediumTests.class })
 public class TestQuotaThrottle {