HDFS-7714. Simultaneous restart of HA NameNodes and DataNode can cause DataNode to register successfully with only one NameNode.(Contributed by Vinayakumar B)

(cherry picked from commit 3d15728ff5)
(cherry picked from commit a1bf7aecf7)
(cherry picked from commit c1e65de57e8ef760586e28cd37397ea9a7ac7944)
This commit is contained in:
Vinayakumar B 2015-02-10 10:43:08 +05:30 committed by Vinod Kumar Vavilapalli
parent a703952d39
commit 6154abfeda
2 changed files with 8 additions and 0 deletions

View File

@ -70,6 +70,9 @@ Release 2.6.1 - UNRELEASED
HDFS-7707. Edit log corruption due to delayed block removal again.
(Yongjun Zhang via kihwal)
HDFS-7714. Simultaneous restart of HA NameNodes and DataNode can cause
DataNode to register successfully with only one NameNode.(vinayakumarb)
Release 2.6.0 - 2014-11-18
INCOMPATIBLE CHANGES

View File

@ -19,6 +19,7 @@ package org.apache.hadoop.hdfs.server.datanode;
import static org.apache.hadoop.util.Time.now;
import java.io.EOFException;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.SocketTimeoutException;
@ -802,6 +803,10 @@ class BPServiceActor implements Runnable {
// Use returned registration from namenode with updated fields
bpRegistration = bpNamenode.registerDatanode(bpRegistration);
break;
} catch(EOFException e) { // namenode might have just restarted
LOG.info("Problem connecting to server: " + nnAddr + " :"
+ e.getLocalizedMessage());
sleepAndLogInterrupts(1000, "connecting to server");
} catch(SocketTimeoutException e) { // namenode is busy
LOG.info("Problem connecting to server: " + nnAddr);
sleepAndLogInterrupts(1000, "connecting to server");