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/trunk@1502682 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Todd Lipcon 2013-07-12 20:44:45 +00:00
parent b47df4e3b9
commit 0880be20ac
2 changed files with 9 additions and 0 deletions

View File

@ -270,6 +270,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

View File

@ -57,6 +57,7 @@
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 @@ private File syncLog(RequestInfo reqInfo,
new PrivilegedExceptionAction<Void>() {
@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);