hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bus...@apache.org
Subject hbase git commit: HBASE-18475 ensure only non-null procedures are sent to requireTableExclusiveLock
Date Mon, 31 Jul 2017 16:06:22 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 4d9982f33 -> 331a6cfac


HBASE-18475 ensure only non-null procedures are sent to requireTableExclusiveLock

Signed-off-by: Umesh Agashe <uagashe@cloudera.com>
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/331a6cfa
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/331a6cfa
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/331a6cfa

Branch: refs/heads/master
Commit: 331a6cface11c4a9706e4a4a9bf07e7f1bc07a1d
Parents: 4d9982f
Author: Sean Busbey <busbey@apache.org>
Authored: Fri Jul 28 16:04:45 2017 -0500
Committer: Sean Busbey <busbey@apache.org>
Committed: Mon Jul 31 11:05:16 2017 -0500

----------------------------------------------------------------------
 .../hbase/master/procedure/MasterProcedureScheduler.java  | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/331a6cfa/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 10e6aa0..564b86d 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
@@ -212,6 +212,9 @@ public class MasterProcedureScheduler extends AbstractProcedureScheduler
{
     }
 
     final Procedure pollResult = rq.peek();
+    if (pollResult == null) {
+      return null;
+    }
     final boolean xlockReq = rq.requireExclusiveLock(pollResult);
     if (xlockReq && rq.getLockStatus().isLocked() && !rq.getLockStatus().hasLockAccess(pollResult))
{
       // someone is already holding the lock (e.g. shared lock). avoid a yield
@@ -586,6 +589,9 @@ public class MasterProcedureScheduler extends AbstractProcedureScheduler
{
   // ============================================================================
   //  Table Locking Helpers
   // ============================================================================
+  /**
+   * @param proc must not be null
+   */
   private static boolean requireTableExclusiveLock(TableProcedureInterface proc) {
     switch (proc.getTableOperationType()) {
       case CREATE:
@@ -1007,6 +1013,10 @@ public class MasterProcedureScheduler extends AbstractProcedureScheduler
{
   // ============================================================================
   private static abstract class Queue<TKey extends Comparable<TKey>>
       extends AvlLinkedNode<Queue<TKey>> {
+
+    /**
+     * @param proc must not be null
+     */
     abstract boolean requireExclusiveLock(Procedure proc);
 
     private final TKey key;


Mime
View raw message