Return-Path: X-Original-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F2BCF18D9C for ; Fri, 23 Oct 2015 23:39:29 +0000 (UTC) Received: (qmail 16983 invoked by uid 500); 23 Oct 2015 23:39:28 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 16896 invoked by uid 500); 23 Oct 2015 23:39:28 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-issues@hadoop.apache.org Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 16656 invoked by uid 99); 23 Oct 2015 23:39:28 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Oct 2015 23:39:28 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 89FE92C1F6B for ; Fri, 23 Oct 2015 23:39:28 +0000 (UTC) Date: Fri, 23 Oct 2015 23:39:28 +0000 (UTC) From: "Hudson (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-9184) Logging HDFS operation's caller context into audit logs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HDFS-9184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14972119#comment-14972119 ] Hudson commented on HDFS-9184: ------------------------------ FAILURE: Integrated in Hadoop-Mapreduce-trunk #2521 (See [https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2521/]) HDFS-9184. Logging HDFS operation's caller context into audit logs. (jitendra: rev 600ad7bf4104bcaeec00a4089d59bb1fdf423299) * hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/CommonConfigurationKeysPublic.java * hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java * hadoop-common-project/hadoop-common/src/main/proto/RpcHeader.proto * hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/CallerContext.java * hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java * hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/HdfsAuditLogger.java * hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ProtoUtil.java * hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestAuditLogger.java * hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt * hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestAuditLogAtDebug.java > Logging HDFS operation's caller context into audit logs > ------------------------------------------------------- > > Key: HDFS-9184 > URL: https://issues.apache.org/jira/browse/HDFS-9184 > Project: Hadoop HDFS > Issue Type: Task > Reporter: Mingliang Liu > Assignee: Mingliang Liu > Fix For: 2.8.0 > > Attachments: HDFS-9184.000.patch, HDFS-9184.001.patch, HDFS-9184.002.patch, HDFS-9184.003.patch, HDFS-9184.004.patch, HDFS-9184.005.patch, HDFS-9184.006.patch, HDFS-9184.007.patch, HDFS-9184.008.patch, HDFS-9184.009.patch > > > For a given HDFS operation (e.g. delete file), it's very helpful to track which upper level job issues it. The upper level callers may be specific Oozie tasks, MR jobs, and hive queries. One scenario is that the namenode (NN) is abused/spammed, the operator may want to know immediately which MR job should be blamed so that she can kill it. To this end, the caller context contains at least the application-dependent "tracking id". > There are several existing techniques that may be related to this problem. > 1. Currently the HDFS audit log tracks the users of the the operation which is obviously not enough. It's common that the same user issues multiple jobs at the same time. Even for a single top level task, tracking back to a specific caller in a chain of operations of the whole workflow (e.g.Oozie -> Hive -> Yarn) is hard, if not impossible. > 2. HDFS integrated {{htrace}} support for providing tracing information across multiple layers. The span is created in many places interconnected like a tree structure which relies on offline analysis across RPC boundary. For this use case, {{htrace}} has to be enabled at 100% sampling rate which introduces significant overhead. Moreover, passing additional information (via annotations) other than span id from root of the tree to leaf is a significant additional work. > 3. In [HDFS-4680 | https://issues.apache.org/jira/browse/HDFS-4680], there are some related discussion on this topic. The final patch implemented the tracking id as a part of delegation token. This protects the tracking information from being changed or impersonated. However, kerberos authenticated connections or insecure connections don't have tokens. [HADOOP-8779] proposes to use tokens in all the scenarios, but that might mean changes to several upstream projects and is a major change in their security implementation. > We propose another approach to address this problem. We also treat HDFS audit log as a good place for after-the-fact root cause analysis. We propose to put the caller id (e.g. Hive query id) in threadlocals. Specially, on client side the threadlocal object is passed to NN as a part of RPC header (optional), while on sever side NN retrieves it from header and put it to {{Handler}}'s threadlocals. Finally in {{FSNamesystem}}, HDFS audit logger will record the caller context for each operation. In this way, the existing code is not affected. > It is still challenging to keep "lying" client from abusing the caller context. Our proposal is to add a {{signature}} field to the caller context. The client choose to provide its signature along with the caller id. The operator may need to validate the signature at the time of offline analysis. The NN is not responsible for validating the signature online. -- This message was sent by Atlassian JIRA (v6.3.4#6332)