hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject svn commit: r1579373 - /hbase/branches/0.98/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/MasterSnapshotVerifier.java
Date Wed, 19 Mar 2014 20:02:42 GMT
Author: tedyu
Date: Wed Mar 19 20:02:41 2014
New Revision: 1579373

URL: http://svn.apache.org/r1579373
Log:
HBASE-10786 If snapshot verification fails with 'Regions moved', the message should contain
the name of region causing the failure


Modified:
    hbase/branches/0.98/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/MasterSnapshotVerifier.java

Modified: hbase/branches/0.98/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/MasterSnapshotVerifier.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.98/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/MasterSnapshotVerifier.java?rev=1579373&r1=1579372&r2=1579373&view=diff
==============================================================================
--- hbase/branches/0.98/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/MasterSnapshotVerifier.java
(original)
+++ hbase/branches/0.98/hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/MasterSnapshotVerifier.java
Wed Mar 19 20:02:41 2014
@@ -156,24 +156,27 @@ public final class MasterSnapshotVerifie
       throw new CorruptedSnapshotException(msg);
     }
 
+    String errorMsg = "";
     if (snapshotRegions.size() != regions.size()) {
-      String msg = "Regions moved during the snapshot '" + 
+      errorMsg = "Regions moved during the snapshot '" + 
                    ClientSnapshotDescriptionUtils.toString(snapshot) + "'. expected=" +
-                   regions.size() + " snapshotted=" + snapshotRegions.size();
-      LOG.error(msg);
-      throw new CorruptedSnapshotException(msg);
+                   regions.size() + " snapshotted=" + snapshotRegions.size() + ".";
+      LOG.error(errorMsg);
     }
 
     for (HRegionInfo region : regions) {
       if (!snapshotRegions.contains(region.getEncodedName())) {
         // could happen due to a move or split race.
-        String msg = "No region directory found for region:" + region;
-        LOG.error(msg);
-        throw new CorruptedSnapshotException(msg, snapshot);
+        String mesg = " No snapshot region directory found for region:" + region;
+        if (errorMsg.isEmpty()) errorMsg = mesg;
+        LOG.error(mesg);
       }
 
       verifyRegion(fs, snapshotDir, region);
     }
+    if (!errorMsg.isEmpty()) {
+      throw new CorruptedSnapshotException(errorMsg);
+    }
   }
 
   /**



Mime
View raw message