Revert "HBASE-24212: Create table is slow in large cluster when AccessController is enabled. (#1546)"

Wrong JIRA issue number and also breaks TestAccessController.testAccessControllerUserPermsRegexHandling

This reverts commit e6cc5eb2f0.
This commit is contained in:
Duo Zhang 2020-04-27 22:41:58 +08:00
parent 84f2e95dd5
commit 39a1bc53f8
2 changed files with 16 additions and 23 deletions

View File

@ -185,28 +185,25 @@ public class ZKPermissionWatcher extends ZKListener 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.");
LOG.warn("Could not cancel processing node children changed event, " +
"please file a JIRA and attach logs if possible.");
}
}
}
childrenChangedFuture = asyncProcessNodeUpdate(() -> {
try {
final List<ZKUtil.NodeAndData> nodeList =
ZKUtil.getChildDataAndWatchForNewChildren(watcher, aclZNode);
refreshNodes(nodeList);
childrenChangedFuture = asyncProcessNodeUpdate(() -> 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);
LOG.error("Error reading data from zookeeper for path "+path, ke);
watcher.abort("ZooKeeper error get node children for path "+path, ke);
}
});
}
}

View File

@ -742,10 +742,6 @@ public final class ZKUtil {
if (nodes != null) {
List<NodeAndData> newNodes = new ArrayList<>();
for (String node : nodes) {
if (Thread.interrupted()) {
// Partial data should not be processed. Cancel processing by sending empty list.
return Collections.emptyList();
}
String nodePath = ZNodePaths.joinZNode(baseNode, node);
byte[] data = ZKUtil.getDataAndWatch(zkw, nodePath);
newNodes.add(new NodeAndData(nodePath, data));