Details
Description
In kerberos mode, Zookeeper accepts SASL authentication. The AuthFailed message indicates the client could not be authenticated, but it should proceed anyway, because only access to znodes that require SASL authentication will be denied and this client may never need to access them. Furthermore, AuthFailed is a valid event supported by Zookeeper, and following are valid Zookeeper events:
case 0: return KeeperState.Disconnected;
case 3: return KeeperState.SyncConnected;
case 4: return KeeperState.AuthFailed;
case 5: return KeeperState.ConnectedReadOnly;
case 6: return KeeperState.SaslAuthenticated;
case -112: return KeeperState.Expired;
Based on above, ZooKeeperWatcher should not throw exception for AuthFailed event as an invalid event. For this kind of event, Zookeeper already logs it as a warning and proceed with non-SASL connection.
hbase(main):006:0> list TABLE 14/01/23 17:26:11 ERROR zookeeper.ClientCnxn: Error while calling watcher java.lang.IllegalStateException: Received event is not valid: AuthFailed at org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.connectionEvent(ZooKeeperWatcher.java:410) at org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.process(ZooKeeperWatcher.java:319) at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:519) at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:495) BIMonitoring BIMonitoringSummary BIMonitoringSummary180 BIMonitoringSummary900 LogMetadata LogRecords Mtable t1 t2 9 row(s) in 0.4040 seconds => ["BIMonitoring", "BIMonitoringSummary", "BIMonitoringSummary180", "BIMonitoringSummary900", "LogMetadata", "LogRecords", "Mtable", "t1", "t2"]
the patch will be similar as HBase-8757