From 4850266a259c7b0682ba680fee064a05b5b8c07c Mon Sep 17 00:00:00 2001 From: curie71 <39853223+curie71@users.noreply.github.com> Date: Mon, 9 Jan 2023 22:46:26 +0800 Subject: [PATCH] HBASE-27528 log duplication issues in MasterRpcServices. delete the auditlog from grant and revoke in MasterRpcServices. --- .../hadoop/hbase/master/MasterRpcServices.java | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java index db02d7699bb9..f490e8377d14 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java @@ -2809,13 +2809,6 @@ public GrantResponse grant(RpcController controller, GrantRequest request) mergeExistingPermissions); } server.cpHost.postGrant(perm, mergeExistingPermissions); - User caller = RpcServer.getRequestUser().orElse(null); - if (AUDITLOG.isTraceEnabled()) { - // audit log should store permission changes in addition to auth results - String remoteAddress = RpcServer.getRemoteAddress().map(InetAddress::toString).orElse(""); - AUDITLOG.trace("User {} (remote address: {}) granted permission {}", caller, - remoteAddress, perm); - } return GrantResponse.getDefaultInstance(); } else { throw new DoNotRetryIOException( @@ -2839,13 +2832,6 @@ public RevokeResponse revoke(RpcController controller, RevokeRequest request) PermissionStorage.removeUserPermission(server.getConfiguration(), userPermission, table); } server.cpHost.postRevoke(userPermission); - User caller = RpcServer.getRequestUser().orElse(null); - if (AUDITLOG.isTraceEnabled()) { - // audit log should record all permission changes - String remoteAddress = RpcServer.getRemoteAddress().map(InetAddress::toString).orElse(""); - AUDITLOG.trace("User {} (remote address: {}) revoked permission {}", caller, - remoteAddress, userPermission); - } return RevokeResponse.getDefaultInstance(); } else { throw new DoNotRetryIOException(