HDFS-17151. EC: Fix wrong metadata in BlockInfoStriped after recovery. (#5938). Contributed by Shuyan Zhang.

Signed-off-by: He Xiaoqiao <hexiaoqiao@apache.org>
This commit is contained in:
zhangshuyan 2023-08-21 10:05:34 +08:00 committed by GitHub
parent 7368226332
commit 60867de422
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -468,9 +468,9 @@ protected void recover() throws IOException {
// notify Namenode the new size and locations // notify Namenode the new size and locations
final DatanodeID[] newLocs = new DatanodeID[totalBlkNum]; final DatanodeID[] newLocs = new DatanodeID[totalBlkNum];
final String[] newStorages = new String[totalBlkNum]; final String[] newStorages = new String[totalBlkNum];
for (int i = 0; i < blockIndices.length; i++) { for (int i = 0; i < newLocs.length; i++) {
newLocs[blockIndices[i]] = DatanodeID.EMPTY_DATANODE_ID; newLocs[i] = DatanodeID.EMPTY_DATANODE_ID;
newStorages[blockIndices[i]] = ""; newStorages[i] = "";
} }
for (BlockRecord r : rurList) { for (BlockRecord r : rurList) {
int index = (int) (r.rInfo.getBlockId() & int index = (int) (r.rInfo.getBlockId() &