hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject hbase git commit: HBASE-18109: Assign system tables first This issue adds comments and a sort so system tables are queued first (which will ensure they go out first). This should be good enough along w/ existing scheduling mechanisms to ensure system/met
Date Thu, 08 Jun 2017 20:26:20 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 72cb7d97c -> 112bff4ba


HBASE-18109: Assign system tables first
This issue adds comments and a sort so system tables are queued first
(which will ensure they go out first). This should be good enough
along w/ existing scheduling mechanisms to ensure system/meta get
assigned first.

Signed-off-by: Michael Stack <stack@apache.org>


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

Branch: refs/heads/master
Commit: 112bff4ba038634b5a2c3fd35c5ee3ee8a097886
Parents: 72cb7d9
Author: Yi Liang <yliang@us.ibm.com>
Authored: Wed Jun 7 12:37:41 2017 -0700
Committer: Michael Stack <stack@apache.org>
Committed: Thu Jun 8 13:24:28 2017 -0700

----------------------------------------------------------------------
 .../hadoop/hbase/client/TableDescriptor.java    |  3 +++
 .../master/assignment/AssignmentManager.java    | 23 +++++++++++++++++++-
 .../procedure/MasterProcedureScheduler.java     |  4 +++-
 .../master/procedure/ServerCrashProcedure.java  |  5 +++--
 4 files changed, 31 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/112bff4b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/TableDescriptor.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/TableDescriptor.java
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/TableDescriptor.java
index fb78256..33e896c 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/TableDescriptor.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/TableDescriptor.java
@@ -161,6 +161,9 @@ public interface TableDescriptor {
    */
   long getMemStoreFlushSize();
 
+  // TODO: Currently this is used RPC scheduling only. Make it more generic than this; allow
it
+  // to also be priority when scheduling procedures that pertain to this table scheduling
first
+  // those tables with the highest priority (From Yi Liang over on HBASE-18109).
   int getPriority();
 
   /**

http://git-wip-us.apache.org/repos/asf/hbase/blob/112bff4b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/AssignmentManager.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/AssignmentManager.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/AssignmentManager.java
index c10111f..a7fb743 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/AssignmentManager.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/AssignmentManager.java
@@ -1169,7 +1169,7 @@ public class AssignmentManager implements ServerListener {
 
     // assign offline regions
     st = System.currentTimeMillis();
-    for (HRegionInfo regionInfo: regionsToAssign) {
+    for (HRegionInfo regionInfo: getOrderedRegions(regionsToAssign)) {
       master.getMasterProcedureExecutor().submitProcedure(
         createAssignProcedure(regionInfo, false));
     }
@@ -1277,6 +1277,27 @@ public class AssignmentManager implements ServerListener {
     return new Pair<Integer, Integer>(ritCount, states.size());
   }
 
+  /**
+   * Used when assign regions, this method will put system regions in
+   * front of user regions
+   * @param regions
+   * @return A list of regions with system regions at front
+   */
+  public List<HRegionInfo> getOrderedRegions(
+      final List<HRegionInfo> regions) {
+    if (regions == null) return Collections.emptyList();
+
+    List<HRegionInfo> systemList = new ArrayList<>();
+    List<HRegionInfo> userList = new ArrayList<>();
+    for (HRegionInfo hri : regions) {
+      if (hri.isSystemTable()) systemList.add(hri);
+      else userList.add(hri);
+    }
+    // Append userList to systemList
+    systemList.addAll(userList);
+    return systemList;
+  }
+
   // ============================================================================================
   //  TODO: Region State In Transition
   // ============================================================================================

http://git-wip-us.apache.org/repos/asf/hbase/blob/112bff4b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/MasterProcedureScheduler.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/MasterProcedureScheduler.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/MasterProcedureScheduler.java
index 1410748..575fa80 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/MasterProcedureScheduler.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/MasterProcedureScheduler.java
@@ -121,7 +121,9 @@ public class MasterProcedureScheduler extends AbstractProcedureScheduler
{
   /**
    * Table priority is used when scheduling procedures from {@link #tableRunQueue}. A TableQueue
    * with priority 2 will get its procedures scheduled at twice the rate as compared to
-   * TableQueue with priority 1.
+   * TableQueue with priority 1. This should be enough to ensure system/meta get assigned
out
+   * before user-space tables. HBASE-18109 is where we conclude what is here is good enough.
+   * Lets open new issue if we find it not enough.
    */
   private static class TablePriorities {
     final int metaTablePriority;

http://git-wip-us.apache.org/repos/asf/hbase/blob/112bff4b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/ServerCrashProcedure.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/ServerCrashProcedure.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/ServerCrashProcedure.java
index e0f0dbe..c6cd861 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/ServerCrashProcedure.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/ServerCrashProcedure.java
@@ -186,8 +186,9 @@ implements ServerProcedureInterface {
               "; cycles=" + this.cycles);
           }
           handleRIT(env, regionsOnCrashedServer);
-          addChildProcedure(env.getAssignmentManager().
-              createAssignProcedures(regionsOnCrashedServer, true));
+          AssignmentManager am = env.getAssignmentManager();
+          addChildProcedure(am.
+              createAssignProcedures(am.getOrderedRegions(regionsOnCrashedServer), true));
         }
         setNextState(ServerCrashState.SERVER_CRASH_FINISH);
         break;


Mime
View raw message