hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r713488 - in /hadoop/hbase/trunk: ./ src/java/org/apache/hadoop/hbase/ src/java/org/apache/hadoop/hbase/master/ src/java/org/apache/hadoop/hbase/regionserver/
Date Wed, 12 Nov 2008 20:11:35 GMT
Author: jimk
Date: Wed Nov 12 12:11:31 2008
New Revision: 713488

URL: http://svn.apache.org/viewvc?rev=713488&view=rev
Log:
HBASE-602   HBase Crash when network card has a IPv6 address

Modified:
    hadoop/hbase/trunk/CHANGES.txt
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/HServerAddress.java
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/ProcessServerShutdown.java
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HLog.java
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=713488&r1=713487&r2=713488&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Wed Nov 12 12:11:31 2008
@@ -70,7 +70,8 @@
    HBASE-964, HBASE-678 provide for safe-mode without locking up HBase "waiting
                for root region"
    HBASE-990   NoSuchElementException in flushSomeRegions
-   
+   HBASE-602   HBase Crash when network card has a IPv6 address
+      
   IMPROVEMENTS
    HBASE-901   Add a limit to key length, check key and value length on client side
    HBASE-890   Alter table operation and also related changes in REST interface

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/HServerAddress.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/HServerAddress.java?rev=713488&r1=713487&r2=713488&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/HServerAddress.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/HServerAddress.java Wed Nov 12 12:11:31
2008
@@ -30,6 +30,7 @@
  * HServerAddress is a "label" for a HBase server that combines the host
  * name and port number.
  */
+@SuppressWarnings("unchecked")
 public class HServerAddress implements WritableComparable {
   private InetSocketAddress address;
   String stringValue;

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/ProcessServerShutdown.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/ProcessServerShutdown.java?rev=713488&r1=713487&r2=713488&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/ProcessServerShutdown.java
(original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/master/ProcessServerShutdown.java
Wed Nov 12 12:11:31 2008
@@ -77,13 +77,8 @@
     this.rootRegionServer = rootRegionServer;
     this.logSplit = false;
     this.rootRescanned = false;
-    StringBuilder dirName = new StringBuilder("log_");
-    dirName.append(deadServer.getBindAddress());
-    dirName.append("_");
-    dirName.append(serverInfo.getStartCode());
-    dirName.append("_");
-    dirName.append(deadServer.getPort());
-    this.oldLogDir = new Path(master.rootdir, dirName.toString());
+    this.oldLogDir =
+      new Path(master.rootdir, HLog.getHLogDirectoryName(serverInfo));
   }
 
   @Override
@@ -257,8 +252,11 @@
     }
 
     if (!rootAvailable()) {
-      // Get root region assigned now that log has been split
-      master.regionManager.reassignRootRegion();
+      if (rootRegionServer) {
+        // Get root region assigned now that log has been split and if the
+        // dead server was serving the root region
+        master.regionManager.reassignRootRegion();
+      }
       
       // Return true so that worker does not put this request back on the
       // toDoQueue.

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HLog.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HLog.java?rev=713488&r1=713487&r2=713488&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HLog.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HLog.java Wed Nov 12
12:11:31 2008
@@ -22,6 +22,8 @@
 import java.io.EOFException;
 import java.io.FileNotFoundException;
 import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
 import java.util.Collections;
 import java.util.Map;
 import java.util.SortedMap;
@@ -40,6 +42,7 @@
 import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.HRegionInfo;
+import org.apache.hadoop.hbase.HServerInfo;
 import org.apache.hadoop.hbase.HStoreKey;
 import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.RemoteExceptionHandler;
@@ -752,6 +755,28 @@
     LOG.info("log file splitting completed for " + srcDir.toString());
   }
 
+  /**
+   * Construct the HLog directory name
+   * 
+   * @param info HServerInfo for server
+   * @return the HLog directory name
+   */
+  public static String getHLogDirectoryName(HServerInfo info) {
+    StringBuilder dirName = new StringBuilder("log_");
+    try {
+      dirName.append(URLEncoder.encode(
+          info.getServerAddress().getBindAddress(), UTF8_ENCODING));
+    } catch (UnsupportedEncodingException e) {
+      LOG.error("Error encoding '" + info.getServerAddress().getBindAddress()
+          + "'", e);
+    }
+    dirName.append("_");
+    dirName.append(info.getStartCode());
+    dirName.append("_");
+    dirName.append(info.getServerAddress().getPort());
+    return dirName.toString();
+  }
+
   private static void usage() {
     System.err.println("Usage: java org.apache.hbase.HLog" +
         " {--dump <logfile>... | --split <logdir>...}");

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java?rev=713488&r1=713487&r2=713488&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java Wed
Nov 12 12:11:31 2008
@@ -585,10 +585,7 @@
   private HLog setupHLog() throws RegionServerRunningException,
     IOException {
     
-    Path logdir = new Path(rootDir, "log" + "_" + 
-        serverInfo.getServerAddress().getBindAddress() + "_" +
-        this.serverInfo.getStartCode() + "_" + 
-        this.serverInfo.getServerAddress().getPort());
+    Path logdir = new Path(rootDir, HLog.getHLogDirectoryName(serverInfo));
     if (LOG.isDebugEnabled()) {
       LOG.debug("Log dir " + logdir);
     }



Mime
View raw message