Skip to content

Commit

Permalink
HDFS-16676. DatanodeAdminManager$Monitor reports a node as invalid co…
Browse files Browse the repository at this point in the history
…ntinuously (#4626)

Co-authored-by: Ashutosh Gupta <[email protected]>
  • Loading branch information
ashutoshcipher and Ashutosh Gupta authored Aug 17, 2022
1 parent 86abeb4 commit 5cc8c57
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ private void check() {
iterkey).iterator();
final List<DatanodeDescriptor> toRemove = new ArrayList<>();
final List<DatanodeDescriptor> unhealthyDns = new ArrayList<>();
boolean isValidState = true;

while (it.hasNext() && !exceededNumBlocksPerCheck() && namesystem
.isRunning()) {
Expand Down Expand Up @@ -265,6 +266,7 @@ private void check() {
// to track maintenance expiration.
dnAdmin.setInMaintenance(dn);
} else {
isValidState = false;
Preconditions.checkState(false,
"Node %s is in an invalid state! "
+ "Invalid state: %s %s blocks are on this dn.",
Expand All @@ -288,7 +290,11 @@ private void check() {
// an invalid state.
LOG.warn("DatanodeAdminMonitor caught exception when processing node "
+ "{}.", dn, e);
getPendingNodes().add(dn);
if(isValidState){
getPendingNodes().add(dn);
} else {
LOG.warn("Ignoring the node {} which is in invalid state", dn);
}
toRemove.add(dn);
unhealthyDns.remove(dn);
} finally {
Expand Down

0 comments on commit 5cc8c57

Please sign in to comment.