You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2020/10/07 17:27:00 UTC
[jira] [Work logged] (HDFS-13293) RBF: The RouterRPCServer should
transfer client IP via CallerContext to NamenodeRpcServer
[ https://issues.apache.org/jira/browse/HDFS-13293?focusedWorklogId=496778&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-496778 ]
ASF GitHub Bot logged work on HDFS-13293:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 07/Oct/20 17:26
Start Date: 07/Oct/20 17:26
Worklog Time Spent: 10m
Work Description: ferhui commented on a change in pull request #2363:
URL: https://github.com/apache/hadoop/pull/2363#discussion_r501185702
##########
File path: hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterRpc.java
##########
@@ -1901,4 +1904,27 @@ private DFSClient getFileDFSClient(final String path) {
}
return null;
}
+
+ @Test
+ public void testMkdirsWithCallerContext() throws IOException {
+ GenericTestUtils.LogCapturer auditlog =
+ GenericTestUtils.LogCapturer.captureLogs(FSNamesystem.auditLog);
+
+ // Current callerContext is null
+ assertNull(CallerContext.getCurrent());
+
+ // Set client context
+ CallerContext.setCurrent(
+ new CallerContext.Builder("clientContext").build());
+
+ // Create a directory via the router
+ String dirPath = "/test_dir_with_callercontext";
+ FsPermission permission = new FsPermission("755");
+ routerProtocol.mkdirs(dirPath, permission, false);
+
+ // The audit log should contains "callerContext=clientContext,clientIp:"
+ assertTrue(auditlog.getOutput()
+ .contains("callerContext=clientContext,clientIp:"));
Review comment:
Or just keep it that way, and do not modify UT
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Issue Time Tracking
-------------------
Worklog Id: (was: 496778)
Time Spent: 2h 10m (was: 2h)
> RBF: The RouterRPCServer should transfer client IP via CallerContext to NamenodeRpcServer
> -----------------------------------------------------------------------------------------
>
> Key: HDFS-13293
> URL: https://issues.apache.org/jira/browse/HDFS-13293
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Reporter: maobaolong
> Assignee: Hui Fei
> Priority: Major
> Labels: pull-request-available
> Attachments: HDFS-13293.001.patch
>
> Time Spent: 2h 10m
> Remaining Estimate: 0h
>
> Otherwise, the namenode don't know the client's callerContext
> This jira focuses on audit log which logs real client ip. Leave locality to HDFS-13248
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org