You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by an...@apache.org on 2017/04/05 19:59:14 UTC

hbase git commit: HBASE-17227 Backported HBASE-17206 to branch-1.3

Repository: hbase
Updated Branches:
  refs/heads/branch-1.3 3a2f3aa88 -> eec476677


HBASE-17227 Backported HBASE-17206 to branch-1.3


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

Branch: refs/heads/branch-1.3
Commit: eec476677444922591903d0c255912e7c2f8d2f1
Parents: 3a2f3aa
Author: Jan Hentschel <ja...@ultratendency.com>
Authored: Tue Jan 3 12:26:42 2017 +0100
Committer: Mikhail Antonov <an...@apache.org>
Committed: Wed Apr 5 12:53:22 2017 -0700

----------------------------------------------------------------------
 .../hadoop/hbase/regionserver/wal/FSHLog.java   | 29 ++++++++++----------
 1 file changed, 15 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/eec47667/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java
index e52fb4f..7e1fb69 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java
@@ -1649,24 +1649,25 @@ public class FSHLog implements WAL {
      */
     private volatile CountDownLatch safePointReleasedLatch = new CountDownLatch(1);
 
+    private void checkIfSyncFailed(SyncFuture syncFuture) throws FailedSyncBeforeLogCloseException {
+      if (syncFuture.isThrowable()) {
+        throw new FailedSyncBeforeLogCloseException(syncFuture.getThrowable());
+      }
+    }
+
     /**
-     * For Thread A to call when it is ready to wait on the 'safe point' to be attained.
-     * Thread A will be held in here until Thread B calls {@link #safePointAttained()}
-     * @param syncFuture We need this as barometer on outstanding syncs.  If it comes home with
-     * an exception, then something is up w/ our syncing.
-     * @throws InterruptedException
-     * @throws ExecutionException
+     * For Thread A to call when it is ready to wait on the 'safe point' to be attained. Thread A
+     * will be held in here until Thread B calls {@link #safePointAttained()}
+     * @param syncFuture We need this as barometer on outstanding syncs.  If it comes home with an
+     *          exception, then something is up w/ our syncing.
      * @return The passed <code>syncFuture</code>
-     * @throws FailedSyncBeforeLogCloseException
      */
-    SyncFuture waitSafePoint(final SyncFuture syncFuture)
-    throws InterruptedException, FailedSyncBeforeLogCloseException {
-      while (true) {
-        if (this.safePointAttainedLatch.await(1, TimeUnit.NANOSECONDS)) break;
-        if (syncFuture.isThrowable()) {
-          throw new FailedSyncBeforeLogCloseException(syncFuture.getThrowable());
-        }
+    SyncFuture waitSafePoint(SyncFuture syncFuture) throws InterruptedException,
+        FailedSyncBeforeLogCloseException {
+      while (!this.safePointAttainedLatch.await(1, TimeUnit.MILLISECONDS)) {
+        checkIfSyncFailed(syncFuture);
       }
+      checkIfSyncFailed(syncFuture);
       return syncFuture;
     }