HBASE-22503 Failed to upgrade to 2.2+ as the global permission which storaged in zk is not right

This commit is contained in:
Guanghao 2019-05-31 09:10:52 +08:00 committed by GitHub
parent 98a1552687
commit 0fcd7cae55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -169,7 +169,13 @@ public final class AuthManager {
globalCache.clear();
for (String name : globalPerms.keySet()) {
for (Permission permission : globalPerms.get(name)) {
globalCache.put(name, (GlobalPermission) permission);
// Before 2.2, the global permission which storage in zk is not right. It was saved as a
// table permission. So here need to handle this for compatibility. See HBASE-22503.
if (permission instanceof TablePermission) {
globalCache.put(name, new GlobalPermission(permission.getActions()));
} else {
globalCache.put(name, (GlobalPermission) permission);
}
}
}
mtime.incrementAndGet();