HDFS-12749. DN may not send block report to NN after NN restart. Contributed by Xiaoqiao He.
(cherry picked from commit c4e27ef7735acd6f91b73d2ecb0227f8dd75a2e4)
This commit is contained in:
parent
ea574087d1
commit
2d1f3611cd
@ -776,11 +776,16 @@ void register(NamespaceInfo nsInfo) throws IOException {
|
|||||||
} catch(EOFException e) { // namenode might have just restarted
|
} catch(EOFException e) { // namenode might have just restarted
|
||||||
LOG.info("Problem connecting to server: " + nnAddr + " :"
|
LOG.info("Problem connecting to server: " + nnAddr + " :"
|
||||||
+ e.getLocalizedMessage());
|
+ 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");
|
} 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");
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG.info("Block pool " + this + " successfully registered with NN");
|
LOG.info("Block pool " + this + " successfully registered with NN");
|
||||||
@ -883,6 +888,15 @@ boolean processCommand(DatanodeCommand[] cmds) {
|
|||||||
if (bpos.processCommandFromActor(cmd, this) == false) {
|
if (bpos.processCommandFromActor(cmd, this) == false) {
|
||||||
return 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) {
|
} catch (IOException ioe) {
|
||||||
LOG.warn("Error processing datanode Command", ioe);
|
LOG.warn("Error processing datanode Command", ioe);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user