HBASE-22503 Failed to upgrade to 2.2+ as the global permission which storaged in zk is not right
This commit is contained in:
parent
98a1552687
commit
0fcd7cae55
|
@ -169,7 +169,13 @@ public final class AuthManager {
|
||||||
globalCache.clear();
|
globalCache.clear();
|
||||||
for (String name : globalPerms.keySet()) {
|
for (String name : globalPerms.keySet()) {
|
||||||
for (Permission permission : globalPerms.get(name)) {
|
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();
|
mtime.incrementAndGet();
|
||||||
|
|
Loading…
Reference in New Issue