{"record":{"id":"ded4248c3b3bcb42","repo":"apache/hadoop","slug":"all-targets-are-failed","errorCode":null,"errorMessage":"All targets are failed.","messagePattern":"All targets are failed\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/erasurecode/StripedWriter.java","lineNumber":122,"sourceCode":"\n  void init() throws IOException {\n    DataChecksum checksum = reconstructor.getChecksum();\n    checksumSize = checksum.getChecksumSize();\n    bytesPerChecksum = checksum.getBytesPerChecksum();\n    int chunkSize = bytesPerChecksum + checksumSize;\n    maxChunksPerPacket = Math.max(\n        (WRITE_PACKET_SIZE - PacketHeader.PKT_MAX_HEADER_LEN) / chunkSize, 1);\n    int maxPacketSize = chunkSize * maxChunksPerPacket\n        + PacketHeader.PKT_MAX_HEADER_LEN;\n\n    packetBuf = new byte[maxPacketSize];\n    int tmpLen = checksumSize *\n        (reconstructor.getBufferSize() / bytesPerChecksum);\n    checksumBuf = new byte[tmpLen];\n\n    if (initTargetStreams() == 0) {\n      String error = \"All targets are failed.\";\n      throw new IOException(error);\n    }\n  }\n\n  private void initTargetIndices() {\n    BitSet bitset = reconstructor.getLiveBitSet();\n    BitSet excludebitset=reconstructor.getExcludeBitSet();\n\n    int m = 0;\n    hasValidTargets = false;\n    for (int i = 0; i < dataBlkNum + parityBlkNum; i++) {\n      if (!bitset.get(i)) {\n        if (reconstructor.getBlockLen(i) > 0) {\n          if (m < targets.length && !excludebitset.get(i)) {\n            targetIndices[m++] = (short)i;\n            hasValidTargets = true;\n          }\n        }\n      }","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/erasurecode/StripedWriter.java#L104-L140","documentation":"Error \"All targets are failed.\" thrown in apache/hadoop.","triggerScenarios":"Striped block write/recovery when every target DataNode in the pipeline has failed, so no stripe can be written.","commonSituations":"See trigger scenarios.","solutions":["Check the target DataNodes for the striped write: look for full disks, failed volumes, or unreachable nodes and repair them.","Ensure enough DataNodes are available to satisfy the EC policy's parity and data width.","Retry the write after the targets recover; the client may also fall back to a contiguous block if configured."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}