HBASE-17091 IntegrationTestZKAndFSPermissions failed with 'KeeperException'

This commit is contained in:
Enis Soztutar 2016-11-15 13:09:25 -08:00
parent 8847a70902
commit d40a0c3bd8
1 changed files with 10 additions and 2 deletions

View File

@ -43,6 +43,7 @@ import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
import org.apache.hadoop.util.ToolRunner; import org.apache.hadoop.util.ToolRunner;
import org.apache.zookeeper.KeeperException; import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.KeeperException.Code; import org.apache.zookeeper.KeeperException.Code;
import org.apache.zookeeper.KeeperException.NoNodeException;
import org.apache.zookeeper.ZooDefs.Ids; import org.apache.zookeeper.ZooDefs.Ids;
import org.apache.zookeeper.ZooDefs.Perms; import org.apache.zookeeper.ZooDefs.Perms;
import org.apache.zookeeper.data.ACL; import org.apache.zookeeper.data.ACL;
@ -168,7 +169,7 @@ public class IntegrationTestZKAndFSPermissions extends AbstractHBaseTool {
} }
} catch (KeeperException ke) { } catch (KeeperException ke) {
// if we are not authenticated for listChildren, it is fine. // if we are not authenticated for listChildren, it is fine.
if (ke.code() != Code.NOAUTH) { if (ke.code() != Code.NOAUTH && ke.code() != Code.NONODE) {
throw ke; throw ke;
} }
} }
@ -177,7 +178,14 @@ public class IntegrationTestZKAndFSPermissions extends AbstractHBaseTool {
private void assertZnodePerms(RecoverableZooKeeper zk, String znode, private void assertZnodePerms(RecoverableZooKeeper zk, String znode,
boolean expectedWorldReadable) throws KeeperException, InterruptedException { boolean expectedWorldReadable) throws KeeperException, InterruptedException {
Stat stat = new Stat(); Stat stat = new Stat();
List<ACL> acls = zk.getZooKeeper().getACL(znode, stat); List<ACL> acls;
try {
acls = zk.getZooKeeper().getACL(znode, stat);
} catch (NoNodeException ex) {
LOG.debug("Caught exception for missing znode", ex);
// the znode is deleted. Probably it was a temporary znode (like RIT).
return;
}
String[] superUsers = superUser == null ? null : superUser.split(","); String[] superUsers = superUser == null ? null : superUser.split(",");
LOG.info("Checking ACLs for znode znode:" + znode + " acls:" + acls); LOG.info("Checking ACLs for znode znode:" + znode + " acls:" + acls);