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
)
This commit is contained in:
parent
24d4d933f7
commit
a1bf7aecf7
|
@ -596,6 +596,9 @@ Release 2.7.0 - UNRELEASED
|
||||||
HDFS-7718. Store KeyProvider in ClientContext to avoid leaking key provider
|
HDFS-7718. Store KeyProvider in ClientContext to avoid leaking key provider
|
||||||
threads when using FileContext (Arun Suresh via Colin P. McCabe)
|
threads when using FileContext (Arun Suresh via Colin P. McCabe)
|
||||||
|
|
||||||
|
HDFS-7714. Simultaneous restart of HA NameNodes and DataNode can cause
|
||||||
|
DataNode to register successfully with only one NameNode.(vinayakumarb)
|
||||||
|
|
||||||
Release 2.6.1 - UNRELEASED
|
Release 2.6.1 - UNRELEASED
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
|
|
@ -19,6 +19,7 @@ package org.apache.hadoop.hdfs.server.datanode;
|
||||||
|
|
||||||
import static org.apache.hadoop.util.Time.now;
|
import static org.apache.hadoop.util.Time.now;
|
||||||
|
|
||||||
|
import java.io.EOFException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.net.SocketTimeoutException;
|
import java.net.SocketTimeoutException;
|
||||||
|
@ -803,6 +804,10 @@ class BPServiceActor implements Runnable {
|
||||||
// Use returned registration from namenode with updated fields
|
// Use returned registration from namenode with updated fields
|
||||||
bpRegistration = bpNamenode.registerDatanode(bpRegistration);
|
bpRegistration = bpNamenode.registerDatanode(bpRegistration);
|
||||||
break;
|
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
|
} catch(SocketTimeoutException e) { // namenode is busy
|
||||||
LOG.info("Problem connecting to server: " + nnAddr);
|
LOG.info("Problem connecting to server: " + nnAddr);
|
||||||
sleepAndLogInterrupts(1000, "connecting to server");
|
sleepAndLogInterrupts(1000, "connecting to server");
|
||||||
|
|
Loading…
Reference in New Issue