/** * Returns whether a node can be safely decommissioned or in maintenance * based on its liveness. Dead nodes cannot always be safely decommissioned * or in maintenance. */ boolean isNodeHealthyForDecommissionOrMaintenance(DatanodeDescriptor node) { if (!node.checkBlockReportReceived()) { LOG.info("Node {} hasn't sent its first block report.", node); return false; } if (node.isAlive()) { return true; } updateState(); if (pendingReconstructionBlocksCount == 0 && lowRedundancyBlocksCount == 0) { LOG.info("Node {} is dead and there are no low redundancy" + " blocks or blocks pending reconstruction. Safe to decommission or", " put in maintenance.", node); return true; } LOG.warn("Node {} is dead " + "while in {}. Cannot be safely " + "decommissioned or be in maintenance since there is risk of reduced " + "data durability or data loss. Either restart the failed node or " + "force decommissioning or maintenance by removing, calling " + "refreshNodes, then re-adding to the excludes or host config files.", node, node.getAdminState()); return false; }
this.updateState(); this.scheduledReplicationBlocksCount = workFound; } finally {
/** * Refresh block queue counts on the name-node. */ public static void updateState(final BlockManager blockManager) { blockManager.updateState(); }
/** * Returns whether a node can be safely decommissioned based on its * liveness. Dead nodes cannot always be safely decommissioned. */ boolean isNodeHealthyForDecommission(DatanodeDescriptor node) { if (!node.checkBlockReportReceived()) { LOG.info("Node {} hasn't sent its first block report.", node); return false; } if (node.isAlive) { return true; } updateState(); if (pendingReplicationBlocksCount == 0 && underReplicatedBlocksCount == 0) { LOG.info("Node {} is dead and there are no under-replicated" + " blocks or blocks pending replication. Safe to decommission.", node); return true; } LOG.warn("Node {} is dead " + "while decommission is in progress. Cannot be safely " + "decommissioned since there is risk of reduced " + "data durability or data loss. Either restart the failed node or" + " force decommissioning by removing, calling refreshNodes, " + "then re-adding to the excludes files.", node); return false; }
/** * Returns whether a node can be safely decommissioned based on its * liveness. Dead nodes cannot always be safely decommissioned. */ boolean isNodeHealthyForDecommission(DatanodeDescriptor node) { if (!node.checkBlockReportReceived()) { LOG.info("Node {} hasn't sent its first block report.", node); return false; } if (node.isAlive) { return true; } updateState(); if (pendingReplicationBlocksCount == 0 && underReplicatedBlocksCount == 0) { LOG.info("Node {} is dead and there are no under-replicated" + " blocks or blocks pending replication. Safe to decommission.", node); return true; } LOG.warn("Node {} is dead " + "while decommission is in progress. Cannot be safely " + "decommissioned since there is risk of reduced " + "data durability or data loss. Either restart the failed node or" + " force decommissioning by removing, calling refreshNodes, " + "then re-adding to the excludes files.", node); return false; }
this.updateState(); this.scheduledReplicationBlocksCount = workFound; } finally {
this.updateState(); this.scheduledReplicationBlocksCount = workFound; } finally {