From 419fb4a4dee3cd001631daa06fe6b8c30095b468 Mon Sep 17 00:00:00 2001 From: Kihwal Lee Date: Tue, 28 May 2013 15:49:33 +0000 Subject: [PATCH] svn merge -c 1486974 Merging from trunk to branch-2 to fix HDFS-4780. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1486975 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../src/main/java/org/apache/hadoop/hdfs/HftpFileSystem.java | 4 ++-- .../apache/hadoop/hdfs/server/namenode/GetImageServlet.java | 2 +- .../apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java | 2 +- .../hadoop/hdfs/server/namenode/ha/StandbyCheckpointer.java | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index b68c6afe0ef..fdfa8e07839 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -287,6 +287,9 @@ Release 2.0.5-beta - UNRELEASED HDFS-4825. webhdfs / httpfs tests broken because of min block size change. (Andrew Wang via suresh) + HDFS-4780. Use the correct relogin method for services. (Robert Parker via + kihwal) + BREAKDOWN OF HDFS-347 SUBTASKS AND RELATED JIRAS HDFS-4353. Encapsulate connections to peers in Peer and PeerServer classes. diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/HftpFileSystem.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/HftpFileSystem.java index 7d97c972532..9d9cde4dc02 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/HftpFileSystem.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/HftpFileSystem.java @@ -251,7 +251,7 @@ public class HftpFileSystem extends FileSystem ) throws IOException { try { //Renew TGT if needed - ugi.reloginFromKeytab(); + ugi.checkTGTAndReloginFromKeytab(); return ugi.doAs(new PrivilegedExceptionAction>() { @Override public Token run() throws IOException { @@ -704,7 +704,7 @@ public class HftpFileSystem extends FileSystem public long renew(Token token, Configuration conf) throws IOException { // update the kerberos credentials, if they are coming from a keytab - UserGroupInformation.getLoginUser().reloginFromKeytab(); + UserGroupInformation.getLoginUser().checkTGTAndReloginFromKeytab(); // use http to renew the token InetSocketAddress serviceAddr = SecurityUtil.getTokenServiceAddr(token); return diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/GetImageServlet.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/GetImageServlet.java index dcec0ef08c0..dfe1c6af69a 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/GetImageServlet.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/GetImageServlet.java @@ -157,7 +157,7 @@ public class GetImageServlet extends HttpServlet { // We may have lost our ticket since last checkpoint, log in again, just in case if (UserGroupInformation.isSecurityEnabled()) { - UserGroupInformation.getCurrentUser().reloginFromKeytab(); + UserGroupInformation.getCurrentUser().checkTGTAndReloginFromKeytab(); } // issue a HTTP get request to download the new fsimage diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java index 4384126fc34..b370c3901af 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java @@ -371,7 +371,7 @@ public class SecondaryNameNode implements Runnable { try { // We may have lost our ticket since last checkpoint, log in again, just in case if(UserGroupInformation.isSecurityEnabled()) - UserGroupInformation.getCurrentUser().reloginFromKeytab(); + UserGroupInformation.getCurrentUser().checkTGTAndReloginFromKeytab(); long now = Time.now(); diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ha/StandbyCheckpointer.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ha/StandbyCheckpointer.java index a97e55dd348..46f13f0416b 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ha/StandbyCheckpointer.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ha/StandbyCheckpointer.java @@ -262,7 +262,7 @@ public class StandbyCheckpointer { try { // We may have lost our ticket since last checkpoint, log in again, just in case if (UserGroupInformation.isSecurityEnabled()) { - UserGroupInformation.getCurrentUser().reloginFromKeytab(); + UserGroupInformation.getCurrentUser().checkTGTAndReloginFromKeytab(); } long now = now();