Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengchenyu committed Nov 8, 2024
1 parent 1a8e790 commit c74ecd9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2310,7 +2310,8 @@ BlockReconstructionWork scheduleReconstruction(BlockInfo block,
byte[] newIndices = new byte[liveBlockIndices.size()];
adjustSrcNodesAndIndices((BlockInfoStriped)block,
srcNodes, liveBlockIndices, newSrcNodes, newIndices);
byte[] liveAndDecommissioningBusyIndices = new byte[liveAndDecommissioningBusyBlockIndices.size()];
byte[] liveAndDecommissioningBusyIndices =
new byte[liveAndDecommissioningBusyBlockIndices.size()];
for (int i = 0; i < liveAndDecommissioningBusyBlockIndices.size(); i++) {
liveAndDecommissioningBusyIndices[i] = liveAndDecommissioningBusyBlockIndices.get(i);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1233,6 +1233,14 @@
</description>
</property>

<property>
<name>dfs.namenode.decommission.ec.reconstruction.enable</name>
<value>false</value>
<description>
Whether to use reconstruction to copy ec block when the related node is busy.
</description>
</property>

<property>
<name>dfs.namenode.redundancy.interval.seconds</name>
<value>3</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
import org.apache.hadoop.hdfs.server.namenode.NameNodeAdapter;
import org.apache.hadoop.security.token.Token;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.hadoop.util.Lists;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
Expand Down Expand Up @@ -1215,7 +1214,7 @@ public void testDecommissionBusyNodeWithECReconstruction1() throws Exception {
assertTrue(newStorageInfos.size() >= 2);
DatanodeStorageInfo decommissionedNode = null;
int alive = 0;
for (int i = 0; i < newStorageInfos.size();i ++) {
for (int i = 0; i < newStorageInfos.size(); i++) {
DatanodeStorageInfo datanodeStorageInfo = newStorageInfos.get(i);
if (datanodeStorageInfo.getDatanodeDescriptor().isDecommissioned()) {
decommissionedNode = datanodeStorageInfo;
Expand Down Expand Up @@ -1286,7 +1285,7 @@ public void testDecommissionBusyNodeWithECReconstruction2() throws Exception {
assertTrue(newStorageInfos.size() >= 4);
int alive = 0;
int decommissioned = 0;
for (int i = 0; i < newStorageInfos.size();i ++) {
for (int i = 0; i < newStorageInfos.size(); i++) {
DatanodeStorageInfo newDatanodeStorageInfo = newStorageInfos.get(i);
if (newDatanodeStorageInfo.getDatanodeDescriptor().isDecommissioned()) {
assertTrue(newDatanodeStorageInfo.equals(storageInfos.get(0)) ||
Expand Down

0 comments on commit c74ecd9

Please sign in to comment.