hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mbau...@apache.org
Subject svn commit: r1379539 - in /hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase: HConstants.java regionserver/HRegionServer.java
Date Fri, 31 Aug 2012 18:29:05 GMT
Author: mbautin
Date: Fri Aug 31 18:29:05 2012
New Revision: 1379539

URL: http://svn.apache.org/viewvc?rev=1379539&view=rev
Log:
[0.89-fb] [HBASE-6680] Allow multiple SplitLogWorkers per RS

Author: aaiyer

Summary:
Currently SplitLogs is the slowest part of the pipeline in
processing dead servers. Based on rough back of envelop calculations,
  for rack switch reboot, it takes about 2-3 rounds of log assignments ( 20 *
      8 logs / (80 - delta) remaining servers) to get through this phase.

  One low hanging fruit is to increase the #threads for split logs in each RS.
  Setting the default to 3, because 2 may be cutting it too close.

Test Plan:
run MR tests.
  - only failure (TestMasterTransitions) fails on master as well.

  push to dev cluster. kil one RS. Check master logs for split log messages.
     output shows multiple threads per RS working in parallel to grab and process logs.

Reviewers: kannan, kranganathan, avf

Reviewed By: kannan

CC: hbase-eng@

Differential Revision: https://phabricator.fb.com/D560200

Task ID: 1417129

Modified:
    hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/HConstants.java
    hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java

Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/HConstants.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/HConstants.java?rev=1379539&r1=1379538&r2=1379539&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/HConstants.java (original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/HConstants.java Fri Aug 31
18:29:05 2012
@@ -256,6 +256,13 @@ public final class HConstants {
    */
   public static final int DEFAULT_HREGION_OPEN_AND_CLOSE_THREADS_MAX = 8;
 
+  /**
+   * The max number of threads used for splitting logs
+   * in parallel
+   */
+  public static final String HREGIONSERVER_SPLITLOG_WORKERS_NUM =
+    "hbase.hregionserver.hlog.split.workers.num";
+
   /** Default maximum file size */
   public static final long DEFAULT_MAX_FILE_SIZE = 256 * 1024 * 1024;
 

Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java?rev=1379539&r1=1379538&r2=1379539&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
(original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
Fri Aug 31 18:29:05 2012
@@ -291,7 +291,7 @@ public class HRegionServer implements HR
   private final ExecutorService regionOpenCloseThreadPool;
   
   // Log Splitting Worker
-  private SplitLogWorker splitLogWorker;
+  private List<SplitLogWorker> splitLogWorkers;
 
   // A sleeper that sleeps for msgInterval.
   private final Sleeper sleeper;
@@ -766,8 +766,10 @@ public class HRegionServer implements HR
     if (this.server != null) {
       this.server.stop();
     }
-    if (this.splitLogWorker != null) {
-      splitLogWorker.stop();
+    if (this.splitLogWorkers != null) {
+      for(SplitLogWorker splitLogWorker: splitLogWorkers) {
+        splitLogWorker.stop();
+      }
     }
     if (this.infoServer != null) {
       LOG.info("Stopping infoServer");
@@ -1483,11 +1485,16 @@ public class HRegionServer implements HR
     }
     this.server.start();
     isRpcServerRunning = true;
+    int numSplitLogWorkers = conf.getInt(HConstants.HREGIONSERVER_SPLITLOG_WORKERS_NUM, 3);
     // Create the log splitting worker and start it
-    this.splitLogWorker = new SplitLogWorker(this.zooKeeperWrapper,
-        this.getConfiguration(), this.serverInfo.getServerName(),
-        logCloseThreadPool, masterRef);
-    splitLogWorker.start();
+    this.splitLogWorkers = new ArrayList<SplitLogWorker>(numSplitLogWorkers);
+    for (int i = 0; i < numSplitLogWorkers; i++) {
+      SplitLogWorker splitLogWorker = new SplitLogWorker(this.zooKeeperWrapper,
+          this.getConfiguration(), this.serverInfo.getServerName() + "_Worker_" + i,
+          logCloseThreadPool, masterRef);
+      this.splitLogWorkers.add(splitLogWorker);
+      splitLogWorker.start();
+    }
     LOG.info("HRegionServer started at: " +
       this.serverInfo.getServerAddress().toString());
   }



Mime
View raw message