Skip to content

Commit 7ef2875

Browse files
author
fermi
committed
HDFS-15798. EC: Reconstruct task failed, and It would be XmitsInProgress of DN has negative number. Contributed by huhaiyang
1 parent b99dba3 commit 7ef2875

File tree

1 file changed

+2
-4
lines changed
  • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/erasurecode

1 file changed

+2
-4
lines changed

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/erasurecode/ErasureCodingWorker.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ private void initializeStripedBlkReconstructionThreadPool(int numThreads) {
121121
public void processErasureCodingTasks(
122122
Collection<BlockECReconstructionInfo> ecTasks) {
123123
for (BlockECReconstructionInfo reconInfo : ecTasks) {
124-
int xmitsSubmitted = 0;
125124
try {
126125
StripedReconstructionInfo stripedReconInfo =
127126
new StripedReconstructionInfo(
@@ -134,20 +133,19 @@ public void processErasureCodingTasks(
134133
final StripedBlockReconstructor task =
135134
new StripedBlockReconstructor(this, stripedReconInfo);
136135
if (task.hasValidTargets()) {
136+
stripedReconstructionPool.submit(task);
137137
// See HDFS-12044. We increase xmitsInProgress even the task is only
138138
// enqueued, so that
139139
// 1) NN will not send more tasks than what DN can execute and
140140
// 2) DN will not throw away reconstruction tasks, and instead keeps
141141
// an unbounded number of tasks in the executor's task queue.
142-
xmitsSubmitted = Math.max((int)(task.getXmits() * xmitWeight), 1);
142+
int xmitsSubmitted = Math.max((int)(task.getXmits() * xmitWeight), 1);
143143
getDatanode().incrementXmitsInProcess(xmitsSubmitted);
144-
stripedReconstructionPool.submit(task);
145144
} else {
146145
LOG.warn("No missing internal block. Skip reconstruction for task:{}",
147146
reconInfo);
148147
}
149148
} catch (Throwable e) {
150-
getDatanode().decrementXmitsInProgress(xmitsSubmitted);
151149
LOG.warn("Failed to reconstruct striped block {}",
152150
reconInfo.getExtendedBlock().getLocalBlock(), e);
153151
}

0 commit comments

Comments
 (0)