[ https://issues.apache.org/jira/browse/HDFS-16979?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17721288#comment-17721288 ]
ASF GitHub Bot commented on HDFS-16979: --------------------------------------- LiuGuH commented on code in PR #5552: URL: https://github.com/apache/hadoop/pull/5552#discussion_r1189716104 ########## hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java: ########## @@ -462,13 +462,24 @@ private void appendClientPortToCallerContextIfAbsent() { .setSignature(origSignature) .build()); } + ctx = CallerContext.getCurrent(); + if (isFormProxyUser(ctx)) { + CallerContext.setCurrent( + new CallerContext.Builder(ctx.getContext(), contextFieldSeparator) + .append(CallerContext.PROXY_USER_PORT, String.valueOf(Server.getRemotePort())) + .setSignature(ctx.getSignature()) + .build()); + } } private boolean isClientPortInfoAbsent(CallerContext ctx){ return ctx == null || ctx.getContext() == null || !ctx.getContext().contains(CallerContext.CLIENT_PORT_STR); } + private boolean isFormProxyUser(CallerContext ctx) { + return ctx != null && ctx.getContext().contains(CallerContext.REAL_USER_STR); + } Review Comment: Fixed. Thanks > RBF: Add dfsrouter port in hdfsauditlog > --------------------------------------- > > Key: HDFS-16979 > URL: https://issues.apache.org/jira/browse/HDFS-16979 > Project: Hadoop HDFS > Issue Type: Improvement > Reporter: liuguanghua > Priority: Major > Labels: pull-request-available > > When remote client request through dfsrouter to namenode, the hdfsauditlog > record the remote client ip and port ,dfsrouter IP,but lack of dfsrouter port. > This patch is done for this scene. > -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org