[ 
https://issues.apache.org/jira/browse/HDFS-13293?focusedWorklogId=496128&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-496128
 ]

ASF GitHub Bot logged work on HDFS-13293:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 06/Oct/20 19:23
            Start Date: 06/Oct/20 19:23
    Worklog Time Spent: 10m 
      Work Description: goiri commented on a change in pull request #2363:
URL: https://github.com/apache/hadoop/pull/2363#discussion_r500540849



##########
File path: 
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcClient.java
##########
@@ -116,10 +118,13 @@
   /** Optional perf monitor. */
   private final RouterRpcMonitor rpcMonitor;
 
+  private final Configuration clientConf;
+
   /** Pattern to parse a stack trace line. */
   private static final Pattern STACK_TRACE_PATTERN =
       Pattern.compile("\\tat (.*)\\.(.*)\\((.*):(\\d*)\\)");
 
+  private static final String CLIENT_IP_STR = "clientIp";

Review comment:
       One of the things that was brought up in the past was to send back in 
the context which was the namespace that executed this.
   Anyway, let's focus on the locality one for now.
   Does it make sense to add a test to make sure we can do proper locality from 
the Namenode side with this change? Or should we leave this for the future.

##########
File path: 
hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterRpc.java
##########
@@ -1901,4 +1903,19 @@ private DFSClient getFileDFSClient(final String path) {
     }
     return null;
   }
+
+  @Test
+  public void testCreateWithCallerContext() throws IOException {
+    GenericTestUtils.LogCapturer auditlog =
+        GenericTestUtils.LogCapturer.captureLogs(FSNamesystem.auditLog);
+
+    // Create a directory via the router
+    String dirPath = "/test_dir_with_callercontext";
+    FsPermission permission = new FsPermission("705");
+    routerProtocol.mkdirs(dirPath, permission, false);
+
+    // The audit log should contains "callerContext=clientIp:"
+    assertTrue(auditlog.getOutput().contains("callerContext=clientIp:"));

Review comment:
       I was referring to having this test with a null context but also a test 
with some already passed context.




----------------------------------------------------------------
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:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 496128)
    Time Spent: 1h  (was: 50m)

> RBF: The RouterRPCServer should transfer CallerContext and client ip 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: 1h
>  Remaining Estimate: 0h
>
> Otherwise, the namenode don't know the client's callerContext



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to