You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zg...@apache.org on 2019/05/31 01:10:58 UTC

[hbase] branch master updated: HBASE-22503 Failed to upgrade to 2.2+ as the global permission which storaged in zk is not right

This is an automated email from the ASF dual-hosted git repository.

zghao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/master by this push:
     new 0fcd7ca  HBASE-22503 Failed to upgrade to 2.2+ as the global permission which storaged in zk is not right
0fcd7ca is described below

commit 0fcd7cae55a0a0442db367316d2d4d89d12b0065
Author: Guanghao <zg...@apache.org>
AuthorDate: Fri May 31 09:10:52 2019 +0800

    HBASE-22503 Failed to upgrade to 2.2+ as the global permission which storaged in zk is not right
---
 .../java/org/apache/hadoop/hbase/security/access/AuthManager.java | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AuthManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AuthManager.java
index 5262036..3ced725 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AuthManager.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AuthManager.java
@@ -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();