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 16:25:56 UTC

[hbase] branch branch-2 updated (7a02cbfd7ee -> f97af48d30d)

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

zhangduo pushed a change to branch branch-2
in repository https://gitbox.apache.org/repos/asf/hbase.git


    from 7a02cbfd7ee HBASE-26962: Add mob info in web UI (#4359)
     new f61ac22f02e HBASE-26680 Close and do not write trailer for the broken WAL writer(addendum) (#4405)
     new f97af48d30d HBASE-27046 The filenum in AbstractFSWAL should be monotone increasing (#4449)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.java    | 6 +-----
 .../hadoop/hbase/regionserver/wal/AbstractProtobufLogWriter.java   | 7 ++++---
 .../hadoop/hbase/regionserver/wal/AsyncProtobufLogWriter.java      | 2 +-
 .../apache/hadoop/hbase/regionserver/wal/ProtobufLogWriter.java    | 2 +-
 .../apache/hadoop/hbase/quotas/TestClusterScopeQuotaThrottle.java  | 2 --
 .../java/org/apache/hadoop/hbase/quotas/TestQuotaThrottle.java     | 2 --
 6 files changed, 7 insertions(+), 14 deletions(-)


[hbase] 01/02: HBASE-26680 Close and do not write trailer for the broken WAL writer(addendum) (#4405)

Posted by zh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit f61ac22f02ebbff1d51412b1e17916523a3ded0c
Author: Xiaolin Ha <ha...@apache.org>
AuthorDate: Thu Jun 2 23:52:14 2022 +0800

    HBASE-26680 Close and do not write trailer for the broken WAL writer(addendum) (#4405)
    
    Signed-off-by: Duo Zhang <zh...@apache.org>
    (cherry picked from commit 80f410ec3fddf35f77b1e3f2b352110d296a2415)
---
 .../hadoop/hbase/regionserver/wal/AbstractProtobufLogWriter.java   | 7 ++++---
 .../hadoop/hbase/regionserver/wal/AsyncProtobufLogWriter.java      | 2 +-
 .../apache/hadoop/hbase/regionserver/wal/ProtobufLogWriter.java    | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractProtobufLogWriter.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractProtobufLogWriter.java
index 608032b8e4a..8437fef3bc2 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractProtobufLogWriter.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractProtobufLogWriter.java
@@ -199,7 +199,7 @@ public abstract class AbstractProtobufLogWriter {
       }
     } catch (Exception e) {
       LOG.warn("Init output failed, path={}", path, e);
-      closeOutput();
+      closeOutputIfNecessary();
       throw e;
     }
   }
@@ -269,9 +269,10 @@ public abstract class AbstractProtobufLogWriter {
     throws IOException, StreamLacksCapabilityException;
 
   /**
-   * simply close the output, do not need to write trailer like the Writer.close
+   * It is straight forward to close the output, do not need to write trailer like the Writer.close
    */
-  protected abstract void closeOutput();
+  protected void closeOutputIfNecessary() {
+  }
 
   /**
    * return the file length after written.
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AsyncProtobufLogWriter.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AsyncProtobufLogWriter.java
index 42d9a1f15f5..44affaf734a 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AsyncProtobufLogWriter.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AsyncProtobufLogWriter.java
@@ -195,7 +195,7 @@ public class AsyncProtobufLogWriter extends AbstractProtobufLogWriter
   }
 
   @Override
-  protected void closeOutput() {
+  protected void closeOutputIfNecessary() {
     if (this.output != null) {
       try {
         this.output.close();
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/ProtobufLogWriter.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/ProtobufLogWriter.java
index 7cc16360c3a..76a86d954aa 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/ProtobufLogWriter.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/ProtobufLogWriter.java
@@ -118,7 +118,7 @@ public class ProtobufLogWriter extends AbstractProtobufLogWriter implements FSHL
   }
 
   @Override
-  protected void closeOutput() {
+  protected void closeOutputIfNecessary() {
     if (this.output != null) {
       try {
         this.output.close();


[hbase] 02/02: HBASE-27046 The filenum in AbstractFSWAL should be monotone increasing (#4449)

Posted by zh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit f97af48d30da0f65728a36b234ccb0ac20b52869
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>
    (cherry picked from commit 313a37f7ac780a36b51064372868a31849df6727)
---
 .../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 7b5b31bc455..c1864592ae3 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
@@ -596,12 +596,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 2d952b2a212..a7661c81d04 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 30c7036b7b8..1c94bd5263d 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 {