HDFS-3918. EditLogTailer shouldn't log WARN when other node is in standby mode. Contributed by Todd Lipcon.

(cherry picked from commit cce66ba3c9)
This commit is contained in:
Harsh J 2015-03-31 08:04:18 +05:30
parent abf3ad988d
commit 32766b6563
2 changed files with 14 additions and 0 deletions

View File

@ -8,6 +8,9 @@ Release 2.8.0 - UNRELEASED
IMPROVEMENTS
HDFS-3918. EditLogTailer shouldn't log WARN when other node
is in standby mode (todd via harsh)
HDFS-4396. Add START_MSG/SHUTDOWN_MSG for ZKFC
(Liang Xie via harsh)

View File

@ -42,6 +42,8 @@ import org.apache.hadoop.hdfs.server.namenode.FSNamesystem;
import org.apache.hadoop.hdfs.server.namenode.NameNode;
import org.apache.hadoop.hdfs.server.protocol.NamenodeProtocol;
import org.apache.hadoop.ipc.RPC;
import org.apache.hadoop.ipc.RemoteException;
import org.apache.hadoop.ipc.StandbyException;
import org.apache.hadoop.security.SecurityUtil;
import static org.apache.hadoop.util.Time.monotonicNow;
@ -273,6 +275,15 @@ public class EditLogTailer {
getActiveNodeProxy().rollEditLog();
lastRollTriggerTxId = lastLoadedTxnId;
} catch (IOException ioe) {
if (ioe instanceof RemoteException) {
ioe = ((RemoteException)ioe).unwrapRemoteException();
if (ioe instanceof StandbyException) {
LOG.info("Skipping log roll. Remote node is not in Active state: " +
ioe.getMessage().split("\n")[0]);
return;
}
}
LOG.warn("Unable to trigger a roll of the active NN", ioe);
}
}