Skip to content

Commit

Permalink
Only track blocks in RBW state and fix single Javadoc warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Wikant committed Dec 24, 2024
1 parent 290ff09 commit 731900e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1770,9 +1770,9 @@ public class DFSConfigKeys extends CommonConfigurationKeys {
/**
* "dfs.namenode.decommission.track.underconstructionblocks" feature is
* disabled by default. Enabling this feature will benefit HDFS clusters
* with datanode decommissioning operations and HDFS blocks/files held
* with datanode decommissioning operations and HDFS blocks held
* open for extended periods of time. These HDFS clusters will see
* reduction in HDFS write failures & HDFS data loss.
* reduction in HDFS write failures and HDFS data loss.
*/
public static final boolean DFS_DECOMMISSION_TRACK_UNDER_CONSTRUCTION_BLOCKS_DEFAULT =
false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3731,16 +3731,16 @@ void addStoredBlockUnderConstruction(StatefulBlockInfo ucBlock,
block.getUnderConstructionFeature().addReplicaIfNotPresent(
storageInfo, ucBlock.reportedBlock, ucBlock.reportedState);

// Add replica if appropriate. If the replica was previously corrupt
// but now okay, it might need to be updated.
if (ucBlock.reportedState == ReplicaState.FINALIZED && (
block.findStorageInfo(storageInfo) < 0) || corruptReplicas
.isReplicaCorrupt(block, storageInfo.getDatanodeDescriptor())) {
addStoredBlock(block, ucBlock.reportedBlock, storageInfo, null, true);
} else {
if (ucBlock.reportedState == ReplicaState.RBW) {
// Non-finalized Under Construction blocks are not added to the StorageInfos.
// They are instead tracked via UnderConstructionBlocks data structure.
ucBlocks.addUcBlock(storageInfo.getDatanodeDescriptor(), ucBlock.reportedBlock);
} else if (ucBlock.reportedState == ReplicaState.FINALIZED && (
block.findStorageInfo(storageInfo) < 0) || corruptReplicas
.isReplicaCorrupt(block, storageInfo.getDatanodeDescriptor())) {
// Add replica if appropriate. If the replica was previously corrupt
// but now okay, it might need to be updated.
addStoredBlock(block, ucBlock.reportedBlock, storageInfo, null, true);
}
}

Expand Down

0 comments on commit 731900e

Please sign in to comment.