Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDDS-10859. Improve error messages when decommission and maintenance fail-early #6678

Merged
merged 1 commit into from
May 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,6 @@ public synchronized List<DatanodeAdminError> decommissionNodes(
boolean decommissionPossible = checkIfDecommissionPossible(dns, errors);
if (!decommissionPossible) {
LOG.error("Cannot decommission nodes as sufficient node are not available.");
errors.add(new DatanodeAdminError("AllHosts", "Sufficient nodes are not available."));
return errors;
}
} else {
Expand Down Expand Up @@ -436,10 +435,11 @@ private synchronized boolean checkIfDecommissionPossible(List<DatanodeDetails> d
}
int reqNodes = cif.getReplicationConfig().getRequiredNodes();
if ((inServiceTotal - numDecom) < reqNodes) {
LOG.info("Cannot decommission nodes. Tried to decommission {} nodes of which valid nodes = {}. " +
"Cluster state: In-service nodes = {}, nodes required for replication = {}. " +
"Failing due to datanode : {}, container : {}",
dns.size(), numDecom, inServiceTotal, reqNodes, dn, cid);
String errorMsg = "Insufficient nodes. Tried to decommission " + dns.size() +
" nodes of which " + numDecom + " nodes were valid. Cluster has " + inServiceTotal +
" IN-SERVICE nodes, " + reqNodes + " of which are required for minimum replication. ";
LOG.info(errorMsg + "Failing due to datanode : {}, container : {}", dn, cid);
errors.add(new DatanodeAdminError("AllHosts", errorMsg));
return false;
}
}
Expand Down Expand Up @@ -495,7 +495,6 @@ public synchronized List<DatanodeAdminError> startMaintenanceNodes(
boolean maintenancePossible = checkIfMaintenancePossible(dns, errors);
if (!maintenancePossible) {
LOG.error("Cannot put nodes to maintenance as sufficient node are not available.");
errors.add(new DatanodeAdminError("AllHosts", "Sufficient nodes are not available."));
return errors;
}
} else {
Expand Down Expand Up @@ -600,11 +599,11 @@ private synchronized boolean checkIfMaintenancePossible(List<DatanodeDetails> dn
minInService = maintenanceReplicaMinimum;
}
if ((inServiceTotal - numMaintenance) < minInService) {
LOG.info("Cannot enter nodes into maintenance. Tried to start maintenance for {} nodes " +
"of which valid nodes = {}. " +
"Cluster state: In-service nodes = {}, nodes required for replication = {}. " +
"Failing due to datanode : {}, container : {}",
dns.size(), numMaintenance, inServiceTotal, minInService, dn, cid);
String errorMsg = "Insufficient nodes. Tried to start maintenance for " + dns.size() +
" nodes of which " + numMaintenance + " nodes were valid. Cluster has " + inServiceTotal +
" IN-SERVICE nodes, " + minInService + " of which are required for minimum replication. ";
LOG.info(errorMsg + "Failing due to datanode : {}, container : {}", dn, cid);
errors.add(new DatanodeAdminError("AllHosts", errorMsg));
return false;
}
}
Expand Down