You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by ki...@apache.org on 2019/10/21 21:33:33 UTC
[hadoop] branch trunk updated: HDFS-12749. DN may not send block
report to NN after NN restart. Contributed by Xiaoqiao He.
This is an automated email from the ASF dual-hosted git repository.
kihwal pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push:
new c4e27ef HDFS-12749. DN may not send block report to NN after NN restart. Contributed by Xiaoqiao He.
c4e27ef is described below
commit c4e27ef7735acd6f91b73d2ecb0227f8dd75a2e4
Author: Kihwal Lee <ki...@apache.org>
AuthorDate: Mon Oct 21 16:32:28 2019 -0500
HDFS-12749. DN may not send block report to NN after NN restart. Contributed by Xiaoqiao He.
---
.../hadoop/hdfs/server/datanode/BPServiceActor.java | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java
index 1dafdd0..495035e 100755
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java
@@ -797,11 +797,16 @@ class BPServiceActor implements Runnable {
} 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");
+ } catch(RemoteException e) {
+ LOG.warn("RemoteException in register", e);
+ throw e;
+ } catch(IOException e) {
+ LOG.warn("Problem connecting to server: " + nnAddr);
}
+ // Try again in a second
+ sleepAndLogInterrupts(1000, "connecting to server");
}
if (bpRegistration == null) {
@@ -908,6 +913,15 @@ class BPServiceActor implements Runnable {
if (bpos.processCommandFromActor(cmd, this) == false) {
return false;
}
+ } catch (RemoteException re) {
+ String reClass = re.getClassName();
+ if (UnregisteredNodeException.class.getName().equals(reClass) ||
+ DisallowedDatanodeException.class.getName().equals(reClass) ||
+ IncorrectVersionException.class.getName().equals(reClass)) {
+ LOG.warn(this + " is shutting down", re);
+ shouldServiceRun = false;
+ return false;
+ }
} catch (IOException ioe) {
LOG.warn("Error processing datanode Command", ioe);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org