diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java index 9bd7daf283f..3704dd07965 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java @@ -926,6 +926,7 @@ public class AccessController extends BaseMasterAndRegionObserver return null; } }); + this.authManager.getZKPermissionWatcher().deleteTableACLNode(tableName); } @Override diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/ZKPermissionWatcher.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/ZKPermissionWatcher.java index 0265e82dd4f..53de50fa539 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/ZKPermissionWatcher.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/ZKPermissionWatcher.java @@ -193,4 +193,22 @@ public class ZKPermissionWatcher extends ZooKeeperListener { watcher.abort("Failed writing node "+zkNode+" to zookeeper", e); } } + + /*** + * Delete the acl notify node of table + * @param tableName + */ + public void deleteTableACLNode(final TableName tableName) { + String zkNode = ZKUtil.joinZNode(watcher.baseZNode, ACL_NODE); + zkNode = ZKUtil.joinZNode(zkNode, tableName.getNameAsString()); + + try { + ZKUtil.deleteNode(watcher, zkNode); + } catch (KeeperException.NoNodeException e) { + LOG.warn("No acl notify node of table '" + tableName + "'"); + } catch (KeeperException e) { + LOG.error("Failed deleting acl node of table '" + tableName + "'", e); + watcher.abort("Failed deleting node " + zkNode, e); + } + } }