hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject [1/2] git commit: HBASE-11868 Data loss in hlog when the hdfs is unavailable (Liu Shaohui)
Date Wed, 03 Sep 2014 04:19:01 GMT
Repository: hbase
Updated Branches:
  refs/heads/0.98 590fc7f94 -> b53c0b1b1


HBASE-11868 Data loss in hlog when the hdfs is unavailable (Liu Shaohui)

Applied patch HBASE-11868-0.98-v2.diff


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

Branch: refs/heads/0.98
Commit: 39771b8f73a6e6eae12e8b3bdb7dd1fe13edc83c
Parents: 590fc7f
Author: Andrew Purtell <apurtell@apache.org>
Authored: Tue Sep 2 21:12:27 2014 -0700
Committer: Andrew Purtell <apurtell@apache.org>
Committed: Tue Sep 2 21:12:29 2014 -0700

----------------------------------------------------------------------
 .../apache/hadoop/hbase/regionserver/wal/FSHLog.java   | 13 ++++++-------
 .../apache/hadoop/hbase/regionserver/TestHRegion.java  |  1 +
 2 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/39771b8f/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 594002d..5b179a1 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
@@ -127,7 +127,7 @@ class FSHLog implements HLog, Syncable {
 
   // all writes pending on AsyncWriter/AsyncSyncer thread with
   // txid <= failedTxid will fail by throwing asyncIOE
-  private final AtomicLong failedTxid = new AtomicLong(0);
+  private final AtomicLong failedTxid = new AtomicLong(-1);
   private volatile IOException asyncIOE = null;
 
   private WALCoprocessorHost coprocessorHost;
@@ -1350,17 +1350,16 @@ class FSHLog implements HLog, Syncable {
       while (this.syncedTillHere.get() < txid) {
         try {
           this.syncedTillHere.wait();
-
-          if (txid <= this.failedTxid.get()) {
-            assert asyncIOE != null :
-              "current txid is among(under) failed txids, but asyncIOE is null!";
-            throw asyncIOE;
-          }
         } catch (InterruptedException e) {
           LOG.debug("interrupted while waiting for notification from AsyncNotifier");
         }
       }
     }
+    if (txid <= this.failedTxid.get()) {
+        assert asyncIOE != null :
+          "current txid is among(under) failed txids, but asyncIOE is null!";
+        throw asyncIOE;
+    }
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hbase/blob/39771b8f/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
index 013798c..08cc39f 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
@@ -3741,6 +3741,7 @@ public class TestHRegion {
   public void testgetHDFSBlocksDistribution() throws Exception {
     HBaseTestingUtility htu = new HBaseTestingUtility();
     final int DEFAULT_BLOCK_SIZE = 1024;
+    htu.getConfiguration().setLong("dfs.namenode.fs-limits.min-block-size", 0);
     htu.getConfiguration().setLong("dfs.block.size", DEFAULT_BLOCK_SIZE);
     htu.getConfiguration().setInt("dfs.replication", 2);
 


Mime
View raw message