Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 257C22004A1 for ; Thu, 10 Aug 2017 00:22:04 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 2235D16A305; Wed, 9 Aug 2017 22:22:04 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 682B916A303 for ; Thu, 10 Aug 2017 00:22:03 +0200 (CEST) Received: (qmail 7755 invoked by uid 500); 9 Aug 2017 22:22:02 -0000 Mailing-List: contact hdfs-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list hdfs-dev@hadoop.apache.org Received: (qmail 7742 invoked by uid 99); 9 Aug 2017 22:22:02 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Aug 2017 22:22:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id E0BFAC03DE for ; Wed, 9 Aug 2017 22:22:01 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 3bTpJX6J3z_Y for ; Wed, 9 Aug 2017 22:22:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id C562E5F2F1 for ; Wed, 9 Aug 2017 22:22:00 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 503F3E0051 for ; Wed, 9 Aug 2017 22:22:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 0D47221E14 for ; Wed, 9 Aug 2017 22:22:00 +0000 (UTC) Date: Wed, 9 Aug 2017 22:22:00 +0000 (UTC) From: "Ming Ma (JIRA)" To: hdfs-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (HDFS-12285) Better handling of namenode ip address change MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 09 Aug 2017 22:22:04 -0000 Ming Ma created HDFS-12285: ------------------------------ Summary: Better handling of namenode ip address change Key: HDFS-12285 URL: https://issues.apache.org/jira/browse/HDFS-12285 Project: Hadoop HDFS Issue Type: Bug Reporter: Ming Ma RPC client layer provides functionality to detect ip address change: {noformat} Client.java private synchronized boolean updateAddress() throws IOException { // Do a fresh lookup with the old host name. InetSocketAddress currentAddr = NetUtils.createSocketAddrForHost( server.getHostName(), server.getPort()); ...... } {noformat} To use this feature, we need to enable retry via {{dfs.client.retry.policy.enabled}}. Otherwise {{TryOnceThenFail}} RetryPolicy will be used; which caused {{handleConnectionFailure}} to throw {{ConnectException}} exception without retrying with the new ip address. {noformat} private void handleConnectionFailure(int curRetries, IOException ioe ) throws IOException { closeConnection(); final RetryAction action; try { action = connectionRetryPolicy.shouldRetry(ioe, curRetries, 0, true); } catch(Exception e) { throw e instanceof IOException? (IOException)e: new IOException(e); } ...... } {noformat} However, using such configuration isn't ideal. What happens is DFSClient still has the cached the old ip address created by {{namenode = proxyInfo.getProxy();}}. Then when a new rpc connection is created, it starts with the old ip followed by retry with the new ip. It will be nice if DFSClient can refresh namenode proxy automatically. -- This message was sent by Atlassian JIRA (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-dev-unsubscribe@hadoop.apache.org For additional commands, e-mail: hdfs-dev-help@hadoop.apache.org