HBASE-21203 TestZKMainServer#testCommandLineWorks won't pass with default 4lw whitelist
Recent versions of ZooKeeper whitelist the so-called 4-letter word admin commands, and 'stat' is not in the default whitelist. Set system property zookeeper.4lw.commands.whitelist=* in MiniZooKeeperCluster#setupTestEnv as we do not need to whitelist 4-letter commands for unit tests. Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/1e05c9f3 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/1e05c9f3 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/1e05c9f3 Branch: refs/heads/branch-2.1 Commit: 1e05c9f3b53e654707be35537c10b50e62294c1e Parents: 5a73a1a Author: Andrew Purtell <[email protected]> Authored: Mon Sep 17 14:49:31 2018 -0700 Committer: Andrew Purtell <[email protected]> Committed: Fri Sep 21 15:37:12 2018 -0700 ---------------------------------------------------------------------- .../org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java | 2 ++ 1 file changed, 2 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/1e05c9f3/hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java ---------------------------------------------------------------------- diff --git a/hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java b/hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java index b264563..730d0dd 100644 --- a/hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java +++ b/hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java @@ -176,6 +176,8 @@ public class MiniZooKeeperCluster { // set env and directly in order to handle static init/gc issues System.setProperty("zookeeper.preAllocSize", "100"); FileTxnLog.setPreallocSize(100 * 1024); + // allow all 4 letter words + System.setProperty("zookeeper.4lw.commands.whitelist","*"); } public int startup(File baseDir) throws IOException, InterruptedException {
