From 60867de422949be416948bd106419c771c7d13fd Mon Sep 17 00:00:00 2001 From: zhangshuyan <81411509+zhangshuyan0@users.noreply.github.com> Date: Mon, 21 Aug 2023 10:05:34 +0800 Subject: [PATCH] HDFS-17151. EC: Fix wrong metadata in BlockInfoStriped after recovery. (#5938). Contributed by Shuyan Zhang. Signed-off-by: He Xiaoqiao --- .../hadoop/hdfs/server/datanode/BlockRecoveryWorker.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockRecoveryWorker.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockRecoveryWorker.java index e4861f9774..249888c464 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockRecoveryWorker.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockRecoveryWorker.java @@ -468,9 +468,9 @@ protected void recover() throws IOException { // notify Namenode the new size and locations final DatanodeID[] newLocs = new DatanodeID[totalBlkNum]; final String[] newStorages = new String[totalBlkNum]; - for (int i = 0; i < blockIndices.length; i++) { - newLocs[blockIndices[i]] = DatanodeID.EMPTY_DATANODE_ID; - newStorages[blockIndices[i]] = ""; + for (int i = 0; i < newLocs.length; i++) { + newLocs[i] = DatanodeID.EMPTY_DATANODE_ID; + newStorages[i] = ""; } for (BlockRecord r : rurList) { int index = (int) (r.rInfo.getBlockId() &