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>
This commit is contained in:
parent
08b5a4b2c6
commit
5490c558bc
|
@ -212,6 +212,9 @@ public class MasterProcedureScheduler extends AbstractProcedureScheduler {
|
||||||
}
|
}
|
||||||
|
|
||||||
final Procedure pollResult = rq.peek();
|
final Procedure pollResult = rq.peek();
|
||||||
|
if (pollResult == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
final boolean xlockReq = rq.requireExclusiveLock(pollResult);
|
final boolean xlockReq = rq.requireExclusiveLock(pollResult);
|
||||||
if (xlockReq && rq.getLockStatus().isLocked() && !rq.getLockStatus().hasLockAccess(pollResult)) {
|
if (xlockReq && rq.getLockStatus().isLocked() && !rq.getLockStatus().hasLockAccess(pollResult)) {
|
||||||
// someone is already holding the lock (e.g. shared lock). avoid a yield
|
// 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
|
// Table Locking Helpers
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
/**
|
||||||
|
* @param proc must not be null
|
||||||
|
*/
|
||||||
private static boolean requireTableExclusiveLock(TableProcedureInterface proc) {
|
private static boolean requireTableExclusiveLock(TableProcedureInterface proc) {
|
||||||
switch (proc.getTableOperationType()) {
|
switch (proc.getTableOperationType()) {
|
||||||
case CREATE:
|
case CREATE:
|
||||||
|
@ -1007,6 +1013,10 @@ public class MasterProcedureScheduler extends AbstractProcedureScheduler {
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
private static abstract class Queue<TKey extends Comparable<TKey>>
|
private static abstract class Queue<TKey extends Comparable<TKey>>
|
||||||
extends AvlLinkedNode<Queue<TKey>> {
|
extends AvlLinkedNode<Queue<TKey>> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param proc must not be null
|
||||||
|
*/
|
||||||
abstract boolean requireExclusiveLock(Procedure proc);
|
abstract boolean requireExclusiveLock(Procedure proc);
|
||||||
|
|
||||||
private final TKey key;
|
private final TKey key;
|
||||||
|
|
Loading…
Reference in New Issue