From ce5acc180bfcfe06292978b1cc7960b1020a01ec Mon Sep 17 00:00:00 2001 From: Todd Lipcon Date: Fri, 12 Jul 2013 20:44:50 +0000 Subject: [PATCH] HDFS-4982. JournalNode should relogin from keytab before fetching logs from other JNs. Contributed by Todd Lipcon. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1502683 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../org/apache/hadoop/hdfs/qjournal/server/Journal.java | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index fc4a6f6489f..d5511683bff 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -39,6 +39,9 @@ Release 2.1.1-beta - UNRELEASED BUG FIXES + HDFS-4982. JournalNode should relogin from keytab before fetching logs + from other JNs (todd) + Release 2.1.0-beta - 2013-07-02 INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/Journal.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/Journal.java index 75b5a708267..4e286b539a5 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/Journal.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/Journal.java @@ -57,6 +57,7 @@ import org.apache.hadoop.hdfs.util.PersistentLongFile; import org.apache.hadoop.io.IOUtils; import org.apache.hadoop.ipc.Server; import org.apache.hadoop.security.SecurityUtil; +import org.apache.hadoop.security.UserGroupInformation; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Charsets; @@ -855,6 +856,11 @@ class Journal implements Closeable { new PrivilegedExceptionAction() { @Override public Void run() throws IOException { + // We may have lost our ticket since last checkpoint, log in again, just in case + if (UserGroupInformation.isSecurityEnabled()) { + UserGroupInformation.getCurrentUser().checkTGTAndReloginFromKeytab(); + } + boolean success = false; try { TransferFsImage.doGetUrl(url, localPaths, storage, true);