HBASE-27528 log duplication issues in MasterRpcServices. (#4951)

Signed-off-by: Duo Zhang <zhangduo@apache.org>
This commit is contained in:
curie71 2023-01-20 15:53:32 +08:00 committed by GitHub
parent 5feb06bd69
commit 913cf6b96d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 14 deletions

View File

@ -2809,13 +2809,6 @@ public class MasterRpcServices extends HBaseRpcServicesBase<HMaster>
mergeExistingPermissions); mergeExistingPermissions);
} }
server.cpHost.postGrant(perm, 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(); return GrantResponse.getDefaultInstance();
} else { } else {
throw new DoNotRetryIOException( throw new DoNotRetryIOException(
@ -2839,13 +2832,6 @@ public class MasterRpcServices extends HBaseRpcServicesBase<HMaster>
PermissionStorage.removeUserPermission(server.getConfiguration(), userPermission, table); PermissionStorage.removeUserPermission(server.getConfiguration(), userPermission, table);
} }
server.cpHost.postRevoke(userPermission); 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(); return RevokeResponse.getDefaultInstance();
} else { } else {
throw new DoNotRetryIOException( throw new DoNotRetryIOException(