Skip to content

Commit 3c181ff

Browse files
RuinanGuferdelyi
authored andcommitted
HDFS-16948. Update log of BlockManager#chooseExcessRedundancyStriped when EC internal block is moved by balancer. (apache#5474). Contributed by Kidd53685368.
Reviewed-by: zhangshuyan <zqingchai@gmail.com> Signed-off-by: He Xiaoqiao <hexiaoqiao@apache.org>
1 parent ed59790 commit 3c181ff

File tree

1 file changed

+6
-2
lines changed
  • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement

1 file changed

+6
-2
lines changed

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4128,6 +4128,7 @@ private void chooseExcessRedundancyStriped(BlockCollection bc,
41284128
BitSet found = new BitSet(groupSize); //indices found
41294129
BitSet duplicated = new BitSet(groupSize); //indices found more than once
41304130
HashMap<DatanodeStorageInfo, Integer> storage2index = new HashMap<>();
4131+
boolean logEmptyExcessType = true;
41314132
for (DatanodeStorageInfo storage : nonExcess) {
41324133
int index = sblk.getStorageBlockIndex(storage);
41334134
assert index >= 0;
@@ -4145,6 +4146,7 @@ private void chooseExcessRedundancyStriped(BlockCollection bc,
41454146
Integer index = storage2index.get(delStorageHint);
41464147
if (index != null && duplicated.get(index)) {
41474148
processChosenExcessRedundancy(nonExcess, delStorageHint, storedBlock);
4149+
logEmptyExcessType = false;
41484150
}
41494151
}
41504152

@@ -4155,8 +4157,10 @@ private void chooseExcessRedundancyStriped(BlockCollection bc,
41554157
final List<StorageType> excessTypes = storagePolicy.chooseExcess(
41564158
(short) numOfTarget, DatanodeStorageInfo.toStorageTypes(nonExcess));
41574159
if (excessTypes.isEmpty()) {
4158-
LOG.warn("excess types chosen for block {} among storages {} is empty",
4159-
storedBlock, nonExcess);
4160+
if(logEmptyExcessType) {
4161+
LOG.warn("excess types chosen for block {} among storages {} is empty",
4162+
storedBlock, nonExcess);
4163+
}
41604164
return;
41614165
}
41624166

0 commit comments

Comments
 (0)