You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by vj...@apache.org on 2020/04/25 12:18:57 UTC
[hbase] branch branch-1 updated: HBASE-24211: Create table is slow
in large cluster when AccessController is enabled. (#1577)
This is an automated email from the ASF dual-hosted git repository.
vjasani pushed a commit to branch branch-1
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-1 by this push:
new 9fc8263 HBASE-24211: Create table is slow in large cluster when AccessController is enabled. (#1577)
9fc8263 is described below
commit 9fc8263ca4500aa3f2be5947057a19ebbcafa1c9
Author: Mohammad Arshad <mo...@huawei.com>
AuthorDate: Sat Apr 25 17:48:47 2020 +0530
HBASE-24211: Create table is slow in large cluster when AccessController is enabled. (#1577)
Signed-off-by: Viraj Jasani <vj...@apache.org>
Signed-off-by: Pankaj <pa...@apache.org>
---
.../org/apache/hadoop/hbase/zookeeper/ZKUtil.java | 5 +++
.../hbase/security/access/ZKPermissionWatcher.java | 42 +++++++++++-----------
2 files changed, 27 insertions(+), 20 deletions(-)
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java
index 7d8d232..a291c27 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java
@@ -29,6 +29,7 @@ import java.net.Socket;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
import java.util.Deque;
import java.util.HashMap;
import java.util.Iterator;
@@ -801,6 +802,10 @@ public class ZKUtil {
if (nodes != null) {
List<NodeAndData> newNodes = new ArrayList<NodeAndData>();
for (String node : nodes) {
+ if (Thread.interrupted()) {
+ // Partial data should not be processed. Cancel processing by sending empty list.
+ return Collections.emptyList();
+ }
String nodePath = ZKUtil.joinZNode(baseNode, node);
byte[] data = ZKUtil.getDataAndWatch(zkw, nodePath);
newNodes.add(new NodeAndData(nodePath, data));
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 4c37b52..f148878 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
@@ -184,30 +184,32 @@ public class ZKPermissionWatcher extends ZooKeeperListener implements Closeable
public void nodeChildrenChanged(final String path) {
waitUntilStarted();
if (path.equals(aclZNode)) {
- try {
- final List<ZKUtil.NodeAndData> nodeList =
- ZKUtil.getChildDataAndWatchForNewChildren(watcher, aclZNode);
- // preempt any existing nodeChildrenChanged event processing
- if (childrenChangedFuture != null && !childrenChangedFuture.isDone()) {
- boolean cancelled = childrenChangedFuture.cancel(true);
- if (!cancelled) {
- // task may have finished between our check and attempted cancel, this is fine.
- if (! childrenChangedFuture.isDone()) {
- LOG.warn("Could not cancel processing node children changed event, " +
- "please file a JIRA and attach logs if possible.");
- }
+ // preempt any existing nodeChildrenChanged event processing
+ if (childrenChangedFuture != null && !childrenChangedFuture.isDone()) {
+ boolean cancelled = childrenChangedFuture.cancel(true);
+ if (!cancelled) {
+ // task may have finished between our check and attempted cancel, this is fine.
+ if (!childrenChangedFuture.isDone()) {
+ LOG.warn("Could not cancel processing node children changed event, "
+ + "please file a JIRA and attach logs if possible.");
}
}
- childrenChangedFuture = asyncProcessNodeUpdate(new Runnable() {
- @Override
- public void run() {
+ }
+
+ childrenChangedFuture = asyncProcessNodeUpdate(new Runnable() {
+ @Override public void run() {
+ try {
+ final List<ZKUtil.NodeAndData> nodeList =
+ ZKUtil.getChildDataAndWatchForNewChildren(watcher, aclZNode);
refreshNodes(nodeList);
+
+ } catch (KeeperException ke) {
+ String msg = "ZooKeeper error while reading node children data for path " + path;
+ LOG.error(msg, ke);
+ watcher.abort(msg, ke);
}
- });
- } catch (KeeperException ke) {
- LOG.error("Error reading data from zookeeper for path "+path, ke);
- watcher.abort("Zookeeper error get node children for path "+path, ke);
- }
+ }
+ });
}
}